MQTT continually reconnecting using emonSD-30OCT18

While dealing with an MQTT issue having just upgraded to the emonSD-30OCT18 image I noticed the following in the log. I do not recall this happening on my old setup. Is this normal?

2019-01-23 09:46:09.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:46:15.931|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:46:15.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:46:21.931|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:46:21.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:46:27.931|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:46:27.935|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:46:33.930|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:46:33.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:46:39.931|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:46:39.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:46:45.931|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:46:45.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:46:51.931|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:46:51.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:46:57.930|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:46:57.933|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:47:03.931|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:47:03.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:47:09.931|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:47:09.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:47:15.930|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:47:15.934|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0<br />
2019-01-23 09:47:21.930|WARN|phpmqtt_input.php|Not connected, retrying connection<br />
2019-01-23 09:47:21.933|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0</details><br />```

Ian

Do you use the MQTT broker on the Emoncms image?

If not, do you have more than one instance of EmonCMS connecting to the same MQTT broker?

Thanks again Brian.

Broker is on a different PI running mosquitto and NodeRed.

I had left the old version of emoncms running. Shut that down and connection is now solid.
So much to learn about all this stuff!

Ian

I had exactly the same issue. It happened because both emoncms instances were connecting to publish with the same clientID and the MQTT broker did not know which one was which. The ClientID is hardcoded. This PR will go some way to fix it but the setting would still need to be changed for the different instances.

Cheers.