MQTT Client Gateway / Node Controller / OTA



  • 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!



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



  • not really.

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

    Maybe using it for JUST the ota stuff and inventory.



  • @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 :) )



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


  • Hardware Contributor

    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.....



  • 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 :)


  • Hardware Contributor

    @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.


  • Mod

    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?


  • Hardware Contributor

    @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.



  • @Samuel235 What are your results?


  • Hardware Contributor

    @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?



  • 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.


  • Hardware Contributor

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



  • 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?


  • Hardware Contributor

    @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?


  • Hardware Contributor

    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?



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

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


  • Hardware Contributor

    @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.



  • 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)


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.