cd raspberry-pi/
python3 setup_device.pyThe wizard will guide you through:
- ✅ Generating unique Device ID and Key
- ✅ Configuring display name
- ✅ Setting up Firebase credentials
- ✅ Creating config.json automatically
You'll get output like:
Device ID: DEVICE_20251031143055_A7K9F2
Device Key: k3mN9pQ2rT5vW8xY1zB4cD6eF9gH2jK5
✨ Setup Complete!
Credentials saved to: device_credentials_20251031_143055.txt
# Copy config and service account key to your Pi
scp config.json pi@<raspberry-pi-ip>:~/panelsena/
scp serviceAccountKey.json pi@<raspberry-pi-ip>:~/panelsena/# SSH into your Raspberry Pi
ssh pi@<raspberry-pi-ip>
# Navigate to directory
cd ~/panelsena
# Run the player
python3 player.pyYou'll see:
[INFO] Device not linked yet
Please link this device in the dashboard:
Device ID: DEVICE_20251031143055_A7K9F2
Device Key: k3mN9pQ2rT5vW8xY1zB4cD6eF9gH2jK5
Waiting for device to be linked...
- Open PanelSena dashboard in browser
- Go to Displays page
- Find or create a display
- Click "Link Device" button
- Enter:
- Device ID:
DEVICE_20251031143055_A7K9 - Device Key:
k3mN9pQ2rT5vW8xY1zB4cD6eF9gH2jK5
- Device ID:
- Click "Link Device"
Raspberry Pi console updates:
[INFO] Device linked! User: abc123, Display: display-001
[INFO] Listening for commands...
[INFO] Player is running.
- Go to Live Control page in dashboard
- Your device shows as "Online" 🟢
- Select a schedule and click "Play Schedule"
- Done! 🎉
{
"device_id": "DEVICE_20251031143055_A7K9",
"device_key": "k3mN9pQ2rT5vW8xY1zB4cD6eF9gH2jK5",
"display_name": "Raspberry Pi Display - Main",
"database_url": "https://panelsena-default-rtdb.firebaseio.com",
"storage_bucket": "panelsena.firebasestorage.app",
"service_account_path": "serviceAccountKey.json"
}python3 generate_device_credentials.pypython3 player.pysudo systemctl enable panelsena.service
sudo systemctl start panelsena.servicesudo journalctl -u panelsena.service -fsudo systemctl restart panelsena.serviceProblem: "Invalid device credentials"
✅ Solution:
- Check Device ID is exact match (case-sensitive)
- Verify Device Key is correct
- Ensure no extra spaces
Problem: Device linked but not showing
✅ Solution:
- Check player is running:
ps aux | grep player.py - View logs:
sudo journalctl -u panelsena.service -f - Restart player:
sudo systemctl restart panelsena.service
Problem: "Failed to initialize Firebase"
✅ Solution:
- Verify
serviceAccountKey.jsonexists - Check internet connection:
ping google.com - Verify database_url is correct
- Complete Setup:
README.md - Device Auth Guide:
../DEVICE_AUTHENTICATION.md - Live Control:
../LIVE_CONTROL_SETUP.md
✅ Remote playback control ✅ Real-time status monitoring ✅ Schedule management ✅ Volume control ✅ Device restart capability ✅ Automatic content downloading ✅ VLC-based media playback
- Keep Device Key secret - Don't share publicly
- Service account key - Never commit to Git
- Firestore rules - Configured automatically
- HTTPS - Firebase uses secure connections
- Save credentials - Keep device_credentials_*.txt file safe
- Multiple devices - Generate unique credentials for each Pi
- Test first - Run player manually before enabling auto-start
- Monitor logs - Check logs regularly for errors
- Update software - Keep OS and packages updated
Setup checklist:
- Generate device credentials
- Copy config.json to Pi
- Copy serviceAccountKey.json to Pi
- Install dependencies (
./install.sh) - Test player manually
- Link device in dashboard
- Verify in Live Control
- Enable auto-start service
- Test reboot (device should auto-start)
Need Help? Check the full documentation in README.md or DEVICE_AUTHENTICATION.md
Ready to scale? Generate more credentials and repeat for additional Raspberry Pis!