Mosquitto V1.6.2 MQTT issues

Continuing the discussion from Feed from one input stops updating, others feeds continue to work:

There have now been 2 reports of MQTT issues that seem to stem from the use of version 1.6.2 of Mosquitto. It appears that this version is the new stable and distributed version. There are a number of issues on GitHub some of which sound similar so these are likely to be fixed in time but for now they appear to be a problem.

Whilst the solution for emoncms is to downgrade the mosquitto version, if a user is using an external Mosquitto broker, or one that is not local to emoncms, that may not be an option.

I am also concerned that the Mosquitto-PHP package seems to be a little unloved by it’s owner and does not support PHP7.3 AFAICS. However, I have so far not found anything else to link PHP / Mosquitto.

I think that we need to rethink the use of MQTT within emoncms.

Suggested way forward;

  • Revert to using the HTTP Interfacer from emonhub to emoncms. This is more robust, is within our control and I never really understood the advantage of using MQTT for passing the data.
  • Investigate a new method of publish/subscribe data via MQTT.

I wonder if the solution for pub/sub is to make the emoncms_mqtt service a python script rather than a PHP script.

One issue would be picking up settings, but I have suggested in the past moving to an ini file rather than a php file for settings. An ini file could be parsed by python as well.

Thanks for the heads up on this @borpin. We are making increasing use of MQTT for features such as the demandshaper and EmonEVSE keen not to throw it out, if this is bug in the new version hopefully it will get fixed soon and we need to figure out how to revert to a suitable version where this problem arises.

But is might be a bug with the Mosquitto-PHP interface and TBH that is more of an issue as it does not support PHP7.3 IMHO.