IDE no longer able to connect. No service matching UUID found on device.
See original GitHub issueHi,
First of all, thanks for your work on this software.
Please note this may not be an issue with the Espruino software, but something lower in the stack.
The issue:
I was writing/pushing/testing code onto the BangleJS from the Espruino Web IDE when the connection dropped between the IDE and BangleJS.
I attempt to reconnect the Espruino Web IDE to the BangleJS, but I get a “Connection Failed” error in the console, and the following information in the Settings->Console:
Connecting… Set Slow Write = true Connecting to Bangle.js 42f5 BT> Device Name: Bangle.js 42f5 BT> Device ID: BYfxEVPBkeAIzXRROotySA== Connected to BLE BT> Connected BT> ERROR: NotFoundError: No Services matching UUID 6e400001-b5a3-f393-e0a9-e50e24dcca9e found in Device. BT> Disconnected (gattserverdisconnected) ERROR: [notify_error] Connection Failed. Connection Failed.
Hardware/Software information
Espruino:
- Hardware: BangleJS
- Firmware version: 2v05 (I tried it with 2v08 too)
Development PC information:
- OS: Debian unstable/sid
- Kernel version: 5.9.0 (I tried 5.2.0 as an alternative)
- Bluetooth hardware: CSR 4.0 (according to dmesg, “CSR8510 A10”)
- BlueZ version: 5.55
- Chromium version: 83.0.4103.116
Things tried
- Tried to connect from the web browser IDE (failed)
- Tried with a different Linux kernel booted (5.2.0). Also unsuccessful
- Tried it with a different version of the BangleJS firmware (2v05 and 2v08 – both failed)
- Tried to “clear” browser configuration (i.e.
rm -rf ~/.config/chromium ~/.cache/chromium
). Failed. - I suspected it might be something deeper in the stack (e.g. bluetooth config being cached?), so I created a new Linux user on the same PC, and tried connecting, that failed too.
- Powering down/restarting the PC and BangleJS watch (power cycle the BT hardware). Unsuccessful.
What worked:
- I tried from my other computer. The same software stack (i.e. Debian unstable). It worked. I could pair and push code to the same BangleJS.
What changed recently:
- I’ve been using this setup weekly for the last 10 months (originally with other Espruino hardware), and it’s been okay up until now.
- Latest changes include: upgrading firmware to 2v08, upgrading kernel to 5.9.0
Debugging information
Based on my limited understanding of Bluetooth, it appears that the service UUID does exist (run on the PC experiencing issues):
$ sudo bluetoothctl [bluetooth]# connect F3:CA:1F:3A:42:F5 Attempting to connect to F3:CA:1F:3A:42:F5 [CHG] Device F3:CA:1F:3A:42:F5 Connected: yes Connection successful [CHG] Device F3:CA:1F:3A:42:F5 Connected: yes Connection successful [CHG] Device F3:CA:1F:3A:42:F5 UUIDs: 00001800-0000-1000-8000-00805f9b34fb [CHG] Device F3:CA:1F:3A:42:F5 UUIDs: 00001801-0000-1000-8000-00805f9b34fb [NEW] Primary Service (Handle 0x1a7d) /org/bluez/hci0/dev_F3_CA_1F_3A_42_F5/service000a 00001801-0000-1000-8000-00805f9b34fb Generic Attribute Profile [NEW] Secondary Service (Handle 0x1a7d) /org/bluez/hci0/dev_F3_CA_1F_3A_42_F5/service000b 6e400001-b5a3-f393-e0a9-e50e24dcca9e Nordic UART Service [NEW] Characteristic (Handle 0xd8ab) /org/bluez/hci0/dev_F3_CA_1F_3A_42_F5/service000b/char000c 6e400003-b5a3-f393-e0a9-e50e24dcca9e Nordic UART RX [NEW] Descriptor (Handle 0x6da0) /org/bluez/hci0/dev_F3_CA_1F_3A_42_F5/service000b/char000c/desc000e 00002902-0000-1000-8000-00805f9b34fb Client Characteristic Configuration [NEW] Characteristic (Handle 0xd8ab) /org/bluez/hci0/dev_F3_CA_1F_3A_42_F5/service000b/char000f 6e400002-b5a3-f393-e0a9-e50e24dcca9e Nordic UART TX [CHG] Device F3:CA:1F:3A:42:F5 UUIDs: 00001800-0000-1000-8000-00805f9b34fb [CHG] Device F3:CA:1F:3A:42:F5 UUIDs: 00001801-0000-1000-8000-00805f9b34fb [CHG] Device F3:CA:1F:3A:42:F5 UUIDs: 6e400001-b5a3-f393-e0a9-e50e24dcca9e [CHG] Device F3:CA:1F:3A:42:F5 ServicesResolved: yes
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (6 by maintainers)
Top GitHub Comments
I found the issue and solution. Thanks for all your help.
The short version is, remove the Bluetooth cache file for the controller/device combination as follows:
sudo rm /var/lib/bluetooth/<Controller MAC>/cache/<Device MAC>
For my combination of controller and BangleJS this was:sudo rm /var/lib/bluetooth/00\:1A\:7D\:DA\:71\:13/cache/F3\:CA\:1F\:3A\:42\:F5
Note: depending on how the cache files are generated, it might be a good idea to stop the bluetooth service first via:sudo systemctl stop bluetooth.service
Then after deleting the cache file, start it back up with:sudo systemctl start bluetooth.service
The longer version (for anybody that might stumble across this): I stopped the Bluetooth service:
sudo systemctl stop bluetooth.service
And brought it up in debug mode:sudo bluetoothd -nd
After attempting to connect to the device from the IDE, I noticed this in the debug log:Searching for “gatt_service_removed” I came across a mailing list post that discusses “link keys”. Some more searching on “bluez remove link key”, I came across this post that informed me of /var/lib/bluetooth/ (the path of the cache file explains why creating a new Linux user on the troublesome PC led to the same issue). After some backing up/deleting directories I figured out the solution above.
Again, thanks for your time. Much appreciated. All the best.
It was an issue for me, but I didn’t read the links I posted thoroughly enough to determine if they tried/experienced the same thing 😃