This project uses JEDI One’s custom data collector plug-in to measure and monitor a Raspberry Pi’s CPU temperature. The plug-in runs in the background and executes custom user code to pass data to the JEDI One. Any type of code supported by the hardware can be used. Below data dashboard shows the example project of CPU temperature being monitored.
Not implemented in this project but in addition to monitoring, SMS and email alerts can easily be configured to provide warning messages when temperature exceeds a specified threshold.
Raspberry Pi (note: a Pi 4 is used in this project but any Raspberry Pi could be used)
This project assumes Machinechat’s JEDI One IoT platform software has been installed and activated on the Raspberry Pi hardware. Machinechat’s article, Writing plug-ins to send data to JEDI One, is a good reference and provides instructions for writing the custom code and configuring the collector plug-in. The custom code needs to be executable and saved in the “plugins” subdirectory where the JEDI One software is installed.
Python is used to implement the custom data collector code for this project. A Raspberry Pi 4’s CPU temperature will be monitored by executing the vcgencmd command within a Python script to query CPU temperature. Customized print statements in the Python pass information to JEDI One.
#!/usr/bin/python3 import os import time def temp_of_rpi(): cpu_temp = os.popen("vcgencmd measure_temp").readline() return (cpu_temp.replace("temp=","")) #unique name for JEDI One data collector devID = "RPiCPUtemp" cpu_ftemp = float(temp_of_rpi()[0:-3]) #print out id and data in JEDI One custom data collector plug-in format print("metric:id=%s,n=Temperature,vd=%0.1f,u=C" % (devID, cpu_ftemp))
Make data collector code executable and copy to JEDI One plugins subdirectory
Add and configure JEDI One custom data collector plug-in: