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. MyController.org
  4. Serial Gateway and MQTT Broker

Serial Gateway and MQTT Broker

Scheduled Pinned Locked Moved MyController.org
31 Posts 7 Posters 8.4k Views 6 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.
  • Diego BaravalleD Offline
    Diego BaravalleD Offline
    Diego Baravalle
    wrote on last edited by
    #1

    Hi everybody!

    I need to setup two or more "controllers" and a requeriment is to use serial gateway (Arduino as serial gateway connected to raspberry).

    Is it possible?

    Can I setup two controllers listening to same serial port?
    Can I use MyController configured with serial gateway and publish all messages to MQTT?
    Is there another alternative?

    Thanks!

    barduinoB 1 Reply Last reply
    0
    • J Offline
      J Offline
      jkandasa
      Plugin Developer
      wrote on last edited by
      #2

      @Diego-Baravalle for now MyController will not push serial gateway messages to MQTT

      F 1 Reply Last reply
      0
      • Diego BaravalleD Diego Baravalle

        Hi everybody!

        I need to setup two or more "controllers" and a requeriment is to use serial gateway (Arduino as serial gateway connected to raspberry).

        Is it possible?

        Can I setup two controllers listening to same serial port?
        Can I use MyController configured with serial gateway and publish all messages to MQTT?
        Is there another alternative?

        Thanks!

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

        @Diego-Baravalle

        In theory you could use nodeJS to read from serial and push to MQTT.

        From there you should be able to have 2 MQTT enabled controllers subscribing/publishing to broker.

        That should be an interesting experiment

        Cheers

        1 Reply Last reply
        0
        • Diego BaravalleD Offline
          Diego BaravalleD Offline
          Diego Baravalle
          wrote on last edited by
          #4

          @jkandasa, @barduino

          Thanks for your answers.

          Use NodeJS is an interesting option.

          1 Reply Last reply
          0
          • J jkandasa

            @Diego-Baravalle for now MyController will not push serial gateway messages to MQTT

            F Offline
            F Offline
            Frank C
            wrote on last edited by
            #5

            @jkandasa is there a future feature to push serial-gateway messages with MyController's build in MQTT? It would a great feature.

            J gohanG 3 Replies Last reply
            0
            • F Frank C

              @jkandasa is there a future feature to push serial-gateway messages with MyController's build in MQTT? It would a great feature.

              J Offline
              J Offline
              jkandasa
              Plugin Developer
              wrote on last edited by
              #6

              @Frank-C For now no plan

              1 Reply Last reply
              0
              • F Frank C

                @jkandasa is there a future feature to push serial-gateway messages with MyController's build in MQTT? It would a great feature.

                gohanG Offline
                gohanG Offline
                gohan
                Mod
                wrote on last edited by
                #7

                @Frank-C
                It would be quite a redundant function because you can publish directly from the gateway if you use an ethernet shield, but it's not your case if I understood right

                1 Reply Last reply
                0
                • F Frank C

                  @jkandasa is there a future feature to push serial-gateway messages with MyController's build in MQTT? It would a great feature.

                  J Offline
                  J Offline
                  jkandasa
                  Plugin Developer
                  wrote on last edited by
                  #8

                  @Frank-C But I can write simple library to run independently to convert serial gateway messages to MQTT type. If you want.

                  F 1 Reply Last reply
                  0
                  • J jkandasa

                    @Frank-C But I can write simple library to run independently to convert serial gateway messages to MQTT type. If you want.

                    F Offline
                    F Offline
                    Frank C
                    wrote on last edited by
                    #9

                    @jkandasa That would be fantastic if you could ? I think it would be a great feature :)

                    J 1 Reply Last reply
                    0
                    • F Frank C

                      @jkandasa That would be fantastic if you could ? I think it would be a great feature :)

                      J Offline
                      J Offline
                      jkandasa
                      Plugin Developer
                      wrote on last edited by
                      #10

                      @Frank-C Yes, I can. but you have to run it as separate service. I will create a separate project for this work. I am not going to include this on MyController project.

                      F 1 Reply Last reply
                      0
                      • J jkandasa

                        @Frank-C Yes, I can. but you have to run it as separate service. I will create a separate project for this work. I am not going to include this on MyController project.

                        F Offline
                        F Offline
                        Frank C
                        wrote on last edited by
                        #11

                        @jkandasa As a seperate service is okay, it would be very helpful. Thank you

                        1 Reply Last reply
                        0
                        • Diego BaravalleD Offline
                          Diego BaravalleD Offline
                          Diego Baravalle
                          wrote on last edited by
                          #12

                          @jkandasa Perfect!

                          1 Reply Last reply
                          0
                          • FotoFieberF Offline
                            FotoFieberF Offline
                            FotoFieber
                            Hardware Contributor
                            wrote on last edited by
                            #13

                            Maybe this is enough for your requirement:
                            https://forum.mysensors.org/topic/4599/how-to-add-a-serial-device-to-use-in-node-red/10

                            F 1 Reply Last reply
                            0
                            • FotoFieberF FotoFieber

                              Maybe this is enough for your requirement:
                              https://forum.mysensors.org/topic/4599/how-to-add-a-serial-device-to-use-in-node-red/10

                              F Offline
                              F Offline
                              Frank C
                              wrote on last edited by
                              #14

                              @FotoFieber Thanks for the suggestion, I got that working. I have had to change MyController to read an MQTT gateway. Problem now is MyController can't read the MQTT format of this script. Any suggestions or tips ?
                              MyController does such a great job with handling MySensors' data, it would be a pity to loose that functionality.

                              FotoFieberF 1 Reply Last reply
                              0
                              • F Frank C

                                @FotoFieber Thanks for the suggestion, I got that working. I have had to change MyController to read an MQTT gateway. Problem now is MyController can't read the MQTT format of this script. Any suggestions or tips ?
                                MyController does such a great job with handling MySensors' data, it would be a pity to loose that functionality.

                                FotoFieberF Offline
                                FotoFieberF Offline
                                FotoFieber
                                Hardware Contributor
                                wrote on last edited by
                                #15

                                @Frank-C
                                The script uses the serial protocol and should be compatible with the mysesnosrs mqtt-gateway. Are the pub/sub-topics set correct?

                                F 1 Reply Last reply
                                0
                                • FotoFieberF FotoFieber

                                  @Frank-C
                                  The script uses the serial protocol and should be compatible with the mysesnosrs mqtt-gateway. Are the pub/sub-topics set correct?

                                  F Offline
                                  F Offline
                                  Frank C
                                  wrote on last edited by Frank C
                                  #16

                                  @FotoFieber MyController is getting the MQTT msg, but doesn't like it's format, i've had continuous error msg like below:
                                  2017-02-16 18:17:34,657 ERROR [Thread-4] [org.mycontroller.standalone.provider.mysensors.MySensorsProviderBridge:60] Unable to process this rawMessage:RawMessage(gatewayId=2, data=2;0;1;0;23;36, subData=mysensors/1/out/, isTxMessage=false, networkType=MY_SENSORS)
                                  org.mycontroller.standalone.message.RawMessageException: Unknown message format, Topic:mysensors/1/out/, PayLoad:2;0;1;0;23;36
                                  at org.mycontroller.standalone.provider.mysensors.MySensorsRawMessage.updateMQTTMessage(MySensorsRawMessage.java:114) ~[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]

                                  MyController is set up with the correct topic, as seen in above Topic:/mysensors/1/out/ (i've also tried without the ending /).

                                  J 1 Reply Last reply
                                  0
                                  • FotoFieberF Offline
                                    FotoFieberF Offline
                                    FotoFieber
                                    Hardware Contributor
                                    wrote on last edited by FotoFieber
                                    #17

                                    2;0;1;0;23;36 Is a correct message according to the serial API. I don't know anything about your controller...sorry

                                    Maybe the controller needs the ; translated to / in the topic?

                                    Have you tried to switch pub/sub topic?

                                    1 Reply Last reply
                                    0
                                    • F Frank C

                                      @FotoFieber MyController is getting the MQTT msg, but doesn't like it's format, i've had continuous error msg like below:
                                      2017-02-16 18:17:34,657 ERROR [Thread-4] [org.mycontroller.standalone.provider.mysensors.MySensorsProviderBridge:60] Unable to process this rawMessage:RawMessage(gatewayId=2, data=2;0;1;0;23;36, subData=mysensors/1/out/, isTxMessage=false, networkType=MY_SENSORS)
                                      org.mycontroller.standalone.message.RawMessageException: Unknown message format, Topic:mysensors/1/out/, PayLoad:2;0;1;0;23;36
                                      at org.mycontroller.standalone.provider.mysensors.MySensorsRawMessage.updateMQTTMessage(MySensorsRawMessage.java:114) ~[mycontroller-dist-standalone-0.0.3.Alpha2-single.jar:0.0.3.Alpha2]

                                      MyController is set up with the correct topic, as seen in above Topic:/mysensors/1/out/ (i've also tried without the ending /).

                                      J Offline
                                      J Offline
                                      jkandasa
                                      Plugin Developer
                                      wrote on last edited by
                                      #18

                                      @Frank-C Current approach of MyController on MQTT see only payload on message. Other data(nodeId, sensorIds, etc) from topic. Kindly create a request on MyController issue page. I will address this. If we address this I am not going to create separate service to parse serial-to-real-mqtt service type.

                                      F 1 Reply Last reply
                                      0
                                      • J jkandasa

                                        @Frank-C Current approach of MyController on MQTT see only payload on message. Other data(nodeId, sensorIds, etc) from topic. Kindly create a request on MyController issue page. I will address this. If we address this I am not going to create separate service to parse serial-to-real-mqtt service type.

                                        F Offline
                                        F Offline
                                        Frank C
                                        wrote on last edited by
                                        #19

                                        @jkandasa Thanks for the follow up. I can see MyController is modifying the serial message into a customized MQTT msg (as you have said).
                                        MyController works great with the serial so it would be good to keep that as is, and if we had an independent service to publish to a separate MQTT broker would be very helpful?

                                        J 1 Reply Last reply
                                        0
                                        • F Frank C

                                          @jkandasa Thanks for the follow up. I can see MyController is modifying the serial message into a customized MQTT msg (as you have said).
                                          MyController works great with the serial so it would be good to keep that as is, and if we had an independent service to publish to a separate MQTT broker would be very helpful?

                                          J Offline
                                          J Offline
                                          jkandasa
                                          Plugin Developer
                                          wrote on last edited by
                                          #20

                                          @Frank-C cool, we will go with independent service.

                                          F 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