- install influxdb2
sudo apt install influxdb2- Restore backup to
/var/lib/influxdb/.influxdbv2if there is. - Important to not start with
influxdwith root or other user, that will create a new.influxdbv2dir in home directory sudo service influxdb startsudo systemctl enable influxdbsudo systemctl status influxdb
- Create a new bucket
batteriesin influxdb - install telegraf
- configure telegraf
sudo sucd /etc/telegraf/telegraf.d/touch my_config_telegraf.confnano my_config_telegraf.conf
telegraf config -input-filter mqtt_consumer -output-filter influxdb_v2 > telegraf.conf
cat telegraf.conf
- Open 2 terminal windows
- terminal #1
- run
python3 serial/read_bms.py
- run
- terminal #2
- run
watch python3 serial/query_bms.py
- run
cp ble/jkbms_config.conf.example jkbms_config.conf- Set the value as your need in
jkbms_config.conf - Crontab settings
sudo nano /etc/crontab* * * * * root /bin/bash -c /PATH_TO_THIS_DIR/ble/read_jkbms.sh >> /var/log/read_jkbms.log
cp easun/easun_config.conf.example easun_config.conf- TODO ignore the input path
- Set the value as your need in
easun_config.conf - Crontab settings
sudo nano /etc/crontab`* * * * * root /bin/bash -c "/PATH_TO_THIS_DIR/read_inverter.sh ttyUSB0" >> /var/log/read_inverter_usb0.log