From be2113321535f423b5ec1db03bd9c390a033c1e4 Mon Sep 17 00:00:00 2001 From: Hristo Jelev Date: Mon, 27 Apr 2020 19:21:27 +0300 Subject: [PATCH] added sys clock speed and updated readme --- README.md | 5 ++++- cpu_mqtt.py | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 33aa399..72ffa70 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ # Rapsberry Pi MQTT monitor -Python 2 script to check cpu load, cpu temperature and free space, +Python 2 script to check cpu load, cpu temperature, free space, voltage and system clock speed on a Raspberry Pi computer and publish the data to a MQTT server. +I wrote this so I can monitor my raspberries at home with home assistant. The script is writen for python 2 +as when I wrote it one of the used python modules was not available for python 3. (if the modules are available for python 3 now the script shuold have no problems running on python 3 - plan to check that in the near feature) + # Installation: Install these two modules needed for the script diff --git a/cpu_mqtt.py b/cpu_mqtt.py index 9072599..3cca7fb 100644 --- a/cpu_mqtt.py +++ b/cpu_mqtt.py @@ -60,6 +60,7 @@ def publish_to_mqtt (cpu_load, cpu_temp, used_space, voltage, sys_clock_speed): time.sleep(1) client.publish(mqtt_topic_prefix+"/"+hostname+"/voltage", voltage, qos=1) time.sleep(1) + client.publish(mqtt_topic_prefix+"/"+hostname+"/sys_clock_speed", sys_clock_speed, qos=1) #disconect from mqtt server client.disconnect()