Troubleshooting
BLE Connection Issues
Device not found during scan
Symptom: cgd1 scan returns no devices.
Solutions:
- Ensure the CGD1 is powered on (batteries inserted)
- Move closer to the device (within 5 meters)
- Verify Bluetooth is enabled on the host:
bluetoothctl power on - Check that the BLE adapter is available:
hciconfig - Stop other BLE applications that may be holding the adapter (e.g., other scanning tools)
Connection fails
Symptom: Error: Transport(NotConnected) or Error: Transport(Timeout).
Solutions:
- Ensure the device is not currently connected to another host (the CGD1 supports only one active BLE connection)
- Restart Bluetooth:
sudo systemctl restart bluetooth - Remove any existing pairing from the OS Bluetooth manager:
bluetoothctl remove AA:BB:CC:DD:EE:FF - Try connecting again after a few seconds
Connection drops unexpectedly
Symptom: ClockEvent::Disconnected events or Error: Transport(Timeout) during operations.
Solutions:
- Check battery level - low batteries can cause disconnections
- Reduce distance between host and device
- Avoid 2.4 GHz Wi-Fi interference (switch to 5 GHz or change Wi-Fi channel)
- The library will attempt automatic reconnection with exponential backoff
Authentication Issues
Authentication fails on first connection
Symptom: Error: AuthFailed with is_new_token: true.
Solutions:
- This should not happen on a fresh device. Ensure you are connecting to the correct MAC address
- Try generating a new token by deleting the token file:
rm ~/.local/share/cgd1-rs/tokens/AA_BB_CC_DD_EE_FF.bin - Run
sync-timeagain to generate and store a new token
Authentication fails after previously working
Symptom: Error: AuthFailed with is_new_token: false.
Cause: The device was likely paired with a different app (e.g., the official Qingping app), which overwrites the authentication token.
Solutions:
- Delete the stored token:
rm ~/.local/share/cgd1-rs/tokens/AA_BB_CC_DD_EE_FF.bin - Reconnect with
sync-timeto generate a new token - Note: The official app and
cgd1-rscannot share the same token. Using one will invalidate the other’s token
sync-time times out (token not accepted)
Symptom: Authentication ACKs succeed (04 ff 01 00 .., 04 ff 02 00 ..), but sync-time receives no ACK and times out after 10 seconds.
Cause: The device sends Auth ACKs even with a bad token. The real token acceptance is only proven by a privileged command like sync-time. If sync-time times out, the device has a different token stored from a previous pairing (another app, a prior run with a different random token, etc.). The device requires an explicit factory reset before it accepts a new token.
Solutions:
- Perform a factory reset on the CGD1 device (see Factory Reset below)
- Delete any stored token file for this device:
rm ~/.local/share/cgd1-rs/AA_BB_CC_DD_EE_FF - Reconnect - a new token will be generated and, after
sync-timesucceeds, persisted automatically
sync-time succeeds but other commands fail
Symptom: sync-time works, but alarm-set or settings-write returns errors.
Solutions:
- Verify the device is still connected (
cgd1 battery <mac>) - Check that the token was persisted (look for the token file in
~/.local/share/cgd1-rs/tokens/) - Try disconnecting and reconnecting
Audio Upload Issues
Upload fails with MTU error
Symptom: Error: MtuTooSmall { mtu: ... }.
Solutions:
- The device or host does not support a sufficient MTU. This is a hardware limitation
- Try restarting Bluetooth and reconnecting
- Some BLE adapters negotiate a lower MTU on first connection; disconnect and reconnect
Upload aborts mid-transfer
Symptom: Upload starts but fails partway through.
Solutions:
- Ensure no other BLE operations are running concurrently (alarm reads, settings reads, RSSI polling)
- Keep the device close to the host during the entire transfer
- Verify the audio file is valid 8-bit unsigned PCM at 8 kHz mono
- Check the file size is under 98 KB
Audio plays incorrectly after upload
Solutions:
- Verify the source audio is 8-bit unsigned PCM (not signed, not 16-bit)
- Verify the sample rate is exactly 8000 Hz
- Verify the audio is mono
- Try alternating the signature slot (
CustomSlotA→CustomSlotB)
GTK Controller Issues
Application fails to start
Symptom: error: failed to run command: cgd1-rs-controller or GTK warnings.
Solutions:
- Verify GTK 4 is installed:
pkg-config --modversion gtk4 - Check for missing CSS or font resources
Sensor cards not updating
Solutions:
- Verify the device is connected (check the sidebar)
- Try disconnecting and reconnecting
- Check the application logs with verbosity enabled
Virtual Backend
Using the virtual backend for testing
The --backend virtual flag uses an in-memory device simulation:
cgd1 --backend virtual scan
cgd1 --backend virtual sync-time AA:BB:CC:DD:EE:FF
cgd1 --backend virtual alarm-list AA:BB:CC:DD:EE:FF
This works without any BLE hardware and is useful for testing CLI behavior, scripts, and the WebSocket server.
Factory Reset
A factory reset clears the stored authentication token on the CGD1, allowing it to accept a new token. This is required when:
sync-timetimes out after successful Auth ACKs (token mismatch)- The device was previously paired with the official Qingping app or another host
- A previous run generated a random token that was never persisted but the device stored it
Step-by-Step Instructions
- Batteriefach öffnen: Öffnen Sie die Abdeckung auf der Rückseite des Geräts und entnehmen Sie die Batterien.
- Gerät gedrückt halten: Drücken und halten Sie das gesamte Gehäuse von oben nach unten (die “Snooze/Licht”-Taste des Weckers drückt sich dadurch am Boden ein).
- Batterien wiedereinsetzen: Setzen Sie die Batterien ein, während Sie das Gerät weiterhin kontinuierlich gedrückt halten.
- Halten für 12 Sekunden: Halten Sie das Gerät für mindestens 12 Sekunden fixiert nach unten gedrückt.
- Ergebnis prüfen: Sobald auf dem Display alle Zahlen als “8” aufleuchten, ist der Werksreset abgeschlossen. Lassen Sie das Gerät nun los.
After the Reset
- Delete any stale token files for this device:
rm ~/.local/share/cgd1-rs/AA_BB_CC_DD_EE_FF - Reconnect with
cgd1-rs- a new random token will be generated - After
sync-timesucceeds, the token is automatically persisted for future connections
Warning: Factory reset clears all device settings (alarms, brightness, volume, etc.) in addition to the auth token.
Reporting Issues
If you encounter a bug or have a feature request, please open an issue on GitHub.
Include:
- The command or code that triggered the issue
- The full error output (use
-vvvfor maximum verbosity) - Your OS and Bluetooth adapter model
- The device firmware version (
cgd1 firmware <mac>)