emonPi hangs and stops logging

Next time it stops, rather than rebooting it, you should check the logs and try restarting some specific parts. You can still reboot if all else fails, but armed with what you have learnt we may be able to locate the issue. The fact “it stops” and the fact it “starts again after a reboot” are just to general to be useful.

emonhub.log is the most useful log, but due to the way log rotation is set up on an emonSD, you only have an hour or so before the useful info is rotated out. The most useful part of the log is the period before and just after the data stopped flowing.

Can you also check the emonhub, feedwriter and mqtt services are still running ok with the following 3 commands?

sudo systemctl status emonhub

sudo systemctl status feedwriter

sudo systemctl status mqtt_input

if any one of those is not running, try restarting it using the same command with “status” replaced with “restart”.

Try to avoid restarting them unless absolutely sure they are stopped, we are aiming to find one thing that get the ball rolling again.

If the 3 services are all running ok, try restarting just emonhub with sudo systemctl restart emonhub and if that works, it is possibly one of 2 things, the emonpi board is stopping and restarting emonhub is resetting the board or there are is a “thread is dead” issue in emonhub. The logs you collected earlier will help determine which, or we can install a little utility so that the next time it stops you can reset the emonpi board without restarting emonhub.