update readme

This commit is contained in:
Hristo
2022-11-21 01:09:31 +02:00
parent 4b6132bd41
commit 4b0d254d4e

View File

@@ -1,6 +1,6 @@
# Raspberry Pi MQTT monitor
Python script to check the cpu load, cpu temperature, free space, used memory, swap usage, uptime, wifi signal quality voltage and system clock speed
on a Raspberry Pi or any computer running Ubuntu and publish this data to a MQTT broker.
Gather system information and send it to MQTT server. Raspberry Pi MQTT monitor is written in python and gathers information about cpu load, cpu temperature, free space, used memory, swap usage, uptime, wifi signal quality, voltage and system clock speed. The script is written for Raspberry Pi but can also be used on Ubuntu based system.
I wrote this to monitor my raspberries at home with [home assistant](https://www.home-assistant.io/). The script works fine both on Python 2 and 3
and is if very light, it takes 3 seconds as there are 5 half second sleeps in the code - due to mqtt having problems if I shoot the messages with no delay, this is only if you choose to send the messages separately, now the script support a group CSV message that don't have this delay.
@@ -30,12 +30,23 @@ Disabled sensors are represented with False in the message.
# Installation
I have created an automated bash installation, its working but not extensively tested
## Automated Installation
I have created an automated bash installation, its working but not extensively tested (recently updated)
```bash
bash <(curl -s https://raw.githubusercontent.com/hjelev/rpi-mqtt-monitor/master/remote_install.sh)
```
The auto-installer needs:
* python (2 or 3)
* python-pip
* git
* paho-mqtt
Only python is not automatically installed, the rest of the dependancies should be handeled by the auto installation.
It will also help you configure the host and credentials for the mqtt server in config.py and create the cronjob configuration for you.
## Manual Installation
If you don't like the automated installation here are manuall installation instructions:
Install pip if you don't have it:
@@ -44,16 +55,16 @@ $ sudo apt install python-pip
```
Then install this module needed for the script:
```bash
$ pip install paho-mqtt
$ pip3 install paho-mqtt
```
Clone the repository:
```bash
$ git clone https://github.com/hjelev/rpi-mqtt-monitor.git
```
Copy ```/src/rpi-cpu2mqtt.py``` and ```/src/config.py.example``` to a folder of your choice (I am using ```/home/pi/scripts/``` ) and rename ```config.py.example``` to ```config.py```
Copy ```/src/rpi-cpu2mqtt.py``` and ```/src/config.py.example``` to a folder of your choice (automated installer will use the current folder) and rename ```config.py.example``` to ```config.py```
# Configuration
(only needed for manuall installation)
Populate the variables for MQTT host, user, password and main topic in ```config.py```.
You can also choose what messages are sent and what is the delay (sleep_time is only used for multiple messages) between them.