Troubleshooting
Self-Diagnostics
Run the built-in doctor command to check everything:
pieeg-server doctorThis checks:
- Raspberry Pi model and revision
- SPI enabled and accessible
- GPIO chip available
- Required Python packages installed
- DSP engine (native
pieeg-corevs. pure-Python fallback) - Ports 1616/1617 available
- Systemd service status
Common Issues
SPI not enabled
Error: SPI device not foundFix: Enable SPI and reboot:
sudo raspi-config nonint do_spi 0
sudo rebootPort already in use
Error: Address already in use (port 1616)Fix: Stop the existing instance:
sudo systemctl stop pieeg-server
# or
kill $(lsof -t -i:1616)No data from hardware
Symptoms: Dashboard shows flat lines or no frames.
PiEEG (SPI)
- Shield properly seated on GPIO header
- Electrodes connected
- Correct device flag:
--device pieeg8or--device pieeg16 - Run
pieeg-server doctorfor hardware diagnostics - On Pi 5, make sure
--gpio-chip /dev/gpiochip4is used (the default). On Pi 4 / 3 / 2, use--gpio-chip /dev/gpiochip0.
Pi 4 vs Pi 5 hardware profile
The server auto-detects the Raspberry Pi model and applies a matching hardware profile. If auto-detection picks the wrong one (e.g. on a custom image), force it explicitly:
pieeg-server --profile pi5 # Raspberry Pi 5
pieeg-server --profile pi4 # Pi 2 / 3 / 4 / 400Symptoms of a profile mismatch:
GPIO busy/Device or resource busyon Pi 5 in 8-channel mode — the kernel SPI driver already owns the CE line. Use--profile pi5(orauto).- Garbled samples / dropped frames on Pi 4 — the Pi 5 profile uses a
slower 2 MHz SPI clock; force
--profile pi4to restore 4 MHz.
IronBCI / EAREEG (Bluetooth LE)
- Bluetooth adapter enabled:
bluetoothctl showshould list a controller - Device powered on and in range
- Correct flags:
--device ironbci8(optionally--ble-nameor--ble-address) - BLE extra installed:
pip install pieeg-server[ironbci] - If scan times out, try passing the MAC address directly with
--ble-address - On Linux, ensure your user has permissions for Bluetooth (or run with
sudo)
IronBCI-32 (USB serial)
- Device enumerated by the OS:
ls /dev/ttyACM*(Linux/macOS) or check Device Manager → Ports (Windows) - Correct flags:
--device ironbci32 --serial-port /dev/ttyACM0(orCOM3on Windows) - Serial extra installed:
pip install pieeg-server[ironbci32] - On Linux, add your user to the
dialoutgroup for serial access:sudo usermod -aG dialout $USER(then log out/in) - If frames are dropped, check the
dropped_framescounter — usually indicates a USB cable or hub issue at 921600 baud
Dashboard not loading
Check:
- Server is running:
sudo systemctl status pieeg-server - Correct URL:
http://raspberrypi.local:1617 - Try IP directly:
http://<pi-ip>:1617 - Firewall not blocking ports 1616/1617
WebSocket connection failed
Check:
- WebSocket port:
ws://<host>:1616 - If using
--auth, include the token:?token=<ws-token> - Browser console for connection errors
- CORS is not an issue (WebSocket doesn't enforce CORS)
Mock mode
Use pieeg-server --mock anytime to test without hardware. Generates realistic synthetic EEG with alpha rhythm, drift, noise, and blink artifacts.