Skip to content
  • 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. Hardware
  3. MQTT Client Gateway / Node Controller / OTA
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

MQTT Client Gateway / Node Controller / OTA

Scheduled Pinned Locked Moved Hardware
otamqtt
50 Posts 9 Posters 14.3k Views 10 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.
  • CrankyCoderC Offline
    CrankyCoderC Offline
    CrankyCoder
    wrote on last edited by
    #1

    I am moving forward with some of my builds. I love the mqtt client gateway. This works great with my existing mqtt setup. There are 2 things I am unsure of.

    1. is there a node controller type of system for the mqtt stuff? like myscontroller?
    2. if I am using the mqtt client gateway. Is it possible to do OTA updates? If so, is there an example/documentation?

    Thanks guys!

    Home Automation Tinkerer
    www.CrankyCoder.net

    Controller: HomeAssistant in Kubernetes
    Gateway: MQTTClientGateway
    MySensors: 2.3

    maghacM 1 Reply Last reply
    1
    • CrankyCoderC CrankyCoder

      I am moving forward with some of my builds. I love the mqtt client gateway. This works great with my existing mqtt setup. There are 2 things I am unsure of.

      1. is there a node controller type of system for the mqtt stuff? like myscontroller?
      2. if I am using the mqtt client gateway. Is it possible to do OTA updates? If so, is there an example/documentation?

      Thanks guys!

      maghacM Offline
      maghacM Offline
      maghac
      wrote on last edited by
      #2

      @Jason-Brunk
      Did you get anywhere with this? I am also looking for OTA updates using the MQTT client gateway.

      1 Reply Last reply
      0
      • CrankyCoderC Offline
        CrankyCoderC Offline
        CrankyCoder
        wrote on last edited by
        #3

        not really.

        I was looking at this. https://www.mysensors.org/controller/mycontroller

        Maybe using it for JUST the ota stuff and inventory.

        Home Automation Tinkerer
        www.CrankyCoder.net

        Controller: HomeAssistant in Kubernetes
        Gateway: MQTTClientGateway
        MySensors: 2.3

        maghacM 1 Reply Last reply
        0
        • CrankyCoderC CrankyCoder

          not really.

          I was looking at this. https://www.mysensors.org/controller/mycontroller

          Maybe using it for JUST the ota stuff and inventory.

          maghacM Offline
          maghacM Offline
          maghac
          wrote on last edited by
          #4

          @Jason-Brunk Ok, I'll have a look. Lika you say, maybe possible to use it only for OTA updates. I'm using HomeAssistant and I'm not ready to switch (especially to something which is version 0.0.3.Alpha2 :) )

          1 Reply Last reply
          0
          • CrankyCoderC Offline
            CrankyCoderC Offline
            CrankyCoder
            wrote on last edited by
            #5

            Im with you. I don't want to switch off openhab just to be able to do updates :)

            Home Automation Tinkerer
            www.CrankyCoder.net

            Controller: HomeAssistant in Kubernetes
            Gateway: MQTTClientGateway
            MySensors: 2.3

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Samuel235
              Hardware Contributor
              wrote on last edited by
              #6

              I'm also here with this predicament. I use OpenHAB and W5100 client gateway and would like to be able to push OTA updates. I'm also not really liking the idea of having to disconnect OpenHAB and then connect MyController to just issue updates. Would we need to add each device into MyController manually to see them? I've been playing with it but i can't even get it to connect properly yet.

              Also, thinking about it, would we need to disconnect OpenHAB as its only on MQTT and technically doesn't interface with the gateway/mysensors other than taking readings off of MQTT topics, its not like a serial connection to the gateway or anything.....

              MySensors 2.1.1
              Controller - OpenHAB (Virtual Machine)
              Gateway - Arduino Mega MQTT Gateway W5100

              1 Reply Last reply
              0
              • maghacM Offline
                maghacM Offline
                maghac
                wrote on last edited by
                #7

                Yes, I was hoping that since the only interface to the gateway is actually through MQTT, the controller wouldn't "own" it and MyController could also connect to it.

                I didn't actually get as far as MyController since I never managed to burn the bootloader required for OTA updates and haven't had time to play with it more :)

                S 1 Reply Last reply
                0
                • maghacM maghac

                  Yes, I was hoping that since the only interface to the gateway is actually through MQTT, the controller wouldn't "own" it and MyController could also connect to it.

                  I didn't actually get as far as MyController since I never managed to burn the bootloader required for OTA updates and haven't had time to play with it more :)

                  S Offline
                  S Offline
                  Samuel235
                  Hardware Contributor
                  wrote on last edited by
                  #8

                  @maghac - i'm going to play with the bootloader later today, if i can get that on some nanos (just to test) then i will load up MyController and connect to the MQTT. If i can get this working i can't see any issues with this plan, as like we have both said, the controller isn't owning the gateway. So, I personally don't see any issues AS LONG AS we do not set any rules or anything to trigger on anything within the MyController environment. The moment we do that it will then conflict with OpenHAB (or any other controller for that matter).

                  However, I may take a look around to see if we have any decent way of implementing an interface for tablets/scene controllers with MyController, if so this could even be an easier controller. Not sure if it has much capabilities like OpenHAB does with other protocols though. I run a Windows server at home so I'm okay with throwing that onto there if needs be. But i would like to stick with OpenHAB as I have learnt how it works (some what anyway).

                  Do you know of any info or guides on MyController?

                  I keep getting MyController and MYSController mixed up too, its a shame that MYSController doesn't support MQTT, that would have been perfect for our needs.

                  MySensors 2.1.1
                  Controller - OpenHAB (Virtual Machine)
                  Gateway - Arduino Mega MQTT Gateway W5100

                  1 Reply Last reply
                  0
                  • gohanG Offline
                    gohanG Offline
                    gohan
                    Mod
                    wrote on last edited by
                    #9

                    So basically if we want to make ota updates we need to temporarily replace the mqtt gateway with another ethernet gateway, wait for the sensors to reconnect, run updates and restore back the mqtt, correct?

                    S 1 Reply Last reply
                    0
                    • gohanG gohan

                      So basically if we want to make ota updates we need to temporarily replace the mqtt gateway with another ethernet gateway, wait for the sensors to reconnect, run updates and restore back the mqtt, correct?

                      S Offline
                      S Offline
                      Samuel235
                      Hardware Contributor
                      wrote on last edited by
                      #10

                      @gohan - If MyController is able to push OTA updates over MQTT (which i'm about to test, give me an hour or two) then no. My theory is that because MQTT doesn't connect the controller directly to the gateway then we shouldn't need to shut anything down, only start MyController up and push the updates.

                      MySensors 2.1.1
                      Controller - OpenHAB (Virtual Machine)
                      Gateway - Arduino Mega MQTT Gateway W5100

                      V 1 Reply Last reply
                      0
                      • S Samuel235

                        @gohan - If MyController is able to push OTA updates over MQTT (which i'm about to test, give me an hour or two) then no. My theory is that because MQTT doesn't connect the controller directly to the gateway then we shouldn't need to shut anything down, only start MyController up and push the updates.

                        V Offline
                        V Offline
                        vikasjee
                        wrote on last edited by
                        #11

                        @Samuel235 What are your results?

                        S 1 Reply Last reply
                        0
                        • V vikasjee

                          @Samuel235 What are your results?

                          S Offline
                          S Offline
                          Samuel235
                          Hardware Contributor
                          wrote on last edited by
                          #12

                          @vikasjee - I've upgraded my gateway to MySensorsV2.1 and having some pretty bad results with just powering up. I'm waiting for people with V2.1 MQTT gateways to reply to threads. Do you run with MQTT gateways on V2.1 by any chance?

                          MySensors 2.1.1
                          Controller - OpenHAB (Virtual Machine)
                          Gateway - Arduino Mega MQTT Gateway W5100

                          1 Reply Last reply
                          0
                          • maghacM Offline
                            maghacM Offline
                            maghac
                            wrote on last edited by
                            #13

                            I am running a v2.1 MQTT Gateway on a NodeMCU (so it connects to the network with wifi) and it works fine.

                            It's a bit picky with the power supply but I think that's more a hardware than a software issue.

                            S 1 Reply Last reply
                            0
                            • maghacM maghac

                              I am running a v2.1 MQTT Gateway on a NodeMCU (so it connects to the network with wifi) and it works fine.

                              It's a bit picky with the power supply but I think that's more a hardware than a software issue.

                              S Offline
                              S Offline
                              Samuel235
                              Hardware Contributor
                              wrote on last edited by
                              #14

                              @maghac - I'm not sure how that setup works, but are you able to see any sort of serial monitor to debug or anything?

                              MySensors 2.1.1
                              Controller - OpenHAB (Virtual Machine)
                              Gateway - Arduino Mega MQTT Gateway W5100

                              1 Reply Last reply
                              0
                              • maghacM Offline
                                maghacM Offline
                                maghac
                                wrote on last edited by
                                #15

                                Yes, when I program it with Arduino IDE I use the serial monitor like normal with other boards. Never had any problems with it.

                                If you go back to an older version, does it work then?

                                S 1 Reply Last reply
                                0
                                • maghacM maghac

                                  Yes, when I program it with Arduino IDE I use the serial monitor like normal with other boards. Never had any problems with it.

                                  If you go back to an older version, does it work then?

                                  S Offline
                                  S Offline
                                  Samuel235
                                  Hardware Contributor
                                  wrote on last edited by
                                  #16

                                  @maghac I downgraded my boardDefs last night to 1.6.11 like advised on this forum. I'm about to install arduino IDE 1.6.11 and replace my latest install of Arduino and attempt to use this. What arduino IDE environment do you use, out of curiosity?

                                  MySensors 2.1.1
                                  Controller - OpenHAB (Virtual Machine)
                                  Gateway - Arduino Mega MQTT Gateway W5100

                                  1 Reply Last reply
                                  0
                                  • S Offline
                                    S Offline
                                    Samuel235
                                    Hardware Contributor
                                    wrote on last edited by
                                    #17

                                    Exact same behaviour is happening. This is what is being printed to the serial monitor:

                                    IP: 192.168.0.22
                                    0;255;3;0;9;Attempting MQTT connection...
                                    0;255;3;0;9;MQTT connected
                                    0;255;3;0;9;Sending message on topic: Gateway1-out/0/255/0/0/18
                                    0;255;3;0;9;Message arrived on topic: Gateway1-in/4/1/1/0/2
                                    0;255;3;0;9;!TSF:MSG:SEND,0-0-4-4,s=1,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=NACK:0
                                    IP: 192.168.0.22
                                    0;255;3;0;9;Attempting MQTT connection...
                                    0;255;3;0;9;MQTT connected
                                    0;255;3;0;9;Sending message on topic: Gateway1-out/0/255/0/0/18
                                    0;255;3;0;9;Message arrived on topic: Gateway1-in/4/1/1/0/2
                                    0;255;3;0;9;!TSF:MSG:SEND,0-0-4-4,s=1,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=NACK:0
                                    IP: 192.168.0.22
                                    0;255;3;0;9;Attempting MQTT connection...
                                    0;255;3;0;9;MQTT connected
                                    0;255;3;0;9;Sending message on topic: Gateway1-out/0/255/0/0/18
                                    0;255;3;0;9;Message arrived on topic: Gateway1-in/4/1/1/0/2
                                    0;255;3;0;9;!TSF:MSG:SEND,0-0-4-4,s=1,c=1,t=2,pt=0,l=1,sg=0,ft=0,st=NACK:0
                                    

                                    I'm not even certain that anything is wrong here. It just keeps reconnecting to the MQTT server, but it is actually working but i'm concerned about why its doing such inside of the serial monitor. I read somewhere that it does a 'touching base' case to keep it alive or something, but i also recall someone saying that was every 15 seconds or so, this is every 8 seconds (about). Do you happen to know what its sending to a MQTT topic 0/255/0/0/18 for, is this standard behaviour or just mine?

                                    MySensors 2.1.1
                                    Controller - OpenHAB (Virtual Machine)
                                    Gateway - Arduino Mega MQTT Gateway W5100

                                    1 Reply Last reply
                                    0
                                    • maghacM Offline
                                      maghacM Offline
                                      maghac
                                      wrote on last edited by
                                      #18

                                      Not sure if mine did that, I can check later.

                                      I'm using the latest Arduino IDE (1.8.1 or something like that)

                                      S 1 Reply Last reply
                                      0
                                      • maghacM maghac

                                        Not sure if mine did that, I can check later.

                                        I'm using the latest Arduino IDE (1.8.1 or something like that)

                                        S Offline
                                        S Offline
                                        Samuel235
                                        Hardware Contributor
                                        wrote on last edited by
                                        #19

                                        @maghac - The same as the one I've been using apart from the last test then. Thanks for confirming that.

                                        If you wouldn't mind checking a serial output on your later, that would be really appreciated.

                                        MySensors 2.1.1
                                        Controller - OpenHAB (Virtual Machine)
                                        Gateway - Arduino Mega MQTT Gateway W5100

                                        1 Reply Last reply
                                        0
                                        • maghacM Offline
                                          maghacM Offline
                                          maghac
                                          wrote on last edited by
                                          #20

                                          Type 18 is the heartbeat message type, I think this is the last element in your MQTT topic so it looks fine I think. Can you monitor the MQTT broker and see what messages are passing through it? (e.g if you can see something being sent by the sensors)

                                          S 2 Replies Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          6

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.0k

                                          Posts


                                          Copyright 2019 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
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular