-
Notifications
You must be signed in to change notification settings - Fork 464
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
Getting error on descriptor write status 133 with bonded device #9
Comments
Hi, regarding those errors, you may find some very, very short info here: Error 133, defined as: Regarding the bonding problem, I'd say it depends very much which Android version or which device are you using. You may try to add some delays here and there to give the stack some more time. In the toolbox, in BLEManager, I wait 600ms after I get onConnectionStateChange(..) callback before calling gatt.discoverServices(). Also clearing the device cache usually helps, but it's a hack and should not be used normally. To refresh the cache you have to call gatt.refresh() method using reflections. You'll find it implemented in the DfuBaseService class in the DFU Library, here. Did you try using nRF Toolbox or nRF Master Control Panel apps to connect to your service after you bond? Do you get similar results? |
just tried the nrf toolbox app with the bonded device, got the exact same problem. i added a 2 second delay after connecting gatt before doing anything and now it works. |
ok, was wrong, the delay did not fix it. |
this usually doesnt happen when i initiate the disconnection from the device myself. any suggestions? |
some more details, if i only save the ble device address and connect using bluetoothAdapter.getRemoteDevice(address) then i never have this problem. |
Without bonding reconnecting is much more stable and reliable. Even if you get 133 you may repeat it and usually it works. But in come cases you must have bond (for example if you have secure informations, proximity etc.). Then you have a problem... :( |
I now face a situation on the following: the premise is that I will be connected with the equipment are stored locally, when off the device on automatic connection device, but now the callback connection for a long time, about 35S,I get the error 133, any good solution can shorten the feedback time and solution this 133 problem |
In this case the 133 means that the device is not reachable. It doesn't advertise or is out of range. Also, I think you can't just connect to a device that you created in the code with the Mac address, you have to scan for it, or obtain from Bluetooth Adapter if it's bonded. This code may not work: BluetoothDevice d = new BluetoothDevice("AA:33:66:44:66:77");
d.connectGatt(...); |
Regarding my previous comment. The code snippet will work in 2 conditions:
Explanation: |
I know the issue may be closed but I have the same issue. I did not find any good solution. My issue only happen in some device such as Samsung Note 3. My error code is
To solve that error, I used a delay before calling the
It can solve my issue. However, I do not think the Thread.sleep is a good solution because delay time (500ms) may be different among devices. In additions, the above error only happens on some device. It worked well with other devices. In BLE, do we have any callback function which can safely call the This is my
|
For me writing my own onDescriptorWriteRequest solved the issue. Specially adding mGattServer.sendResponse
|
Hello thejeshgn, which issue did you solve? Status=133 or status=22 as my issue |
Issue of status=133 or status=2 while trying to write descriptor.
|
Any update on error 133? I am getting the same thing on Android 7.1.2. |
When you have too many connections opened, a 133 error can occur. Make sure you have closed all GattClient. I have a device that triggers quite often a 133 even if all connections are closed, my solution is to restart the connection process. |
In the process of upgrade,some mobile phone can be upgraded successfully, such as XIAOMI 4S, |
The error in my case was due to the encryption issue in the Bluetooth LE stack. Was getting the error btif_gatt_set_encryption_cb() - Encryption failed (1). Any idea about this error? |
@thejeshgn onDescriptorWriteRequest is for an Android Gatt Server. Here the problem is for Android Gatt client. The client does not have any onDescriptorWriteRequest method to override. |
Hi guys, As @philips77 mentioned the error 133 is a common BLE error and its not just only android error.
|
when i open first time ble then it connect perfectly but after disable and i am trying to cnnect again then it showing error 133 error.plz help |
I had a problem which sounds similar (bonding information lost on second connection, only on one device) reported here: I attributed it to both peripheral and central initiating encryption at the same time, and describe a couple of work-arounds. But I suspect there is more to it than this. |
I am getting same error "error on writing descriptor (133)" when I connect the device (esp32 as server) to an android phone only when I try to read Temperature values while on Iphone works just fine ,can't find the reason why |
The only descriptor that nRF Toolbox for Android reads is for the Service Changed characteristic. On bonded devices it ensures that SC indications are enabled. iOS API doesn't allow to read CCC descriptors, so we don't do this on iOS. iOS also deals with the SC indications correctly, so there's no need for any workarounds. |
I'm trying to update it DfuBaseService: Connection state change error: 133 newState: 0 and Device not reachable. Check if the device with address D3:EF:0F:0F:EB:27 is in range, is advertising and is connectable |
hey,
i'm getting some weird behavior with enabling notifications.
i'm developing an app that needs to connect to a ble peripheral automatically, i scan, find the device then bond with - device.createBond().
then i enable notifications from the device on the rx characteristic for the uart service.
this works fine for the first time, but when i use the bonded device to do the same the second time i get
a callback to descriptor write with status 133 sometimes followed by a connection state change callback with state 0 and status 22.
i could not find any info online for what status 133 or 22 mean.
any idea why this is happening? removing the bond makes it work again, but again, only for the first time, i cant complete the flow from a bonded device
The text was updated successfully, but these errors were encountered: