ruuviscanner

command module
v0.0.0-...-ba2d486 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 17 Imported by: 0

README

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

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL