Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. General Discussion
  3. MQTT on Serial Gateway?

MQTT on Serial Gateway?

Scheduled Pinned Locked Moved General Discussion
12 Posts 4 Posters 4.1k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    Grubstake
    wrote on last edited by
    #1

    I've been using MQTT with a GPIO-wired Raspberry Pi gateway successfully for a number of months. I don't like the jumper-wire interconnect to the radio, so I'm moving off the Pi and onto a small Linux server (Intel NUC). As part of this I'm considering a serial gateway...but I notice there is no MQTT client option in the gateway code GatewaySerial.ino.

    Am I missing something or is this a technical limitation? I'm aware of the options with ethernet or Wifi gateways, but like the simplicity of a USB connection if it is a viable option. I'm committed to continuing to use MQTT. I also like the idea of a direct wired connection from the gateway to the controller without hopping over the LAN in between.

    Any info or opinions welcome and appreciated.

    Thanks!

    Tim

    YveauxY barduinoB 2 Replies Last reply
    0
    • G Grubstake

      I've been using MQTT with a GPIO-wired Raspberry Pi gateway successfully for a number of months. I don't like the jumper-wire interconnect to the radio, so I'm moving off the Pi and onto a small Linux server (Intel NUC). As part of this I'm considering a serial gateway...but I notice there is no MQTT client option in the gateway code GatewaySerial.ino.

      Am I missing something or is this a technical limitation? I'm aware of the options with ethernet or Wifi gateways, but like the simplicity of a USB connection if it is a viable option. I'm committed to continuing to use MQTT. I also like the idea of a direct wired connection from the gateway to the controller without hopping over the LAN in between.

      Any info or opinions welcome and appreciated.

      Thanks!

      Tim

      YveauxY Offline
      YveauxY Offline
      Yveaux
      Mod
      wrote on last edited by
      #2

      @Grubstake I'm using NodeRed in combination with the MySensors Nodes by @tbowmo.
      You could run a similar setup on your NUC with serial gateway connected. Use these nodes to de/encode the serial gateway format and connect them to MQTT nodes.

      In the past I developed a serial-to-mqtt converter (see here) but I've moved away from separate solutions, concentrating on NodeRed.

      http://yveaux.blogspot.nl

      G 1 Reply Last reply
      0
      • YveauxY Yveaux

        @Grubstake I'm using NodeRed in combination with the MySensors Nodes by @tbowmo.
        You could run a similar setup on your NUC with serial gateway connected. Use these nodes to de/encode the serial gateway format and connect them to MQTT nodes.

        In the past I developed a serial-to-mqtt converter (see here) but I've moved away from separate solutions, concentrating on NodeRed.

        G Offline
        G Offline
        Grubstake
        wrote on last edited by Grubstake
        #3

        @Yveaux Thanks, Yveaux. Mode Red looks pretty interesting and I think it may be very useful down the road. At this moment I'm trying to keep things as simple as possible (despite my MQTT constraint). I'm already comfortable with MQTT and if serial is a problem I'll probably go to ESP8266 Wifi, as I'm already familiar with the ESP modules.

        I'm just trying to select the best gateway, with the transport from radio to WAN being as fast/low latency and trouble-free as possible...but not looking for extra work! Wondering if the MQTT protocol already integrated into MySGW on the Rpi, ESP/Wifi, and Ethernet gateways might be a possiblity for Serial.

        Tim

        YveauxY 1 Reply Last reply
        0
        • G Grubstake

          @Yveaux Thanks, Yveaux. Mode Red looks pretty interesting and I think it may be very useful down the road. At this moment I'm trying to keep things as simple as possible (despite my MQTT constraint). I'm already comfortable with MQTT and if serial is a problem I'll probably go to ESP8266 Wifi, as I'm already familiar with the ESP modules.

          I'm just trying to select the best gateway, with the transport from radio to WAN being as fast/low latency and trouble-free as possible...but not looking for extra work! Wondering if the MQTT protocol already integrated into MySGW on the Rpi, ESP/Wifi, and Ethernet gateways might be a possiblity for Serial.

          Tim

          YveauxY Offline
          YveauxY Offline
          Yveaux
          Mod
          wrote on last edited by
          #4

          @Grubstake Yes they are. If you drop the serial gateway requirement there are a lot more possibilities :+1:
          My other gateway runs on a Uno+W5100 Ethernet shield with MQTT. Rock solid!

          http://yveaux.blogspot.nl

          G 1 Reply Last reply
          0
          • YveauxY Yveaux

            @Grubstake Yes they are. If you drop the serial gateway requirement there are a lot more possibilities :+1:
            My other gateway runs on a Uno+W5100 Ethernet shield with MQTT. Rock solid!

            G Offline
            G Offline
            Grubstake
            wrote on last edited by Grubstake
            #5

            @Yveaux Interesting. What controller does your gateway talk to? I'm trying to get up and running with OpenHAB 2.0 which has its own MySensors binding issues to deal with an its unclear if it will work with MQTT.

            Tim

            YveauxY E 2 Replies Last reply
            0
            • G Grubstake

              @Yveaux Interesting. What controller does your gateway talk to? I'm trying to get up and running with OpenHAB 2.0 which has its own MySensors binding issues to deal with an its unclear if it will work with MQTT.

              Tim

              YveauxY Offline
              YveauxY Offline
              Yveaux
              Mod
              wrote on last edited by
              #6

              @Grubstake I'm not using a controller. NodeRed controls the logic and stores data in InfluxDB.

              http://yveaux.blogspot.nl

              G 1 Reply Last reply
              0
              • G Grubstake

                @Yveaux Interesting. What controller does your gateway talk to? I'm trying to get up and running with OpenHAB 2.0 which has its own MySensors binding issues to deal with an its unclear if it will work with MQTT.

                Tim

                E Offline
                E Offline
                ericvdb
                wrote on last edited by ericvdb
                #7

                @Grubstake if you build a MQTT MySensors gateway, there's no OpenHab binding needed. Disadvantage is that you need to configure your nodes in OpenHab manually.

                G 1 Reply Last reply
                0
                • YveauxY Yveaux

                  @Grubstake I'm not using a controller. NodeRed controls the logic and stores data in InfluxDB.

                  G Offline
                  G Offline
                  Grubstake
                  wrote on last edited by
                  #8

                  @Yveaux No controller...Interesting. Thank you for sharing that, it moves NodeRed up on the list I think, even though I do want to get OpenHAB running to see how useful it is. Thanks!

                  1 Reply Last reply
                  0
                  • E ericvdb

                    @Grubstake if you build a MQTT MySensors gateway, there's no OpenHab binding needed. Disadvantage is that you need to configure your nodes in OpenHab manually.

                    G Offline
                    G Offline
                    Grubstake
                    wrote on last edited by
                    #9

                    @ericvdb Eric, I did not know that the MySensors binding wasn't needed for MQTT on OpenHAB. My short term goal is to get ANY sensor configured and running on OpenHAB 2.0, and since I already have a MySensors MQTT gateway running on my rPi, that is an interesting option. Very helpful, thanks.

                    1 Reply Last reply
                    0
                    • G Grubstake

                      I've been using MQTT with a GPIO-wired Raspberry Pi gateway successfully for a number of months. I don't like the jumper-wire interconnect to the radio, so I'm moving off the Pi and onto a small Linux server (Intel NUC). As part of this I'm considering a serial gateway...but I notice there is no MQTT client option in the gateway code GatewaySerial.ino.

                      Am I missing something or is this a technical limitation? I'm aware of the options with ethernet or Wifi gateways, but like the simplicity of a USB connection if it is a viable option. I'm committed to continuing to use MQTT. I also like the idea of a direct wired connection from the gateway to the controller without hopping over the LAN in between.

                      Any info or opinions welcome and appreciated.

                      Thanks!

                      Tim

                      barduinoB Offline
                      barduinoB Offline
                      barduino
                      wrote on last edited by
                      #10

                      Hi @Grubstake

                      In my case, I just use a nodeJS script which reads from serial and publishes to mqtt. It also subscribes from mqtt and sends it to serial.

                      Pretty straight forward. For more details, look here.

                      Cheers

                      G 1 Reply Last reply
                      0
                      • barduinoB barduino

                        Hi @Grubstake

                        In my case, I just use a nodeJS script which reads from serial and publishes to mqtt. It also subscribes from mqtt and sends it to serial.

                        Pretty straight forward. For more details, look here.

                        Cheers

                        G Offline
                        G Offline
                        Grubstake
                        wrote on last edited by
                        #11

                        @barduino Thanks for that. So many great suggestions in this thread.

                        For the "learning this stuff as I go along folks", like me :grimacing: could you share briefly what's involved in using your code, beyond basic install of node.js?

                        Trying to choose my battles, and moving from Domoticz to OpenHAB, new setup of InfluxDB, Grafana, Node-red are already on the top of a long list... So much software, so little time...

                        Not to mention hardware...

                        But, hey, an ESP-Easy MQTT node popped up in my OpenHAB Paper UI last night, after a few minutes of tweaking the node, which is a first, so that's a baby step. MySensors next...

                        Tim

                        barduinoB 1 Reply Last reply
                        0
                        • G Grubstake

                          @barduino Thanks for that. So many great suggestions in this thread.

                          For the "learning this stuff as I go along folks", like me :grimacing: could you share briefly what's involved in using your code, beyond basic install of node.js?

                          Trying to choose my battles, and moving from Domoticz to OpenHAB, new setup of InfluxDB, Grafana, Node-red are already on the top of a long list... So much software, so little time...

                          Not to mention hardware...

                          But, hey, an ESP-Easy MQTT node popped up in my OpenHAB Paper UI last night, after a few minutes of tweaking the node, which is a first, so that's a baby step. MySensors next...

                          Tim

                          barduinoB Offline
                          barduinoB Offline
                          barduino
                          wrote on last edited by
                          #12

                          Hi @Grubstake,

                          Not much else...

                          You can have node running (as a service or daemon) on any device that has a USB port (PC, mac, RPI) and it is agnostic of what controller you have.

                          Are you interested in the code details? Check the MySensors post I included in the link.

                          The MySensors typical messages is something like this 30;5;1;0;37;70

                          Which gets translated to /whateverpathyouwant/out/30/5/1/0/37 Payload: 70

                          And vice versa.

                          The reason I did this was because I had no WiFi or Network enabled gateway.

                          Cheers

                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          18

                          Online

                          11.7k

                          Users

                          11.2k

                          Topics

                          113.1k

                          Posts


                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • MySensors
                          • OpenHardware.io
                          • Categories
                          • Recent
                          • Tags
                          • Popular