emonPi stopped logging when internet went down

I have a Emon Pi, working together with several dallas sensors and two emonTH stations.

When we left for holiday this summer, my girlfriend unplugged the internet router. However she did not unplug any other equipment that i have up and running.

This renders the EmonPi with no internet connection on the ethernet cable.

However, i have it set up so that it should log locally.

All the data from the holiday period is missing, but the EmonPi had power and was running all the time.

Even when i do get the router back up and running, there is no logging from the Pi.

After doing a hard reboot on the pi, it started logging again.

Is this a known issue? That the EmonPi stops logging when the ethernet is missing for a period? Or was this just a temporary hickup?

I am very interested to know, and i think that otherwise this should be looked into.

Maybe i have just configured the pi the wrong way, but all the data from before the holiday is there, and also after the holiday.

The Pi is also submitting the data to emoncms.org, with my user ID and API key.


The emonPi should keep logging even if the internet goes down.

Can you replicate this issue by unplugging the Ethernet cable for a few hours to test?

Hi Glyn!

I now came back to the unit, and logged in today from my local network.

Seems the same thing happened again.

For some reason, it will stop logging. And will not go on again until i make a hard reboot.

The unit is just base install, and sits with power all the time in my utility room. Uptil now i have had the unit for some years running with no problems what so ever. This problem started when i decided to swap the SD and put the newest version of EMONCMS on it.

Maybe there is a firmware or something on the board that crashes together with the new emonscms. But still the problem is very random it seems.

It responds, and i can log in with the IP that i have given the unit in the network, all sensors are connected but still its not logging.

Maybe it is something with the emonpi board?

The TH sensors are not connected either. I will look more into that.

I attached two images for you to see.


After another reeboot its now back up an logging.

Did nothing else then a hard reboot by holding the powerbutton, waiting for pi to stop, unplugging USB power and then starting up again.


Could this be related to the threads crashing as my Pi has crashed even after the code was updated to fix the crashing.


Would it be possible to post your emonhub.log file? Are you referring to local Emoncms logging rather than emoncms.org?

Yes, this is the local emoncms.

The emoncms.org would have been lost anyway since the internet connection went down. Funny thing was that local logging stopped also.

And yestorday i noticed it stopped again, but this time with the internet still active.

I dont know why it stops, because the unit is running as described.

If you describe how i can post the log, i can give it a try.


Are you running the latest version of EmonCMS?
You can update it by clicking Setup > Administration > EmonPi Update


Whn looking at the emoncms.org it seems data is there, but not on the local server (as shown previously) this is very strange. For some reason it is uploading data to the web, but not storing the same data on the device. Maybe something has happened with the configuration.

Now this has happened again.

My local EMONCMS server does not register data for last 5 days, but logging in to emoncms.org shows the data in my emoncms account.

However one of the units is not logging at all. Maybe the battery is bad, but still that does not explain why the local emoncms server keeps dropping out.

Does anyone have clues on this?


(se attached images, these are screen shots from right now)


These are the last entrys in the log file:

2017-10-26 23:13:20.993|WARN|phpmqtt_input.php|Disconnected cleanly
2017-10-26 23:13:24.323|WARN|phpmqtt_input.php|Subscribing to: emon/#
2017-10-26 23:13:25.889|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-10-26 23:13:26.966|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2017-10-26 23:13:28.076|WARN|phpmqtt_input.php|Subscribed to topic: emon/#
2017-10-26 23:13:50.722|WARN|phpmqtt_input.php|Disconnected cleanly
2017-10-26 23:13:51.465|WARN|phpmqtt_input.php|Subscribing to: emon/#
2017-10-26 23:13:52.025|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-10-26 23:13:52.047|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2017-10-26 23:13:52.050|WARN|phpmqtt_input.php|Subscribed to topic: emon/#
2017-10-26 23:14:16.112|WARN|phpmqtt_input.php|Disconnected cleanly
2017-10-26 23:14:19.440|WARN|phpmqtt_input.php|Subscribing to: emon/#
2017-10-26 23:14:23.379|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-10-26 23:14:25.245|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2017-10-26 23:14:26.201|WARN|phpmqtt_input.php|Subscribed to topic: emon/#
2017-10-26 23:14:56.140|WARN|phpmqtt_input.php|Disconnected cleanly
2017-10-26 23:14:57.181|WARN|phpmqtt_input.php|Subscribing to: emon/#
2017-10-26 23:14:57.450|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-10-26 23:14:57.535|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2017-10-26 23:14:57.537|WARN|phpmqtt_input.php|Subscribed to topic: emon/#
2017-10-28 23:25:15.420|WARN|phpmqtt_input.php|Starting MQTT Input script
2017-10-28 23:25:17.796|WARN|phpmqtt_input.php|Subscribing to: emon/#
2017-10-28 23:25:17.811|WARN|phpmqtt_input.php|Not connected, retrying connection
2017-10-28 23:25:17.813|WARN|phpmqtt_input.php|Connecting to MQTT server: Connection Accepted.: code: 0
2017-10-28 23:25:17.814|WARN|phpmqtt_input.php|Subscribed to topic: emon/#

This is screenshot from log file/server information.


I keep getting this too. Did you figure this out @goodfidelity ?

Hello Matt, are you running latest emonhub and emoncms on your emonpi? The improved threading implementation in emonhub may have fixed this.

Yeh, I thought there may be fixes already. I’ve just done a big update of my emonpi for all things emoncms and emonhub related. So let’s see if I get it again! Had it a few times in the past year. It’s not very frequent. I always fail to notice it because my data also goes to a server I have on the public internet which is where I usually read from and the data makes it there.

I scoured the logs from the time it went off this time and nothing stood out.

I’ll let you know if I see this again! Thanks!!