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. Controllers
  3. Node-RED
  4. Flow to turn SerialGateway into MQTT-SerialGateway

Flow to turn SerialGateway into MQTT-SerialGateway

Scheduled Pinned Locked Moved Node-RED
13 Posts 5 Posters 7.8k Views 11 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.
  • crankyC Offline
    crankyC Offline
    cranky
    wrote on last edited by
    #4

    Oh, it's that error :p

    Delete the sheet, and re-copy. It will show up then. That, btw, is an existing bug in NR.

    barduinoB 1 Reply Last reply
    0
    • crankyC cranky

      Oh, it's that error :p

      Delete the sheet, and re-copy. It will show up then. That, btw, is an existing bug in NR.

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

      @cranky

      as you can see on my log the npm install does not return any errors.

      I had to manually create a nodes directory and install the files manually.

      Anyway I guess I don't need it anymore since you removed the dependency

      Thanks

      Cheers

      1 Reply Last reply
      0
      • crankyC Offline
        crankyC Offline
        cranky
        wrote on last edited by
        #6

        @barduino . How peculiar. I think it might be the way RasPi chose to include Node-red. It appears that you might need to do my above npm command with sudo... You shouldn't need to hand-create node_modules or node-red-contrib-mysensors. npm should have done that all for you, along with any potential dependencies. Adafruit's help goes into Pi-weirdness: https://learn.adafruit.com/raspberry-pi-hosting-node-red/installing-further-plugins

        But I hope the mysensors removal works well. Like I said, haven't tested it yet :P

        Good luck!
        Cranky

        barduinoB 1 Reply Last reply
        0
        • crankyC cranky

          @barduino . How peculiar. I think it might be the way RasPi chose to include Node-red. It appears that you might need to do my above npm command with sudo... You shouldn't need to hand-create node_modules or node-red-contrib-mysensors. npm should have done that all for you, along with any potential dependencies. Adafruit's help goes into Pi-weirdness: https://learn.adafruit.com/raspberry-pi-hosting-node-red/installing-further-plugins

          But I hope the mysensors removal works well. Like I said, haven't tested it yet :P

          Good luck!
          Cranky

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

          @cranky,

          This is actually a MAC-weirdness... no worries.

          Well it connected to the amazon MQTT server no problems there.

          But i don't have my gateway with me, will test later.

          Thanks!

          1 Reply Last reply
          0
          • crankyC Offline
            crankyC Offline
            cranky
            wrote on last edited by
            #8

            Gladly :) There's more coming out. I just provided the flow to handle "DHCP" sensors (or the ones that do REQ ID 255;255;3;0;3;\n)

            One step at a time....

            fetsF 1 Reply Last reply
            0
            • greglG Offline
              greglG Offline
              gregl
              Hero Member
              wrote on last edited by
              #9

              Very cool!
              Im currently using the dev branch MQTTClient Gateway sketch - but will keep my eye on this!

              1 Reply Last reply
              0
              • crankyC cranky

                Gladly :) There's more coming out. I just provided the flow to handle "DHCP" sensors (or the ones that do REQ ID 255;255;3;0;3;\n)

                One step at a time....

                fetsF Offline
                fetsF Offline
                fets
                wrote on last edited by
                #10

                @cranky congrats for your work.
                Do you you have in your luggage a flow to "turn SerialGateway into EthernetGateway" ?

                1 Reply Last reply
                0
                • crankyC Offline
                  crankyC Offline
                  cranky
                  wrote on last edited by cranky
                  #11

                  Unfortunately, I do not. Until when I just looked at the source "MyGatewayTransportEthernet.cpp", I mistakenly assumed that it too published to an MQTT broker.

                  It doesn't look too terribly hard to do; with UDP being easier. But my main caveat here is that I don't have an SPI ethernet port for an arduino. That means I wouldn't be able to test my code.

                  If there was a packet documentation for TCP and UDP, I could write code for the reference. Again, past library and serial documentation, there is none I can refer to.

                  Of if some hardware fairy would be willing to send me a compatible SPI ethernet port, I could do it :-D


                  documentation

                  MY_PORT = (default) 5003
                  (TCP/UDP) choice
                  (server mode / client mode) choice. IP dest. reqd for being client
                  buffer receiving: 100 B
                  buffer sending: 120 B

                  1 Reply Last reply
                  0
                  • crankyC Offline
                    crankyC Offline
                    cranky
                    wrote on last edited by cranky
                    #12

                    Ok, as you saw, I got the MQTT<-->TCP connector done , and that's live :)

                    Now, I have my GH up and populated. It's pretty sparse with documentation right now, but that will change.
                    https://github.com/jwcrawley/node-red-mysensors-flows/

                    What's cool is I can use a the "Watch" NR node and watch for updates in my working directory and auto-push :-D

                    All you need is your SSH keys set up.

                    Then you watch for /.git/COMMIT_EDITMSG and when a change hits that, do a

                    git add (repo directory)
                    

                    Then read the /.git/COMMIT_EDITMSG into msg.payload and then send it to an EXEC node as

                    git commit -m {{payload}}
                    

                    And then

                    git push origin master
                    

                    ..... And there you have it: automated local to Github.

                    1 Reply Last reply
                    0
                    • Mathieu ChambonM Offline
                      Mathieu ChambonM Offline
                      Mathieu Chambon
                      wrote on last edited by
                      #13

                      I think you made one mistake in the flow, you need to remove "To MQTT" in the Topic item and put "To MQTT" in the Name item else all the message go in "To MQTT" topic.

                      I have start to make the same flow and I found this post, thanks for the job.

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


                      22

                      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