# 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`
