This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android: GATT_INSUFFICIENT_AUTHENTICATION

Hi,

I'm trying to get a modified version of the serial "NUS" service to work encrypted with Android 4.4 (API 19). Everything works fine on iOS, but with Android I get ofter GATT_INSUFFICIENT_AUTHENTICATION error when enabling TX notification. I works maybe 1/3 of time without error so I'm wondering where this issues comes from.

I've enabled bonding with createBond call on android side, it makes no difference.

Any idea why this happens?

  • @Henris42: it's pretty usual to receive GATT_INSUFFICIENT_AUTHENTICATION when you try to read or write to a characteristic with encryption required. When receiving that error, the OS will automatically try to bond to the device. After it's get bondded you would need to do the write/read command again and it should work.

    I am suspecting that the 2/3 of the time you didn't see this error was because the device is already bonded.

    If you use create bond, you still need to make sure the bonding process is finish, and you have the device bonded, before you do a read/write on encrypted characteristic.

Related