Forward to Influxdb from RPICT
We will introduce you to the forwarding tool for Influxdb 'lcl-gateway'.
- Influxdb is already installed and a database has been created.
- RPICT unit has been tested with the cat or lcl-run commands first.
- RPICT is using the default output format number 3.
Get the lcl-gateway tool and install it this way.
sudo dpkg -i lcl-gateway_2.1.0_armhf.deb
You can now edit the configuration file
sudo nano /etc/lcl-gateway.conf
The file looks like this
enabled = False
hostname = emoncms.org
apikey = --apikey-from-emoncms-goes-here--
node = 20
enabled = True
version = 1
measurement = rpict3t1
# Parameters for version 1 below
db = home
# Parameters for version 2 below
token = NbMVAzr35B0uZehxgd_lPgVpqjDGM2-r2UF15Qd3F4D0uv-VKtVsWslH4-7vVDH1r95A-imvdqPALt1m9bW6rA==
org = lcl
bucket = home
enabled = False
directory = /tmp/
There are 2 versions of Influxdb. you should indicate which version is used in the version parameter.
For version 1 you must indicate the db and url parameters.
For version 2 you must indicate the url (uncomment it by removing the leading #) and also token org and bucket. token is the API token that can be obtained from the Influxdb interface. org and bucket are set when you first setup the Influxdb database.
You can launch the gateway in the background using
sudo systemctl start lcl-gateway
If you prefer running the program by hand with some debugging to troubleshoot use the command below:
To make the gateway start automatically at boot time enter:
sudo systemctl enable lcl-gateway