Skip to content


Forward to Influxdb from RPICT

This is a basic example to forward RPICT data to an InfluxDB database. Note this only covers a skeleton to start building your own application.


The RPICT series board must output using format=3 (default) for this to work.

Document edited using influxdb version 1.2 and python-influxdb version 4.0.

We will assume here a setup having:

  • Server Side. The unit running the influxdb service and waiting for input data.
  • Raspbberypi Side. The unit connected to the RPICT and forwarding data to the server above.

We have covered the case where the Raspberrypi is both the Influxdb/Grafana server and also connected to the RPICT in this guide below. Install an InfluxDB Grafana stack on a Raspberrypi


Server side hosting InfluxDB

Install InfluxDB as recommended. This link provides compiled executables.

Github link is here.

We will call this server hostname myserver for our example below.

For our example we need to create a database within influxdb. From a terminal on the influxdb hosting server issue the command below:

$ curl -i -XPOSThttp://localhost:8086/query--data-urlencode "q=CREATE DATABASE db01"

Replace the db01 in the above with whatever you please.

Raspberrypi side

We are proposing a basic script template which can be installed as below.

sudo apt-get install python-requests wget unzip wget sudo mv /usr/local/bin/ sudo mv gateway.conf /etc/

Edit the gateway.conf file to reflect your own setting. Content will be self explanatory.

sudo nano /etc/gateway.conf

Insert the RPICT and run -d

Run the Gateway script in background

You might need to keep the previous gateway program running in the background.

Install Screen.

sudo apt-get install screen

Then run

screen -d -m

To stop it just run screen (provided you are only running one screen at a time).

screen -r

Press ctrl ^C to kill the program. Press Ctrl ^A then D to let it run and detach from the screen session.

Run the Gateway script at boot time

Edit the rc.local file.

sudo nano /etc/rc.local

Then just before the exit 0 line add the following line:

screen -d -m /usr/local/bin/

Once the Raspberrypi rebooted you can access the session using

sudo screen -r