Satellite: Raspberry Pi
Deploy a Raspberry Pi as an Otavi satellite node for continuous bird audio capture.
Platform: Raspberry Pi — a dedicated, always-on Node.js agent that captures audio via ALSA and uploads to the hub over WSS.
Hardware Requirements
| Component | Recommended | Notes |
|---|---|---|
| Raspberry Pi | Pi 4 or Pi 5 (2GB+ RAM) | Pi 3B+ works but inference is slower |
| Microphone | USB condenser mic | e.g. Fifine K669, Blue Snowball, Rode NT-USB Mini. I2S MEMS like Adafruit SPH0645 also works |
| MicroSD card | 32GB+ (Class 10 / A1) | Larger = more offline buffer |
| Power supply | Official Pi PSU (5V/3A) | For field deployment: 5V battery bank + solar panel |
| Network | Wi-Fi, Ethernet, or 4G dongle | Any internet connection works |
| Case | Weatherproof enclosure (IP65+) | For outdoor deployment |
| GPS (optional) | u-blox NEO-6M / Adafruit Ultimate / BN-880 | Static coordinates work too, see GPS Setup |
Microphone Selection
BirdNET works best with mics that have:
- 48 kHz sample rate support (required)
- Mono recording (BirdNET ignores stereo)
- Low noise floor (condenser mics beat dynamic for this)
- Omnidirectional pickup pattern (captures birds from all directions)
Budget option: any USB mic that supports 48 kHz mono. Professional option: a Primo EM272 capsule with a USB audio interface.
Operating System
Recommended: Raspberry Pi OS Lite (64-bit) — the official headless distribution with minimal footprint. Flash it using Raspberry Pi Imager.
Any Debian-based distribution works, including:
- Raspberry Pi OS Lite (recommended) — official, best hardware support
- Ubuntu Server for Pi — if you prefer Ubuntu's ecosystem
- DietPi — ultra-lightweight, good for constrained setups
Requirements: ALSA audio support, apt package manager, systemd for service management.
Tip: When flashing with Raspberry Pi Imager, enable SSH and configure Wi-Fi in the advanced settings to avoid needing a monitor and keyboard for initial setup.
Software Setup
1. Install prerequisites
# Update system
sudo apt update && sudo apt upgrade -y
# Install tools
sudo apt install -y git curl jq alsa-utils vim
# Install Node.js 24 LTS
curl -fsSL https://deb.nodesource.com/setup_24.x | sudo bash -
sudo apt install -y nodejs
# Install pnpm, at the version the repository's package.json names (packageManager)
sudo npm install -g pnpm@9.15.4
# Verify versions
node --version # v24.x
pnpm --version # 9.15.4
git --version
2. Test audio capture
arecord -l # List audio devices — find your microphone
This will output something like:
card 0: Headphones [bcm2835 Headphones], device 0: ...
card 1: Microphone [USB Microphone], device 0: ...
The ALSA device name is plughw:<card>,<device> — so card 1, device 0 becomes plughw:1,0. Test it:
arecord -D plughw:1,0 -f S16_LE -r 48000 -c 1 -d 3 test.wav
aplay test.wav # Verify recording works
Note: The built-in
bcm2835(card 0) is output only. USB microphones are typically card 1 or higher. Use the card number shown byarecord -lfor your microphone.
3. Find your GPS coordinates
GPS coordinates are required for audio processing. BirdNET uses location to identify which species are possible in your area. Without coordinates, audio chunks will be queued but not processed — they will be marked as failed in the inference queue.
Ways to find your coordinates:
- Google Maps: Right-click any location → the coordinates appear at the top of the context menu
- OpenStreetMap: Browse to your location, the URL contains the coordinates (e.g.,
map=15/43.4228/4.6310) - Phone: Open any maps app, long-press your location, coordinates will be shown
- Terminal:
curl -s ipinfo.io/locgives a rough estimate based on your IP address
Note: If your Pi has a GPS module (e.g., u-blox NEO-6M), coordinates will be updated automatically via gpsd. You can also set them later in the
.envfile (step 5).
4. Register the satellite
- Log in to the Otavi web UI
- Select your tenant from the dropdown in the sidebar
- Navigate to Tenant Admin → Satellites
- Click the "+ Register satellite" button
- Fill in:
- Name — a descriptive name (e.g., "Garden Pi", "Rooftop North")
- Latitude / Longitude (optional) — enter the coordinates from step 3 if available. They will be included in the generated
.envconfiguration.
- Click Register
- A complete
.envconfiguration will appear with all required fields - Click "Copy to clipboard" and save these somewhere safe — the MQTT password cannot be retrieved later
The satellite will appear in the Satellites table with a "registered" status until it connects for the first time.
Important: Keep these credentials secure. Anyone with them can send audio data to your hub as this satellite.
5. Install
install.sh is the only deployment path for both fresh installs and upgrades. It self-bootstraps pnpm via corepack, builds the workspace, deploys to /opt/otavi-satellite/ via pnpm deploy (resolves workspace deps), bootstraps the YAMNet Python venv with apt's numpy, auto-detects the USB audio device, writes the systemd unit, and starts the service.
# Clone
git clone <your-git-server>/otavi.git ~/otavi
cd ~/otavi
# Drop the .env from the registration step next to .env.example
cp packages/satellite/.env.example packages/satellite/.env
nano packages/satellite/.env # paste the values from the registration step
# Install — handles everything end-to-end
sudo ./packages/satellite/install.sh
install.sh is idempotent; re-run it for upgrades or to reapply config changes (it'll prompt only for any var still unset and reuse the rest from .env).
Connection: The satellite connects via WSS (WebSocket Secure) over standard HTTPS port 443. No extra firewall ports needed.
6. Verify
The systemd service is already enabled and started by install.sh. Tail the journal to confirm:
sudo systemctl status otavi-satellite
sudo journalctl -u otavi-satellite -f # Connect, YAMNet ready, audio capture starting
Filesystem layout
| Path | Owner | Purpose |
|---|---|---|
/opt/otavi-satellite/dist/index.js |
root | Service entry (what systemd runs) |
/opt/otavi-satellite/node_modules/ |
root | Runtime deps (deployed via pnpm deploy) |
/opt/otavi-satellite/yamnet-venv/ |
root | Python env for the YAMNet sidecar |
/opt/otavi-satellite/scripts/yamnet_vad.py |
root | YAMNet sidecar script |
/opt/otavi-satellite/models/yamnet.tflite |
root | YAMNet model + class map |
/opt/otavi-satellite/data/outbox.db |
root | Local SQLite outbox queue |
/opt/otavi-satellite/data/audio/ |
root | Buffered WAV chunks awaiting upload |
/opt/otavi-satellite/data/update-result.json |
root | How the last update ended; reported to the hub at the next heartbeat, then removed |
/opt/otavi-satellite.prev/ |
root | The deployment the last update replaced, put back when the new one does not stay up |
~/otavi/packages/satellite/.env |
install user | Config (gitignored, hand-edited) |
~/otavi/packages/satellite/scripts/otavi-update.sh |
install user | Update script the hub triggers |
/etc/systemd/system/otavi-satellite.service |
root | systemd unit (regenerated by install.sh) |
otavi-update.service |
root | Transient unit; exists only during an update |
otavi-update-rescue.timer |
root | Transient timer armed during an update: starts the satellite if the update hangs for an hour |
Logs go to journald — no file path. Tail with sudo journalctl -u otavi-satellite -f.
install.sh is idempotent — re-running it rewrites everything in /opt/... and the systemd unit, but preserves data/ (mid-deploy purge would lose unsent chunks) and yamnet-venv/ (avoids a slow pip reinstall on Pi 3). The .env in the checkout is the single source of truth and is never touched mid-run except to be re-read.
Reset from scratch (preserves .env)
.env lives in the checkout; deployment + data live inside /opt/otavi-satellite/.
# Stop service + any pending update jobs
sudo systemctl stop otavi-satellite otavi-update-rescue.timer 2>/dev/null
sudo systemctl reset-failed otavi-update.service 2>/dev/null
# Optionally preserve the YAMNet venv to skip a slow pip reinstall on Pi 3
sudo mv /opt/otavi-satellite/yamnet-venv /tmp/otavi-yamnet-venv.bak
# Wipe the deployment dir (includes /opt/otavi-satellite/data/ —
# outbox + buffered audio go here too now)
sudo rm -rf /opt/otavi-satellite
# Wipe build artifacts in the checkout (.env is preserved automatically)
rm -rf ~/otavi/node_modules ~/otavi/packages/*/node_modules ~/otavi/packages/*/dist
# Restore the venv if you stashed it
sudo mkdir -p /opt/otavi-satellite
sudo mv /tmp/otavi-yamnet-venv.bak /opt/otavi-satellite/yamnet-venv
# Run installer
sudo ~/otavi/packages/satellite/install.sh
For a truly clean slate (re-clone too): copy ~/otavi/packages/satellite/.env aside, rm -rf ~/otavi, re-clone, restore .env at the same path.
GPS Setup
For live GPS positioning instead of static coordinates:
sudo apt install -y gpsd gpsd-clients
Edit /etc/default/gpsd:
DEVICES="/dev/ttyUSB0" # or /dev/serial0 for GPIO UART
GPSD_OPTIONS="-n"
START_DAEMON="true"
sudo systemctl enable --now gpsd
cgps # Verify GPS fix
Add to .env:
OTAVI_SAT_GPS_MODE=gpsd
OTAVI_SAT_GPSD_HOST=localhost
OTAVI_SAT_GPSD_PORT=2947
When GPS mode is gpsd, the satellite reads live coordinates from the GPS daemon and updates the hub via telemetry. Falls back to static coordinates if GPS has no fix.
Position from the hub Pi 2.1.0
The hub has a say too hub 0.83.0:
- Use GPS (team settings, Satellites tab, or the satellite's page) switches gpsd off even where
.envsetsgpsd. Off, or without a GPS receiver, the Pi keeps a fixed position. - Fixed position: whoever manages the satellite can set it with Set… beside its position on the satellite's page, whenever the Pi reports that its position is not coming from a GPS fix. That position wins over
OTAVI_SAT_LATITUDE/OTAVI_SAT_LONGITUDEand is kept indata/position.json, so a Pi restarted without network still uses it. Once the hub has a position for a Pi, editing.envno longer moves it: set the new position on the hub.
Recording Profiles
Profiles control when the satellite captures audio. They are pushed from the hub via MQTT and can be changed on the Satellites page.
| Profile | Schedule | Description |
|---|---|---|
continuous |
24/7 | Always recording |
dawn_chorus |
sunrise-30min to sunrise+2h | Peak bird activity |
night_migration |
sunset+30min to sunset+12h | Nocturnal flight calls |
low_power |
sunrise+/-30min, sunset+/-30min | Dawn and dusk only |
Sunrise and sunset times are calculated automatically from the satellite's GPS coordinates using the NOAA solar algorithm. Times update daily as day length changes with seasons.
When outside a recording window, the satellite:
- Pauses the capture loop (no CPU/disk usage)
- Continues sending heartbeats (stays "online" on the hub)
- Reports state as
scheduled_offin the heartbeat - Re-checks the schedule every 5 minutes
Heartbeat
The satellite sends a lightweight heartbeat at a configurable interval (default 30 seconds, set from hub tenant settings) via MQTT QoS 1. This keeps the satellite showing as "online" on the hub even when all audio chunks are filtered out (silence).
The heartbeat includes the satellite's current state (recording, scheduled_off, error) and noise_floor_rms for filter calibration, visible on the Satellites page.
On-Device Audio Filtering
The satellite filters audio in two stages before upload:
- RMS silence gate (microsecond cost): drops chunks below
filter_min_rms. Off by default (0) since Pi 1.5.0: a Pi USB mic delivers around -78 dBFS, far under the old 0.003 floor, which blocked nearly everything. Catches dead-mic / muted-room cases cheaply. - YAMNet VAD (~30 ms cost on a Pi 4): a Python sidecar runs Google's YAMNet TFLite model and computes per-category probability sums:
bird(AudioSet 67/103/106/107) — kept when aboveyamnet_min_bird_prob(default 0.05)amphibian(frog, 127),insect(cricket/insect, 121-122),anthropogenic(44 vehicle/tool/alarm/firework classes),human_voice(17 speech/laughter/breathing classes),other_animal(10 dog/cat/cattle classes)
A chunk passes when bird ≥ threshold AND no excluded category outscores bird. The set of excluded categories comes from each tenant's drop_*_at_satellite toggles (default true), pushed via MQTT and overridable per satellite.
The Python sidecar uses ai-edge-litert (with a tflite-runtime fallback for older Pythons). YAMNet fails open if the model or runtime is missing — i.e. only the cheap RMS gate runs.
Since Pi 2.1.1 the sidecars' Python packages are pinned: install.sh and the updater install every one at the version packages/satellite/scripts/sidecar-constraints.txt gives for Python 3.13 (Debian 13), the set a Pi 5 ran when they were pinned. An update moves a package installed at another version to that one. On another Python version, pip still picks the versions itself. The satellite's Node packages come from the repository's lockfile only: an install or update stops rather than resolving versions afresh.
The satellite reports per-category drop counts and a live RMS sample in the heartbeat. Filtering is automatically disabled for simulate and replay capture modes.
Updating
Remote update from hub
Admins can trigger an update from the web UI:
- Go to Satellites page
- Open the satellite with an outdated version (shows ⚠)
- Click the Update button next to the version
This sends an MQTT command to the satellite, which runs the update script in the transient unit otavi-update (follow it with sudo journalctl -u otavi-update -f) and installs the release the hub names. The satellite goes offline during the update (about a minute on a Pi 4 when nothing changed in its Python packages) and reconnects with the new version. How the update ended shows on the satellite's page: a failed one is marked ✗, with the reason on hover.
What an update does
otavi-update.sh (update protocol 2, since Pi 1.8.0) works in two stages:
- It fetches the releases (
vsat-*tags), picks the one asked for (the newest by default), stops the service and checks the release out. This stage runs the installed script: bash keeps reading the file it opened while git replaces it. - It hands over to the release's own
otavi-update.sh, which builds and deploys it. A release therefore installs itself, however its build or layout changed.
On the way it:
- installs only the satellite and the packages it depends on, and selects them by path, so a renamed package can never leave an empty build;
- stages the build inside the checkout (
.otavi-deploy/) and checks it (entry point, version, dependencies) before anything under/optchanges; - keeps the deployment it replaces in
/opt/otavi-satellite.prev, and puts it back when the new one does not stay up for 45 seconds; - starts the service again on any exit, and arms a timer that starts it after an hour if the update hangs or is killed;
- leaves the outcome in
data/update-result.json, which the satellite reports to the hub at its next heartbeat.
It refuses a release older than 1.8.0 (--allow-old installs one anyway), and runs one update at a time. When the repository stops answering under its name, it tries the other one (birdnet or otavi) and keeps the one that works.
Moving to the otavi layout Pi 2.0.0
A Pi installed before 2.0.0 runs the unit birdnet-satellite from /opt/birdnet-satellite, often from a checkout called ~/birdnet. Its first update to 2.0.0 moves it, with the service stopped:
- the checkout, when it is named
birdnetorbirdnet-ng, becomesotavinext to it; /opt/birdnet-satellitebecomes/opt/otavi-satellite(the data, the outbox and the Python venv go with it; the outbox finds its recordings at their new path when it starts);- the paths in the checkout's
.envfollow (owner and mode kept), and so do the venv's scripts; - the unit becomes
otavi-satellite, built from the old one with its local changes and drop-ins, and checked: every path it names must exist.
Until the new release is up, a symlink at each old path keeps the old unit working, and they go once it is. When the unit cannot be checked, the Pi keeps running as birdnet-satellite through those links, and the next update finishes the move. install.sh refuses to run on a Pi still on the old layout and points to the updater instead.
A Pi still on 1.7.0 or older updates with its old script, which takes the newest release whatever the hub names and selects the packages by their old names. On 2.0.0 or later it builds nothing and empties /opt/birdnet-satellite, so the hub refuses to update it (409 PI_UPDATER_TOO_OLD). Bring it to 1.8.0 on the Pi first, then update it from the hub:
cd ~/birdnet && git fetch --tags && git checkout vsat-1.8.0 && sudo bash packages/satellite/install.sh
Do not run its old birdnet-update.sh by hand once 2.0.0 is out: it would do the same. A Pi emptied that way comes back with these commands.
Manual update
cd ~/otavi
./packages/satellite/scripts/otavi-update.sh # asks, then installs the newest release
./packages/satellite/scripts/otavi-update.sh --force # no question; rebuilds even when current
./packages/satellite/scripts/otavi-update.sh --target 1.8.0 --force
Git credentials
To avoid entering credentials on every git pull:
git config --global credential.helper store
Next time you authenticate, credentials are saved in ~/.git-credentials. For GitHub, use a personal access token as the password.
Troubleshooting
| Symptom | Check |
|---|---|
| Satellite shows offline | Verify MQTT credentials, check journalctl -u otavi-satellite |
| No detections | Check if all chunks are filtered (low audio activity), verify worker is running |
| GPS unavailable | Check cgps for fix, verify /dev/ttyUSB0 permissions |
| High CPU temp | Normal for Pi 4 under load (50-70°C); add heatsink or fan for continuous operation |
| Storage filling up | Lower outbox_hard_size_mb in tenant settings (or per-satellite override) and check outbox drain |
Testing MQTT connectivity from the Pi
sudo apt install -y mosquitto-clients
mosquitto_sub -h mqtt.otavi.example.com -p 443 \
--capath /etc/ssl/certs \
-u "your-satellite-uuid" -P "your-mqtt-password" \
-t "test" -W 5
If it returns Connection error: Connection Refused, credentials are wrong or the broker is unreachable. Note the password is shown only once at registration; if you lost it, register the satellite again with the same device id to mint fresh credentials.
Field Deployment Tips
- Weatherproofing. IP65+ rated enclosure. Cables through sealed glands. Avoid condensation buildup with a small bag of silica gel inside the enclosure.
- Power. For solar: a 20W panel + 20,000mAh battery bank gives roughly 24h autonomy in cloudy conditions. Pi 4 idle draws ~3W; Pi 4 under inference load draws ~6W.
- Microphone placement. Mount above the enclosure, protected from rain by a small overhang. Avoid surfaces that vibrate (the mic picks up structural noise).
- Network. If Wi-Fi is unreliable, a 4G USB dongle works (Huawei E3372 and similar). The outbox handles store-and-forward for offline windows.
- Multiple satellites. Each satellite has its own registration and MQTT credentials. Name them by location (e.g. "Garden North", "Pond Edge") so detections from different sites stay distinguishable in the hub UI.