Periodically reads sensor readings from a Fody Tempus Pro weather station and posts them to an InfluxDB database.
apt-get install bluetooth bluez libbluetooth-dev libudev-dev
git clone https://github.com/alexryd/fody-tempus-pro-logger.git
.cd fody-tempus-pro-logger
.npm install -g
.sudo useradd --no-create-home --system fody
.sudo mkdir /var/fody
.Create the file /var/fody/config.json
and add the following content:
{
"influxdb": {
"database": "your InfluxDB database name",
"host": "your InfluxDB hostname",
"username": "your username",
"password": "your password"
},
"db": {
"path": "/var/fody/data.db"
}
}
sudo chmod 700 /var/fody
.sudo chown -R fody:fody /var/fody
.Create the file /etc/systemd/system/fody-tempus-pro-logger.service
and add
the following content:
[Unit]
Description=Fody Tempus Pro logger
After=syslog.target network-online.target
[Service]
Type=simple
User=fody
EnvironmentFile=/etc/default/fody-tempus-pro-logger
ExecStart=/opt/nodejs/bin/fody-tempus-pro-logger $FTPL_OPTS
Restart=on-failure
RestartSec=10
KillMode=process
[Install]
WantedBy=multi-user.target
/etc/default/fody-tempus-pro-logger
and add the following
content:
FTPL_OPTS=--config='/var/fody/config.json'
sudo systemctl daemon-reload
sudo systemctl enable fody-tempus-pro-logger
sudo systemctl start fody-tempus-pro-logger
systemctl status fody-tempus-pro-logger
and the logs by running
journalctl -u fody-tempus-pro-logger
.