GATT 133 connection error with nimple_gatt example

Hi all

I get a EBYTE E105-BT5010a-TB and I’m using it to study RIOT-OS.

I’m building nimple_gatt example with:

make BOARD=e104-bt5010a-tb examples/nimple_scanner

It builds, loads and starts fine. Using a Mi6 Android phone ( Android version 9 ) and nRF_Connact app I’m able to get the “NimBLE on RIOT” in my list. But as I try to connect I get GATT ERR 133.

Adding a little bit of printf in the example code I can see gap_event_cb called twice: BLE_GAP_EVENT_CONNECT at first and a DISCONNECT immediately after that.

At this point I’m a little bit stuck as I have not a clear idea about how to debug this problem from here. For example, I’m not able to activate or generally speaking how to use BLE_HS_LOG. I have the phone side nRf_Connect log but it does not say so match.

Any suggestions?

Thanks in advance for any possible support and for the amazing work made here

Michele

Apparently that is an error you get when the device is out of range. I haven’t tried nimble_scanner yet. I am not sure, if you are supposed to be able to connect to it. I don’t see anything implemented in the scanner to handle connects to the device. Or did you add something to the example? If you want to tinker with NimBLE in an easy way, I highly recommend to use the IPv6 over BLE stack. It’s quite easy to connect your linux machine to your MCU and interact with it. The IPv6 stack is also quite easy to use.

If you want to go the IPv6 over BLE route: Take gnrc_networking and flash it to your MCU. It should take NimBLE, since it is the only available stack. On the MCUs shell, you just need to use ble adv and you can connect from Linux to it. There is a tutorial for it: https://github.com/RIOT-OS/RIOT/blob/master/pkg/nimble/README.ipv6-over-ble.md

Many thanks about the ipv6 suggestion, I know about that example and I’ll give it a try soon. What about BLE_HS_LOG macros used in NimBLE: is it possible to activate them as building the Nimble from a RIOT-OS example? How to do that?

Hi @michelepagot and @citrullin, has this issue been solved, since I met the same issue when utilizing NimBLE on RIOT?

This GATT 133 connection error first happened between my “feather nrf52840 sense” board and my Android phone. The applications used are RIOT “nimble_heart_rate_sensor” on the feather board and “nRF Connect” on Android. By checking the error code table, it basically suggests a connection timeout.

To make sure it is not an issue of Android (Since some complaints can be seen online about Android BLE already.), I further developed two applications using NimBLE on RIOT, based on “central” and “peripheral” applications from GitHub mynewt-nimble project. They were flashed to two feather boards respectively. However, again, the connection cannot be continued due to connection timeout. This time, the NimBLE offers an error code of 520 (decimal), i.e., 0x0208 (hex), which suggests connection timeout. Surprisingly, the peripheral board this time can be connected to my Android phone sometimes without an error or connection loss. But still, the GATT 133 connection error occurs from time to time.

If possible, I would like some help with this case. Are there any explanations for it? What can I do to avoid it on my two feather-nrf52840-sense boards?

Thanks in advance for any possible reply and help.