Mosquitto not starting after emonSD update & upgrade

Just try running it on the command line.

sudo mosquitto

If it complains about not being able to write to /var/log/mosquitto/... then it is the same issue I had, and the fix is in the thread I posted.

Hi Nick,

Sorry to hear your having trouble. Are you running the stock emonSD-08May16 sd card? I’ve not experienced this issue, I’m running mosquitto version 1.4.9. Could you check what version your running?

$ mosquitto -h

I am running the stock SD card (that I just received in the mail). I have mosquitto version 1.4.10:

pi@emonpi:~ $ sudo mosquitto
1474676184: mosquitto version 1.4.10 (build date Thu, 25 Aug 2016 10:12:09 +0100) starting
1474676184: Using default config.
1474676184: Opening ipv4 listen socket on port 1883.
1474676184: Opening ipv6 listen socket on port 1883.
1474676184: New connection from 127.0.0.1 on port 1883.
1474676184: New client connected from 127.0.0.1 as paho/828FDA3EF4EC95567D (c1, k60, u’emonpi’).
1474676185: Socket error on client paho/828FDA3EF4EC95567D, disconnecting.
1474676185: New connection from 127.0.0.1 on port 1883.
1474676185: New client connected from 127.0.0.1 as paho/828FDA3EF4EC95567D (c1, k60, u’emonpi’).
1474676185: New connection from 127.0.0.1 on port 1883.
1474676185: New client connected from 127.0.0.1 as openhab.1474676185586 (c1, k60, u’emonpi’).
1474676187: New connection from ::1 on port 1883.
1474676187: New client connected from ::1 as mosq/Jq=j?h77ej=UO>9:_s (c1, k5, u’emonpi’).
1474676191: Socket error on client mosq/Jq=j?h77ej=UO>9:_s, disconnecting.
1474676192: New connection from ::1 on port 1883.
1474676192: New client connected from ::1 as mosq/`02FPtT\2DnaWvp]m] (c1, k5, u’emonpi’).
1474676194: New connection from 127.0.0.1 on port 1883.
1474676194: New client connected from 127.0.0.1 as mqtt_f54f1159.0ab0f (c1, k15, u’emonpi’).

It just seems to hang after giving the above output. Sorry I’m unfamiliar with mosquitto. Perhaps I should revert to version 1.4.9?

I tried:
pi@emonpi:~ $ sudo apt-get install mosquitto=1.4.9
W: Not using locking for read only lock file /var/lib/dpkg/lock
E: Unable to write to /var/cache/apt/
E: The package lists or status file could not be parsed or opened.

Hooray! I flashed another SD card with the latest image, and then DID NOT UPDATE: getting numbers in emoncms now!

So perhaps an issue with mosquitto 1.4.10?

However… the numbers are not refreshing in emoncms. The RFM69Pi V3 led is not flashing every 10 seconds, though it did in the past (when I was getting n/a’s in emoncms). Should I try updating?

It seems (from minicom) that any signals are being discarded except the very first signal received after a reboot.

Yeah, I think that 1.4.10 is a bit more picky about the creating the log files. I will create a PR for the changes that fixed this issue.

1 Like

Could you post the Minicom output?

Its fine to run emonpi update (be emoncms admin web interface) but hold off running any system upgrades until your up and running so we can limit the number of variables.

I will try and investigate mosquitto 1.4.10 next week

Hi Glyn, sorry I didn’t post it sooner, but I’m fully operational now.

I believe that the issue was interference from my wireless router: the emonbase was plugged into the router with ethernet so the two were very close to eachother (and the emonTx was only ~4m and one wall away).

So I unplugged the emonbase (have RPi3 so using wireless now) and put it much closer to the emonTx, and further from the wireless router.

Thanks for all your help. I hope to contribute to development in the future (I’m handy with python) and if you’re ever climbing in Colorado look me up!

Nick

Hi Nick,

Your post doesn’t quite make sense as emonhub is software.
Perhaps you have it confused with something else?

Sorry, I meant emonBase

I think @nicklaws means emonBase (raspi + rfm69pi) when he says emonhub? Is this correct?

Good to hear you’re up and running :slight_smile:

I will report mosquitto logfile investigation. @jeremypoulter did you hint that you’ve got a fix for this? What was the issue?

We should split this topic into a new one to continue discussion.

Not a problem. I fixed it for you.

Have a look at MQTT Log files:

This issue has now been fixed:

Having the same issue after apt-get update & upgrade. I have also run the emonPi update and reboot but the mosquitto folder and log files have not been created.

I can only get the MQTT Server started via command prompt, ie. mosquitto &
It then works as normal.

TIA

Managed to fix it …
I found that rc.local_jessieminimal was not updated via emonPi update.
All OK after manually updating that file.

So what remains to see is why rc.local_jessieminimal was not updated via emonPi update.

Cheers.

1 Like

Well done fixing. That’s for reporting. rc.local_jessieminimal has updated fine on all systems I’ve tested based on emonSD-03May16. What version emonSD are you running? Could you post a copy of ~/data/emonpiupdate.log, you should be able download the log via the Emoncms admin interface

You should be able to see looking at the Emocncms admin page or you can run

$ sudo ls /boot | grep emonSD

Hi Glyn.

I’m running emonSD-03May16. Attached emonpiupdate.log as requested.emonpiupdate.zip (1.2 KB)

Hope it helps.

Best Regards.

All looks fine from the log, can you check to see if the symlink is in place:

ls /etc/fstab -la

should return

lrwxrwxrwx 1 root root 21 Apr 28  2016 /etc/fstab -> /home/pi/emonpi/fstab

Nope…those files are not linked.