2.3 KiB
2.3 KiB
Clio Pi
Raspberry Pi recording station for the Clio audio system.
Features
- Continuous audio recording with ffmpeg (opus codec, 2hr segments)
- Systemd service for auto-start on boot
- HTML status page showing recording coverage
- NTP time sync via chrony
- SSH key-only access (hardened)
Quick Setup
- Flash Raspberry Pi OS Lite to SD card using Raspberry Pi Imager
- Configure in Imager: hostname, user/pass, WiFi, enable SSH
- Boot and SSH into Pi
- Copy this directory to the Pi:
rsync -avz /work/projects/clio/clio-pi/ pi@<pi-ip>:~/clio-pi/ - Run setup:
ssh pi@<pi-ip> cd ~/clio-pi sudo ./setup.sh - Add your SSH key before rebooting:
ssh-copy-id pi@<pi-ip> - Start recording:
sudo systemctl start record.service
Files
clio-pi/
├── setup.sh # Main setup script (run with sudo)
├── bin/
│ ├── record.sh # Recording loop (ffmpeg)
│ └── gen_recording_status.py # Status page generator
├── systemd/
│ └── record.service # Systemd service unit
└── README.md
Configuration
Edit ~/bin/record.sh environment variables:
| Variable | Default | Description |
|---|---|---|
AUDIO_DEVICE |
hw:1 |
ALSA device (run arecord -l to list) |
SEGMENT_SECONDS |
7200 |
Segment length (2 hours) |
RECORDINGS_DIR |
~/recordings |
Output directory |
SOURCE_NAME |
stationary |
Filename prefix |
Services
| Service | Description |
|---|---|
record.service |
Recording daemon |
chrony |
NTP time sync |
nginx |
Status page web server |
Commands
# Recording service
sudo systemctl start record.service
sudo systemctl stop record.service
sudo systemctl status record.service
journalctl -u record.service -f
# Check time sync
chronyc tracking
timedatectl
# View status page
curl http://localhost/
Syncing Recordings to Server
TODO: Add rsync/sync script to push recordings to server (10.0.0.45)
Audio Device Setup
List available devices:
arecord -l
Example output:
card 1: Device [USB Audio Device], device 0: USB Audio [USB Audio]
This would be hw:1,0 or just hw:1.