eriklins / InsideBlue-BLE-Tool

InsideBlue BLE Tool is a cross-platform Bluetooth LE utility. It can scan for BLE devices showing device information and advert payload as well as connect to devices and access GATT services/characteristics.
MIT License
41 stars 10 forks source link

Services listing for device - Editable field bug #3

Open PetBom opened 1 year ago

PetBom commented 1 year ago

image Hi There seems to be an issue with listing services for some devices (see screenshot). The third service listed is strange. I do not know which of the additional services avliable on the device this represents, but here is my parsed output for the same device (Also using SimpleBLE):

Connected: Tacx Flux-2 25385 -55dBm [Connectable] e2:62:1c:17:1f:0d Manufacturer data: Tacx b.v. (0x2980) Service: 00001800-0000-1000-8000-00805f9b34fb Characteristic: 00002a00-0000-1000-8000-00805f9b34fb [read] Characteristic: 00002a01-0000-1000-8000-00805f9b34fb [read] Characteristic: 00002a04-0000-1000-8000-00805f9b34fb [read] Service: 00001801-0000-1000-8000-00805f9b34fb Characteristic: 00002a05-0000-1000-8000-00805f9b34fb [indicate] Descriptor: 00002902-0000-1000-8000-00805f9b34fb Service: 0000180a-0000-1000-8000-00805f9b34fb Characteristic: 00002a24-0000-1000-8000-00805f9b34fb [read] Characteristic: 00002a26-0000-1000-8000-00805f9b34fb [read] Characteristic: 00002a29-0000-1000-8000-00805f9b34fb [read] Service: 00001818-0000-1000-8000-00805f9b34fb Characteristic: 00002a5d-0000-1000-8000-00805f9b34fb [read] Characteristic: 00002a63-0000-1000-8000-00805f9b34fb [notify] Descriptor: 00002902-0000-1000-8000-00805f9b34fb Characteristic: 00002a65-0000-1000-8000-00805f9b34fb [read] Characteristic: 00002a66-0000-1000-8000-00805f9b34fb [write_request, indicate] Descriptor: 00002902-0000-1000-8000-00805f9b34fb Service: 00001826-0000-1000-8000-00805f9b34fb Characteristic: 00002acc-0000-1000-8000-00805f9b34fb [read] Characteristic: 00002ad2-0000-1000-8000-00805f9b34fb [notify] Descriptor: 00002902-0000-1000-8000-00805f9b34fb Characteristic: 00002ad6-0000-1000-8000-00805f9b34fb [read] Characteristic: 00002ad8-0000-1000-8000-00805f9b34fb [read] Characteristic: 00002ad9-0000-1000-8000-00805f9b34fb [write_request, indicate] Descriptor: 00002902-0000-1000-8000-00805f9b34fb Characteristic: 00002ada-0000-1000-8000-00805f9b34fb [notify] Descriptor: 00002902-0000-1000-8000-00805f9b34fb Service: 669aa501-0c08-969e-e211-86ad5062675f Characteristic: 669aac01-0c08-969e-e211-86ad5062675f [read, write_request] Descriptor: 00002904-0000-1000-8000-00805f9b34fb Service: 669aa605-0c08-969e-e211-86ad5062675f Characteristic: 669aab01-0c08-969e-e211-86ad5062675f [write_request] Descriptor: 00002901-0000-1000-8000-00805f9b34fb Characteristic: 669aab02-0c08-969e-e211-86ad5062675f [notify] Descriptor: 00002901-0000-1000-8000-00805f9b34fb Descriptor: 00002902-0000-1000-8000-00805f9b34fb Characteristic: 669aab21-0c08-969e-e211-86ad5062675f [write_request, write_command] Descriptor: 00002901-0000-1000-8000-00805f9b34fb Characteristic: 669aab22-0c08-969e-e211-86ad5062675f [notify] Descriptor: 00002901-0000-1000-8000-00805f9b34fb Descriptor: 00002902-0000-1000-8000-00805f9b34fb Service: 6e40fec1-b5a3-f393-e0a9-e50e24dcca9e Characteristic: 6e40fec2-b5a3-f393-e0a9-e50e24dcca9e [notify] Descriptor: 00002902-0000-1000-8000-00805f9b34fb Characteristic: 6e40fec3-b5a3-f393-e0a9-e50e24dcca9e [write_request, write_command]

The device also fails to connect, and I'm guessing that this is related. There is no output to the log other than "Failde to connect...") The device is connectable via SimpleBLE as I am doing it in my application from the same machine (Windows, SimpleBLE). Please let me know if there is some input I can provide that can help you track down the connection issue. I belive the isssue is somewhere in your handling of the service listings.

InsideBlue 0.6 Win64

eriklins commented 1 year ago

Hello @PetBom, thanks for looking into this - always happy for feedback and how InsideBlue works on different PCs than mine. ;o)

The screenshot shows the main scanning window with your device and the advertised service "Cycling Power" plus advertised service data "010020". The below text output shows the services and characteristics exposed from the device's GATT table. That's two different things. During scanning a device can advertise services (often just one due to very limited payload in BLE advertisment) and service data and those are (or can be) different from the GATT table, where many more services and characteristics can be exposed. The service UUID 6e40fec1-b5a3-f393-e0a9-e50e24dcca9e is both in the scan screenshot and in the GATT output. I would say, all good. :-) When connecting to the device, it should read the full gatt table and present it in a similar window as the scan window with the ability to read/write/notify/etc. characteristics.

The underlying SimpleBLE library does not (yet...) expose more detailed error messages than just success or failed, so no more output possible on InsideBlue side.

Being not able to connect might be related to your device not being paired with the PC? This cannot (yet...) be done with SimpleBLE and hence not with InsideBlue. You would have to pair your device with your PC through the Windows Bluetooth system settings and add the device there plus whatever pairing requires (some digits, yes/no, or just-works, depends on your device). Would be great if you could test pairing the device and then try again to connect.

There might be further requirements coming from your device during an active connection, like a timeout in case there is no traffic for a certiain amount of time or not having notified a certain characteristic or something like this.

Thanks...

PetBom commented 1 year ago

Hi @eriklins

You are right that the service listing is from the SimpleBLE peripheral_services() call on a connected device. I reaIize now that the field in InsideBlue is from the advertised services. Check!

However, the device is not paired, I've made sure that it is not, to be able to manage/test my own connections with unpaired devices. As for the connection, the device actually thinks that it is connected to InsideBlue even after Inside blue reports failed to connect. Indicated by sniffing (with nRF Connect) and by physical indicators on the device.

I tried some other devices (Heart Rate monitor) and get the same issue. So I'm not enierly sure what is going on. I'll do some more test and see if I can come up with some answers..,

PetBom commented 1 year ago

Ok. It seems that the third advertised service trips up (?) image I can identify the two first as part of the GATT_Specification_Supplement, and the fourth is Tacx FE-C over BLE implementation, wich is widely used. The third however is an undocumented propriatary service that I do not know what it is or does. But anyways it should not be considered service data, right? It is a service, and advertised as such.

eriklins commented 1 year ago

Correct, 1818 is Cycling Power and 1826 is Fitness Machine, which has service data 010020. Third and fourth are proprietary services but the third one is missing in the list. Not totally sure why it's missing. I'll look into this but not sure how to replicate this here.

PetBom commented 1 year ago

Let me know if there is something I can check. Is there some way to get a more verbose log output for the connection procedure?