Skip to content

Latest commit

 

History

History
80 lines (55 loc) · 1.9 KB

README.md

File metadata and controls

80 lines (55 loc) · 1.9 KB

ruuviscanner

ruuviscanner is an application listening for RuuviTag broadcasts and converting them to measurements suitable for storing in InfluxDB or publishing to an MQTT topic for Home Assistant integration.

The code is inspired by https://github.com/Scrin/RuuviCollector, but I needed a more lightweight application that can run on a RaspberryPi Zero W.

How to use?

  1. Begin with setting up the backend, consisting of influxdb for storing observations and grafana for showing observations.
docker-compose up -d
./create-database.sh
  1. Install dependencies. Note: the scanner only works on Linux.
apt install bluez-hcidump
  1. Build and run the scanner
go build && ./ruuviscanner
  1. Open http://localhost:3000/ruuvi/ in your browser to view the collected observations.

Install the scanner on a RaspberryPi Zero W

  1. Enable remote access accoding to https://www.raspberrypi.org/documentation/remote-access/ssh/

  2. Cross-compile for Linux ARM

GOOS=linux GOARCH=arm GOARM=6 CGO_ENABLED=0 go build -o ruuviscanner.linux-arm32
  1. Copy the binary to your pi
scp ruuviscanner.linux-arm32 pi@<your-pis-ip>:/usr/local/bin/ruuviscanner
  1. Install the dependencies on your Pi
apt install bluez-hcidump
  1. Create a systemd unit file to automatically start up at boot
cat << EOF > /etc/systemd/system/ruuviscanner.service
[Unit]
Description=RuuviScanner
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/root
ExecStart=/usr/local/bin/ruuviscanner -influx-addr http://<your-ip-to-the-influx-backend>:8086
Restart=always

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable ruuviscanner.service
systemctl start ruuviscanner.service

Links