Location location location

Could be my lucky day today…  not only does the Orange Pi PC work but I’ve been talking to a pal of mine Peter Oakes (check his videos) in Canada…   I know zilch about Linux apart from what seems like several thousand commands I’ve learned recently (probably a dozen) be necessity – however, I was getting a little concerned that the Orange Pi even with a tiny heat sink tends to get a little warm and I thought it might be nice to get that info – and be able to turn a fan on instead of the normal response when they get too hot which appears to be to shut down!!!

Anyway it turns out that this command…

cat /sys/devices/virtual/hwmon/hwmon1/temp1_input

returns the temperature as a decimal. We THINK a similar one for the Raspberry Pi is this.

cat /sys/devices/virtual/thermal/thermal_zone0/temp

Though in the latter case, it returns sometimes a 5 digit number which seems to include the decimals… not sure how to reduce that down to the same as the Orange Pi – maybe integer divide by 1000 ( or am I reading the wrong one)  - both of these react appropriately to an air canister.

ANYWAY in order to use that in Node-Red – and hence send an email or turn a fan on…is to use the EXEC node – so in the case of the Orange Pi…

temperature of Pi

Well isn’t that handy – press the button and out comes the temperature of the chip – it doesn’t take much imagination to replace the left with a timer – maybe once every 30 seconds – and the output with either an email or GPIO control for a fan.

So – Orange Pi and Raspberry Pi experts – where is there an idiots guide to all the other useful addresses to get info ??

Facebooktwittergoogle_pluspinterestlinkedin

4 thoughts on “Location location location

  1. Funnily enough I set this up on my Pi Zero at the weekend when I decided to put inside a small plastic case.

    The command is
    /opt/vc/bin/vcgencmd measure_temp

    This returns something like:
    Temp=37.1'C

    So now in Node Red I have an Exec node that runs the above command which is triggered by an Inject node every minute. It outputs to a Function node which extracts the 37.1 bit from the string, and then feeds it to a Node Red UI node that puts the CPU temp on my dashboard along with all my other temperatures.

    1. Thanks David - that does work on the Raspberry Pi and looks nicer than the figure I got out (same data).... doesn't work on the Orange Pi so for now doomed to using 2 different commands.. however - better tan nothing... I'm going to try the other solution in here to drop the temperature of the orange Pi... it really is too hot - 60c I could handle.... but it is nearly 80c - fine here but in Spain in the summer it might just go over the edge.

Leave a Reply

Your email address will not be published. Required fields are marked *