Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'Error 14 (0xe): GATT ERR UNLIKELY' after every notification #9

Closed
mikaku opened this issue Oct 18, 2018 · 3 comments
Closed

'Error 14 (0xe): GATT ERR UNLIKELY' after every notification #9

mikaku opened this issue Oct 18, 2018 · 3 comments

Comments

@mikaku
Copy link

mikaku commented Oct 18, 2018

Hello Paul,

First of all, thank you very much for this great piece of code. 👍

I hope you can help me to clear up what is going here.

I've downloaded your latest version on a CentOS 7 Linux running on a Raspberry Pi v3 B, using Bluez version 5.49. The compilation went fine and I'm able to run ./standalone -d without any problems.

Then I'm using the Android App called nRF Connect to be able to establish a BLE connection with the standalone program. This also when smooth and well.

I've expanded the Unknown Characteristic where you can send a text and it will go back to you as a notification. I wrote and sent just a test string and it indeed went back to me as a notification, but I see the error Error 14 (0xe): GATT ERR UNLIKELY in the log of the session. I used the nRF Logger Android App to obtain the complete transcription log:

(please scroll down near to the end to see the error)

nRF Connect, 2018-10-18
Gobbledego (B8:27:EB:37:2C:0D)
I	11:24:15.029	[Server] Server started
V	11:24:15.065	Heart Rate (0x180D)
- Heart Rate Measurement [N] (0x2A37)
   Client Characteristic Configuration (0x2902)
- Body Sensor Location [R] (0x2A38)
- Heart Rate Control Point [W] (0x2A39)
Unknown Service (0000aaa0-0000-1000-8000-aabbccddeeff)
- Unknown Characteristic [N R] (0000aaa1-0000-1000-8000-aabbccddeeff)
   Client Characteristic Configuration (0x2902)
   Unknown Descriptor (0000aab0-0000-1000-8000-aabbccddeeff)
   Characteristic User Description (0x2901)
   Characteristic Presentation Format (0x2904)
- Unknown Characteristic [I W WNR] (0000aaa2-0000-1000-8000-aabbccddeeff)
   Client Characteristic Configuration (0x2902)
User Data (0x181C)
- First Name [R W] (0x2A8A)
- Last Name [R W] (0x2A90)
- Gender [R W] (0x2A8C)
V	11:24:15.452	Connecting to B8:27:EB:37:2C:0D...
D	11:24:15.454	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D	11:24:16.581	[Server callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I	11:24:16.581	[Server] Device with address B8:27:EB:37:2C:0D connected
D	11:24:16.595	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I	11:24:16.595	Connected to B8:27:EB:37:2C:0D
D	11:24:16.653	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
V	11:24:16.653	Discovering services...
D	11:24:16.653	gatt.discoverServices()
I	11:24:17.017	[Server] MTU changed to 517
I	11:24:17.416	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D	11:24:17.911	[Callback] Services discovered with status: 0
I	11:24:17.911	Services discovered
V	11:24:17.951	Generic Access (0x1800)
- Device Name [R] (0x2A00)
- Appearance [R] (0x2A01)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Device Information (0x180A)
- Manufacturer Name String [R] (0x2A29)
- Model Number String [R] (0x2A24)
Battery Service (0x180F)
- Battery Level [N R] (0x2A19)
   Client Characteristic Configuration (0x2902)
Current Time Service (0x1805)
- Current Time [N R] (0x2A2B)
   Client Characteristic Configuration (0x2902)
- Local Time Information [R] (0x2A0F)
Unknown Service (00000001-1e3c-fad4-74e2-97a033f1bfaa)
- Unknown Characteristic [N R W] (00000002-1e3c-fad4-74e2-97a033f1bfaa)
   Client Characteristic Configuration (0x2902)
   Characteristic User Description (0x2901)
Unknown Service (00000001-1e3d-fad4-74e2-97a033f1bfee)
- Unknown Characteristic [R] (00000002-1e3d-fad4-74e2-97a033f1bfee)
   Characteristic User Description (0x2901)
Unknown Service (0000b001-1e3d-fad4-74e2-97a033f1bfee)
- Unknown Characteristic [R] (0000b002-1e3d-fad4-74e2-97a033f1bfee)
   Characteristic User Description (0x2901)
- Unknown Characteristic [R] (0000b003-1e3d-fad4-74e2-97a033f1bfee)
   Characteristic User Description (0x2901)
D	11:24:17.952	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D	11:24:17.956	gatt.setCharacteristicNotification(00002a19-0000-1000-8000-00805f9b34fb, true)
D	11:24:17.959	gatt.setCharacteristicNotification(00002a2b-0000-1000-8000-00805f9b34fb, true)
D	11:24:17.962	gatt.setCharacteristicNotification(00000002-1e3c-fad4-74e2-97a033f1bfaa, true)
I	11:24:17.995	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
V	11:24:31.105	Enabling notifications for 00000002-1e3c-fad4-74e2-97a033f1bfaa
D	11:24:31.105	gatt.setCharacteristicNotification(00000002-1e3c-fad4-74e2-97a033f1bfaa, true)
D	11:24:31.107	gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
I	11:24:31.207	Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A	11:24:31.207	"Notifications enabled" sent
V	11:24:31.224	Notifications enabled for 00000002-1e3c-fad4-74e2-97a033f1bfaa
V	11:24:33.845	Disabling notifications for 00000002-1e3c-fad4-74e2-97a033f1bfaa
D	11:24:33.845	gatt.setCharacteristicNotification(00000002-1e3c-fad4-74e2-97a033f1bfaa, false)
D	11:24:33.847	gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0000)
I	11:24:33.935	Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 00-00
A	11:24:33.935	"Notifications and indications disabled" sent
V	11:24:33.953	Notifications and indications disabled for 00000002-1e3c-fad4-74e2-97a033f1bfaa
V	11:24:49.761	Reading characteristic 00000002-1e3c-fad4-74e2-97a033f1bfaa
D	11:24:49.761	gatt.readCharacteristic(00000002-1e3c-fad4-74e2-97a033f1bfaa)
I	11:24:49.831	Read Response received from 00000002-1e3c-fad4-74e2-97a033f1bfaa, value: (0x) 48-65-6C-6C-6F-2C-20-77-6F-72-6C-64-21, "Hello, world!"
A	11:24:49.831	"(0x) 48-65-6C-6C-6F-2C-20-77-6F-72-6C-64-21, "Hello, world!"" received
V	11:24:55.030	Enabling notifications for 00000002-1e3c-fad4-74e2-97a033f1bfaa
D	11:24:55.030	gatt.setCharacteristicNotification(00000002-1e3c-fad4-74e2-97a033f1bfaa, true)
D	11:24:55.032	gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x0100)
I	11:24:55.092	Data written to descr. 00002902-0000-1000-8000-00805f9b34fb, value: (0x) 01-00
A	11:24:55.092	"Notifications enabled" sent
V	11:24:55.112	Notifications enabled for 00000002-1e3c-fad4-74e2-97a033f1bfaa
V	11:25:10.813	Writing request to characteristic 00000002-1e3c-fad4-74e2-97a033f1bfaa
D	11:25:10.814	gatt.writeCharacteristic(00000002-1e3c-fad4-74e2-97a033f1bfaa, value=0x6A75737420612074657374)
I	11:25:10.891	Notification received from 00000002-1e3c-fad4-74e2-97a033f1bfaa, value: (0x) 6A-75-73-74-20-61-20-74-65-73-74, "just a test"
A	11:25:10.891	"(0x) 6A-75-73-74-20-61-20-74-65-73-74, "just a test"" received
E	11:25:15.861	Error 14 (0xe): GATT ERR UNLIKELY
V	11:25:22.535	[Server] Cancelling server connection...
D	11:25:22.535	server.cancelConnection(device)
V	11:25:22.562	Disconnecting...
D	11:25:22.562	gatt.disconnect()
D	11:25:22.565	[Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
I	11:25:22.592	Disconnected
D	11:25:22.610	gatt.close()
D	11:25:22.651	wait(200)

Please, let me know if I missed something important during the compilation process.
Thanks.

@mikaku mikaku changed the title getting 'Error 14 (0xe): GATT ERR UNLIKELY' after every notification 'Error 14 (0xe): GATT ERR UNLIKELY' after every notification Oct 18, 2018
@nettlep
Copy link
Owner

nettlep commented Nov 16, 2018

Sorry for the late response (thanks for the reminder in #10.) When this issue was originally opened, I spent about an hour on this issue, but got interrupted and apparently forgot to return to this issue.

I struggled with this same error when the project was in active development. Google searches didn't turn up anything useful. I did solve it back in the day (this was a year ago) but I don't exactly remember how. I poured through my git logs and code looking for a hint and may have found it:

The unlikely error message disappears from the todo.txt after a bugfix in the iOS code that was inadvertently sending too much data (20 bytes is the limit for a single BLE packet.)

In case this doesn't resolve it for you, here's as much information as I can remember:

  • The error string "Error 14 (0xe): GATT ERR UNLIKELY" is received from the iOS device.
  • For me, the error was sporadic
  • I seem to recall that this error is the iOS catch-all for BLE errors. So even if I'm right about how I fixed it in my case, you may be receiving the error for an entirely different reason.
  • At one point, I had modified the GGK code to ignore that error to avoid the disconnect and it worked fine.
  • I have a vague memory that sending null terminators with strings was causing issues, and had to remove them. This may be a false lead, because I can't remember a reason why BLE would care.

@mikaku
Copy link
Author

mikaku commented Nov 16, 2018

Hey,

Thanks for your response, and glad to see you back around here! 😃

I get this error either in Android and iOS devices. Apparently it doesn't hurt much, I can easily ignore it from the App in the device and all continues working fine. So if this is a generic error which might appear due an obscure reason then it will be hard to find and resolve. I can, indeed, live with it.

What it appears a more critical error is the one I exposed in my comment in #10: ERROR: Unsupported response event type: 0x0011 (Authentication failed event).

This error only appears on iOS devices and on latest Bluez versions (5.49 and 5.50). It's critical because it disconnects the session and makes completely unusable the BLE communication.

Do you have an idea if it can be fixed in your GGK library?

Thanks.

@nettlep
Copy link
Owner

nettlep commented Nov 16, 2018

Authentication/pairing/bonding isn't supported in GGK (I've never messed with it myself.)

So... if you're not intending to do any type of pairing then a good starting point would be to figure out why it is when that wasn't your intention.

Also, I seem to remember something about iOS 9.1 requiring an extra step (or slightly different procedure) to avoid the pairing requirement. Might be a place to start googling?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants