Constantly getting BLE_GAP_EVT_DISCONNECTED although BLE traffic correct

I am working on a BLE to ANT (Specifically FTMP to FE-C) gateway.

HW used is the pca10059 dongle.

Windows10, Programmer 3.0.4, Segger 5.42a.

SW is nRF5_SDK_17.1.0_ddde560

Softdevice ANT_s340_nrf52840_6.1.1.

ANT part works and BLE part sort of works also but I cannot figure out why I am getting BLE_GAP_EVT_DISCONNECTED(GATT_CONN_LMP_TIMEOUT) every about 40s.

Being a newbie on BLE, I decided to start from the ble_hrs_c example and adapt it (also taking inspiration from ble_lbs_c. 

I registered a new UUID for the FTMP (0x1826) successfully.

I manage to connect to the FTMP trainer, which grants me a total of 10 services (had to increase the max # of services to 10 to get them all).

I save the cccd handles of my needed services and use them to request the bike to start transmitting data (does not work for some reason but not the issue of the ticket) and to get notifications from the bike data.

(I can get the nRF Connect app to get the bike to start transmitting data, it seems to remember the state)

All is well, the data appears and is converted to ANT and shows up on mt garmin watch.

BUT! For unknown reasons I keep getting this GATT_CONN_LMP_TIMEOUT every 40s, lose connection to the trainer and need to start over. It reconnects and loses connection 40s later.

If I do not use the cccd handles to request notification nor try to start the trainer via the not working service, I get the exact same behaviour so I guess it probably has nothing to do with them?

I am a bit blind and only have the LED outputs to lead my troubleshooting efforts (and sending debug data over ANT) since I haven't managed to get the log info to the USB port.

Any suggestions what might be causing the timeouts?

Thanks for any advice

/Ola

Parents Reply Children
  • Ok great. In order to understand fully what is going on before attempting to debug further, I borrowed a 52840DK at work and decided to start up the nRF sniffer on it.

    Unfortunately, I can not get the sniffer to work. It cannot connect to my board although having flashed the sniffer hex file and seeing LED1 blink (supposedly when it receives BLE packages) so I think it is flashed ok.

    However, neither the programmer nor nRF Go is able to program it, but segger seems to succeed.

    In my attempts to understand why, I checked the device manager and disovered that there are 2 Jlink CDC UART ports. I stubled across another ticket with another person having the same problem, so I left a note there about my same problem.

    Also tried to connect with putty but no connection is made on either port.

    What to do?

    I guess I could try the same thing on my 52840 Dongle but am afraid that the sniffer hex file will overwrite the mbr, rendering the dongle useless unless I connect the DK debugger to it, which I prefer not to do.

    What to try next?

    Thanks

  • Blinking leds is a good sign yes.

    Then it's something with the software on the PC, make sure you have installed the software mentioned in the user guide, also try a restart and close down other application that may be using the USB or com port. Try a different USB port also if possible. There is also a troubleshooting guide in the user guide.

    Overall using wireshark to sniff communication should be straight forward if you follow the user guide. Hopefully you will be able to make this work soon.

    Kenneth

  • Yes, I did find the troubleshooting guide but it does not handle this specific problem.

    I actually already tried this on two different windows machines with the exact same behaviour.

    I also tried updating to latest driver packages from Segger, no difference.

    When in device manager, and no applications running, I see two UART ports and as soon as I remove the DK, both disappear. Reconnecting it immediately shows both ports again so I don't think it has anything to do with the actual applications.

    Also, when testing the external interfaces for wireshark according to another guide I found online (How to install BLE Sniffer on nRF52840 Dongle and run it – JimmyIoT (jimmywongiot.com), two interfaces are indicated as opposed to the one expected.

    Only thing I can think of is to try this on linux instead, but if the DK itself is causing the dual ports, I fear I will get the same problem there.

    Thanks

  • Forgot to say that restarting the computers made no difference also.

    Notably, both computers succeed in programming and debugging using Segger Embedded, but none can program using the nRF tool Programmer nor rfGo. I never get the possibility to Write although having erased all many times.

Related