MQTT not working after restore to latest image (Solved)

Hi

I have just switched to this image.
Export from the old version and import into new all went without hitch.
Every thing running with the exception of MQTT. My MQTT server is on a different pi.
Has something changed that might need me to update settings.cfg?
I assume the old settings came across from the old image.

Ian

Check the ‘settings.php’ file for the MQTT entry. All works here in this way for me but there have been some changes to the MQTT setup.

Is the mqtt_input service running?

Can you paste the system information please (click on the ‘copy to clipboard’ button on the admin screen and paste here with no additional formatting).

Thanks Brian

administration shows mqtt host:-

Host localhost:1883 (127.0.0.1)

Should be:-

Host 192.168.1.28:2082 (192.168.1.28).

I had not realised settings.php was not exported and imported.
Problem fixed.

There is one item in administration I noticed:-

service-runner Inactive Dead

Does that matter?

Ian

I thought it was.

Depends if you are sending MQTT as well. yes as the update button uses it as do a few other modules.

Can you show output of sudo systemctl status service-runner.service please.

[edit] Is Redis enabled?

Just an aside, redis not started doesn’t stop service-runner from running and it shouldn’t cause it to die, although it will definitely stop it from actually doing anything :wink:

Hi @ian, notice you marked it as solved. It is always useful to know how you solved it - may help others. :smile:

Hi Brian.

Today it is running! The only difference I can think of is that I have rebooted between the report of inactive service runner and today.

● service-runner.service - Emoncms service-runner Input Script
   Loaded: loaded (/var/www/emoncms/scripts/services/service-runner/service-runn
   Active: active (running) since Tue 2019-01-22 17:52:03 UTC; 15h ago
 Main PID: 755 (python)
   CGroup: /system.slice/service-runner.service
           └─755 /usr/bin/python /var/www/emoncms/scripts/services/service-runne

Jan 22 17:52:03 emonpi systemd[1]: Started Emoncms service-runner Input Script.
Jan 22 17:52:09 emonpi service-runner[755]: Starting service-runner
Jan 22 17:52:09 emonpi service-runner[755]: Unable to connect to redis-server, s
Jan 22 17:52:46 emonpi service-runner[755]: Connected to redis-server
lines 1-11/11 (END)...skipping...
● service-runner.service - Emoncms service-runner Input Script
   Loaded: loaded (/var/www/emoncms/scripts/services/service-runner/service-runner.service; enable
   Active: active (running) since Tue 2019-01-22 17:52:03 UTC; 15h ago
 Main PID: 755 (python)
   CGroup: /system.slice/service-runner.service
           └─755 /usr/bin/python /var/www/emoncms/scripts/services/service-runner/service-runner.p

Jan 22 17:52:03 emonpi systemd[1]: Started Emoncms service-runner Input Script.
Jan 22 17:52:09 emonpi service-runner[755]: Starting service-runner
Jan 22 17:52:09 emonpi service-runner[755]: Unable to connect to redis-server, sleeping for 30s
Jan 22 17:52:46 emonpi service-runner[755]: Connected to redis-server
~
1 Like

I solved the problem by editing settings.php and changing the MQTT credentials.

I think as users are using backup and import to switch images the original settings.php should be included in the backup. Maybe renamed so they don’t override settings in the new image but a note in the manual import instructions that the original settings.php now named ???.php should be compared with current settings.php and any necessary changes made.

Ian

It should be included in the backup. There is an import log I believe. Could you have a look for it and see if that can shed any light on it for others?

I can’t locate anything like an import log. Any idea where it should be?

I have just checked the code and there is not a backup log. I also note that, even though the settings file is backed up, it is not restored. You may well find it in the /import folder where the backed up file went.