LAN connected MQTT nodes

  • I try to rebuild my custom Arduino nodes with MySensors platform. Need some input as I can not recreate all functions I need.

    I have 3 Arduino/ethernet boxes. By removing radio definitions I can make them act as individual gateways with their own root MQTT topic. In essence, they will have 6 digital inputs and 8 outputs/relays (will see how many pins are free at the end).

    1. I selected different MQTT topics for each gateway as they all have NODE_ID 0 (hardcoded by MySensors). How to control/differentiate if all 3 post to the same topic? By sensor ID?

    2. There is no support for MQTT Last Will in MySensors from what I searched... that is a pity. I will probably invent phantom sensor as a heartbeat that will contain a random value, then inspect that on a higher level (NodeRED most likely)

    3. Is there a way to know the MQTT status from inside the node? For example, if my node/gateway loose Ethernet or the MQTT broker is down I want to set relays to a safe state.

    4. Is there a watchdog implemented in the Arduino code by default? I know that Arduino can reset itself if stuck for longer then 8 secs (not getting confirmation message).