Had something similar happen to me because the Pi was running out of disk space.
Something in the EmonCMS UI was triggering the web server to write a lot of errors to its log file which would then automatically get cleaned up destroying the evidence of filling up the disk with error logs.
Maybe check it with “df” and make sure you have plenty of space.
Otherwise might need to change some linux logging settings which is what I did to get it to stop logging errors to disk.
Wish I could remember what it was that was causing all those errors. Maybe some kind of graph object or dashboard object that was referencing a feed that I had deleted or renamed or something like that. I remember having a lot of errors about something like that a while ago.
Mine is just plugged into a USB Socket as part of a 13A wall socket It’s rock solid.
Just your luck I think.
This has been a problem in the past, but larger cards mean it is rarely an issue. You can check the available space from the Admin page (which is just a df call IIRC).
On logs, again, a load of work was done to make sure these rotate correctly and saved from the RAMLOG to disk. However, that looks as if it might be broken now.
That is odd. @TrystanLea - this probably needs investigating as it should not be the case…
I fully agree. My Red Pitayas (which I run as software defined radios) have similar problems with flaky 5V PSUs. When the FPGAs are running full tilt, any weak 5v PSU fails pretty quickly (i.e. within a few minutes). To reduce the SMPS induced rfi for my radios, I am switching to Bel Power HB5-3/OVP-AG linear 5V/3A supplies for the Red Pitayas. That might be overkill for the emonpi though
I will secure another good quality RPi PSU in case it’s the PSU. The emonpi has been running for 8 days since the last crash…ad seems OK at the moment.
Have a look at this thread - it describes a similar situation.
I implemented the reset script and set it to trigger once a day from crontab. The problem seems to have gone.
What would happen if you disable the swap file on a 512MB RAM device? I heard/read that the swap file could reduce the SD lifetime. I use a genuine Sandisk Extreme with A2 rating for app performance.
Interesting re full swap, not something I’ve seen before.
Thanks for the htop @fluppie007 looks like something is going wrong there with mysql , don’t think there should be so many processes, perhaps just processes piling up due to laggy disk access caused by the swap issue?
pi@emonrpiz2w:~ $ ps aux | grep mysql
mysql 599 0.1 13.9 725048 61052 ? Ssl Aug01 2:09 /usr/sbin/mysqld
pi 24745 0.0 0.1 7344 580 pts/0 S+ 12:56 0:00 grep --color=auto mysql
pi@emonrpiz2w:~ $
I do have three RPi4’s with HomeAssistant sending some energy information every 5 minutes to emonCMS with the Emoncms History - Home Assistant integration.
But the RPi Z2W does not have anything else than emonCMS running.
On the original question I raised…my emonPi has been running without any issue for a month now. Still using the same PSU, and things like swap space look OK. Still mystified as to what causes the intermittent hangs