File: README.md

package info (click to toggle)
python-aranet4 2.5.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 232 kB
  • sloc: python: 1,845; makefile: 5
file content (31 lines) | stat: -rw-r--r-- 996 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# InfluxDB Examples
To try out theese examples, make sure influx db login info and db name is correct.

## influx.py
If you wish to store data on server, using InfuxDB, check `influx.py`

### Usage
Current readings: `python influx.py DEVICE_ADDRESS DEVICE_NAME`

History: `python influx.py DEVICE_ADDRESS DEVICE_NAME -h [-l <limit>]`

#### Automatic data collection

To automate data collection, using crontab will be easiest way:
1. Edit crontab: `crontab -e`

2. Add job. If running Aranet4 with 1 minute intervals, run script every minute:`* * * * * python /PATH_TO_THIS_REPO/influx.py XX:XX:XX:XX:XX:XX anrijsAR4`

3. Save and close crontab.

#### History upload
It is also possible to upload history to InfluxDB. In this case run command:
`python influx.py XX:XX:XX:XX:XX:XX anrijsAR4 -h`

To limit record count, add `-l <count>` parameter.

## import.py
This script imports history files generated by `aranet.py`

### Usage
Import file to InfluxDB: `python import.py FILE_NAME DEVICE_NAME`