MQTT Disconnected Using Node-RED program

Hi,

I am using a node-red program on my gateway to connect to sensors in order to read data and report it to Losant dashboard, on the program I am using MQTT Node as shown in the picture, after I powered off and then On my gateway the MQTT node start changing from connected to disconnected every time I am trying to send data to Losant.

can someone please help figure it out.

Thank you !

Hi @CHAIMAA_DRIOUECH,

In your screenshot, it looks like you’re reporting to losant/undefined/state.

Since that is an invalid topic, that’s why you’re seeing the disconnection happened.

You’ll want to update your workflow to report to losant/<device id>/state.

Let me know if you have any questions!