MQTT using Node.js with practical examples

Поділитися
Вставка
  • Опубліковано 10 січ 2023
  • This post/video will show you how to get started using MQTT in a Node.js environment with some practical projects using CLI and an Express web application.
    We are using mqtt.js in the frontend applications to retrieve MQTT messages from our Mosquitto broker.
    WriteUp:
    www.donskytech.com/mqtt-node-js/
    Publish and Subscribe MQTT messages over WebSocket:
    • Publish and Subscribe ...
    Code:
    github.com/donskytech/mqtt-node

    If you like my post or videos then please consider subscribing to my channels and sharing them with your friends:
    Website: www.donskytech.com
    UA-cam: / donskytech
    Facebook: / donskytech
    Twitter: / donskytech
    If you are generous and think I have helped you, please consider buying me a coffee. 🙂
    Buy Me a Coffee:
    buymeacoffee.com/donskytech
    #mqtt
    #mosquitto
    #node
    #express
    #mqtt.js
  • Наука та технологія

КОМЕНТАРІ • 22

  • @millen_basquiat
    @millen_basquiat 7 місяців тому

    Amazing video! Thank you so much for the content

    • @DonskyTech
      @DonskyTech  7 місяців тому

      Glad you enjoyed it! Happy exploring!

  • @emreozberkdilek1104
    @emreozberkdilek1104 9 місяців тому +1

    It would be so good if you make video about mqtt in react-native.

    • @DonskyTech
      @DonskyTech  9 місяців тому

      Hey, I have plans of doing this actually in the future. Please subscribe to my channel to get notified. Thank you!

  • @jachencarl
    @jachencarl 8 місяців тому

    Hi Sir and thank you for your nice work here.
    I tried your cli-project and I am stuck at the problem that my Mosquitto broker requires user an password to authorise access.
    Where and how would one include those parameters or arguments?

    • @DonskyTech
      @DonskyTech  8 місяців тому

      Hey, I forgot the API code but you could send it in the Javascript also.

  • @francarmonaromero3175
    @francarmonaromero3175 8 місяців тому

    Just a dummy question, Can I publish and getting Subscribe at the same time? I want apply to my arduino, so i can active sensors and showing up into an angular app, that can modify them too. Thanks!

    • @DonskyTech
      @DonskyTech  8 місяців тому +1

      Not a dummy question as this is a possible use case. So yes, you could subscribe and publish at the same time

    • @francarmonaromero3175
      @francarmonaromero3175 8 місяців тому

      @@DonskyTech thanks! Dont know if you can help me with another Big problem that i have.
      I configured my mqtt mosquitto server with stl and works nice with mqtt Explorer and with node.js, the problem its i dont know how configure Arduino to connect with It. All examples are with the Port 1883 and nothing about certificates or expired function like .setCaCertificate. Can you tell me some tips to looking for? Were looking for info like 4 days but without luck.
      Thanks!

    • @francarmonaromero3175
      @francarmonaromero3175 8 місяців тому

      When i configure my ESP8266 with subpubclient and wificlientsecure and set the certs with setClientRsaCert (for client) and setTrustAnchors(for ca) all compile bit the server respond with: New connection from 'ip' on Port 8883. Client disconnected: protocol error.
      Pls u know what can i do to fix It? Thanks in Advance!

  • @xnuxuz
    @xnuxuz 2 місяці тому

    bro how if i want to send data to devices ? (on/off device or something else)

  • @vandc1684
    @vandc1684 10 місяців тому +1

    why my console on /subscriber return "connection to websocket failed" :((

    • @DonskyTech
      @DonskyTech  10 місяців тому

      Hmmm... Is there any console logs from the browser and also the server? There should be a message that could lead you to the cause of the error.

    • @vandc1684
      @vandc1684 10 місяців тому

      @@DonskyTech i finally found my problem, thank u

    • @DonskyTech
      @DonskyTech  10 місяців тому

      Great! Glad you figured it out. Happy exploring!

    • @kenpang5812
      @kenpang5812 9 місяців тому

      Hi @vandc1684 could you share how you resolve this problem I am also facing the same issue. thanks

  • @ExpectZombiesHD
    @ExpectZombiesHD Рік тому

    how would i publish a video?

  • @saifshaikh5547
    @saifshaikh5547 11 місяців тому +1

    Is it work offline?

    • @DonskyTech
      @DonskyTech  11 місяців тому

      Hey if the Mosquitto server will run with the same web application then it should run

  • @dolevdo
    @dolevdo Рік тому +1

    super difficult example, please make it more simple

    • @DonskyTech
      @DonskyTech  Рік тому +2

      Hey, have you checked the writeup? It requires knowledge of Node.js and Javascript and the example project is simple enough for beginners as long as you know javascript.