Write data to InfluxDB via Python

Once you’ve set up Grafana and InfluxDB, the next step is to push data to InfluxDB.


Download and setup Python script

  1. Download the CANedge InfluxDB Writer project from github
  2. Follow the README to install and test the script with the sample data
  3. Once you are done with Step 1 in the README, you should see the below in Grafana:
Sample data dashboard

Modify the script to process your own data

  1. Change the script to use your own DBC file, devices and data as per the README
  2. Verify that your own data is processed correctly for the time period you’ve selected[1]

Note

The free tier InfluxDB cloud has a limit of 199 unique signals per device - make sure to modify your DBC file accordingly or add a filtered list of signals in your inputs.py file

Next, build and deploy your Grafana dashboard


[1]The free InfluxDB Cloud has a write cap of ~1 MB/min - if you push large amounts of data the script will stall. You can avoid this by reducing your data (e.g. via resampling), upgrading to a paid InfluxDB Cloud account or setting up a free self-hosted version as per our guide