Flow to get CPU die temperature from EPIC PR1

Here’s a quick little flow that uses a shell command to grab the temperature directly from a groov EPIC-PR1 processor. Note that you do not need shell access for this to work, the command does not require root access so Node-RED can execute it without any special permissions!


Also note that the number comes back as a string in milli-Celsius units – but the “convert” function block takes care of that by parsing the string to be a float and dividing by 1,000 to change the output to be decimal value in standard °C. This way you can easily graph it or display it in a gadget.

Here’s the text to import the flow and try it for yourself:

[{"id":"1d8921e9.b5dd4e","type":"inject","z":"e02f10b4.235de","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":180,"y":1220,"wires":[["ca904b32.a11178"]]},{"id":"ca904b32.a11178","type":"exec","z":"e02f10b4.235de","command":"cat /sys/devices/virtual/thermal/thermal_zone0/temp","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"get temp","x":340,"y":1220,"wires":[["455f6901.a1b438"],[],[]]},{"id":"455f6901.a1b438","type":"function","z":"e02f10b4.235de","name":"convert","func":"// Value returned is a string in milli-Celsius,\n// so convert string->float, and divide by 1,000 to get standard degrees C:\nreturn { payload : parseFloat(msg.payload)/1000 }","outputs":1,"noerr":0,"x":500,"y":1220,"wires":[["a02ca7a2.ccfb98"]]},{"id":"a02ca7a2.ccfb98","type":"debug","z":"e02f10b4.235de","name":"temp (deg C)","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":670,"y":1220,"wires":[]}]


Happy coding!

Awsome! Thanks @torchard

Note that this is not air temperature, but actual CPU chip (die) temperature, so it will go up and down with the CPU load.

Just to be clear what temperature this getting, its this one from groov Manage;

1 Like