RPi Stats Log and auto shut down

RPi Zero WH

I have a number of Raspberry Pi’s for different things. Some of those are quite heavy on the hardware usage, and although these are great little devices they do have their limits.

I am am by no means the best programmer, but this is a simple code I wrote to run a quick diagnostics on my Pi and print out the results into a file. Fairly simple. I have also got a temp limit in there to auto-shutdown prior to the overheat detection from the Pi. Although this might be a bit much, the log at least will tell me that it has shut down because of a temperature problem.

Here is an example of a log entry:

03/03/20
15:45:02

CORE TEMP
37.9’C

–$–$–$–$–$–
VOLTS
volt=1.3500V

–$–$–$–$–$–

CLOCK SPEED
frequency(45)=1000000000

–$–$–$–$–$–
ARM MEMORY
arm=448M

–$–$–$–$–$–
GPU MEMORY
gpu=64M
–$–$–$–$–$–

temp=37.9’C

No issue to report


You can find the script and instructions at:

https://github.com/bm8681/RPi_statslog

I expect someone could do a better job, but I am quite happy that this works. This is the first bit of code that I have published on github so thought I’d write a short about it.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s