This project uses some DS18S20 digital temperature sensors to get temperature data.
The data between the Arduino and RasPI flows like this:
- Arduino reads sensors every second, and displays temperature on the LCD.
- Python scripts sends out control sequence
c7to get data from Arduino. - Arduino sends it's custom ID, sensorPin, device, temperature each on a separate line.
| Type | Descirption |
|---|---|
| ID | Is a 4 digit code. For I2C interface can be between 1000-1127. |
| SensorPin | Is the pin where the OneWire reads data. Could be any of the digitalIOs. |
| Device | Number of the device on the OneWire interface. 0-127. |
| Temperature | Float value. Usually 2 decimal places. range could be -25 - +125. |
There's a cronjob running on the system, which pulls data from devices every 5 minutes. It could be set to almost any value.
The python script automatically reads data from Arduino, and should convert it to JSON-format. JSON is needed to pass data to InfluxDB by the influxdb-python module. Then Grafana reads its data from InfluxDB.
sudo systemctl daemon-reload
sudo systemctl start grafana-server
sudo systemctl status grafana-server- Binaries
/usr/sbin/grafana-server - Init.d
/etc/init.d/grafana-server - ENV vars
/etc/default/grafana-server - CONF
/etc/grafana/grafana.ini - Systemd
grafana-server.service - LOG
/var/log/grafana/grafana.db - DB
/var/lib/grafana/grafana.db - HTML/JS/CSS
/usr/share/grafana
Default port is 3000, default user admin and password admin.
Changed password to racktor.
InfluxDB is backed up by influxd backup -database racktor </somewhere>.
To restore,
- Stop InfluxDB,
systemctl stop influxdb.service - Untar backup,
tar xvf racktor_db.tar.gz - Import metadata,
influxd restore -metadir /var/lib/influxdb/meta . - Import data,
influxd restore -database racktor /var/lib/influxdb/data . - Start service,
ssystemctl start influxdb.service.