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

What is the passkey for gls example, where is it set

What is the passkey for gls example, and where is it set

I am using SDK13, 10040 nrf52832 s132

Any help appreciated

Parents
  • Hi,

    From the Glucose Application documentation:

    A passkey must be entered at the central to complete the bonding and ensure MITM protection. The Glucose Application will present the passkey during bonding. It is sent on the UART. It is therefore important that UART is set up correctly on the receiving side.

    The passkey is generated randomly by the softdevice and sent over UART. You will have to check the terminal for the passkey on each bonding procedure. In the example, the passkey is sent over UART on receiption of a BLE_GAP_EVT_PASSKEY_DISPLAY event in on_ble_evt() handler. The passkey is available in p_ble_evt->evt.gap_evt.params.passkey_display.passkey.

    Best regards,

    Jørgen

  • I have the exact same problem, and I've been thru the documentation a dozen times or more. i am attempting to connect to the examples GLS app running on the 10040 dev kit, using nRF Connect via a second 10040 dev kit. I am monitoring the serial ports on both, set as the documentation calls out at 115.2 KBPS, 8,n,1, and nothing ever comes out of either serial port, although nRF Connect requests the passkey. Apparently from looking at the code it is to be 6 characters long, but the daisy-chain to actually see how it's selected is horrendously long and convoluted. I must be missing something simple - how can I get that passkey, or alternatively, disable the need for it?

Reply
  • I have the exact same problem, and I've been thru the documentation a dozen times or more. i am attempting to connect to the examples GLS app running on the 10040 dev kit, using nRF Connect via a second 10040 dev kit. I am monitoring the serial ports on both, set as the documentation calls out at 115.2 KBPS, 8,n,1, and nothing ever comes out of either serial port, although nRF Connect requests the passkey. Apparently from looking at the code it is to be 6 characters long, but the daisy-chain to actually see how it's selected is horrendously long and convoluted. I must be missing something simple - how can I get that passkey, or alternatively, disable the need for it?

Children
  • I don't know about SDK13, but I tried the GLS in SDK12 just a few weeks ago with the PCA10040 and it worked right out of the box. How did you "monitor" the serial port? I use the good old putty and could see the 6 digit passkey (and other debug messages too) fine. I use Win 7 as my development environment. As for the code where the passkey is sent to the serial port, try to look for BLE_GAP_EVT_PASSKEY_DISPLAY in the main.c. And if you want to disable the passkey then try

    #define SEC_PARAM_MITM 0 //<-- I guess this may work but I never try it myself...

    in the main.c also.

  • I tested this on SDK v13.0.0 as well, and it works as described. Are you able to see output on UART from other examples? Have you tried with a freshly extracted SDK, to make sure you have not changed anything?

  • Does the GLS example use the same pin for the serial port as the other examples, such that the SDK will see it as a USB serial port? I use "good older" Hyperterminal to monitor the serial port, and it worked just fine with printf in the other demos as well as my own code. I'm on Win7, which doesn't come with HT any more, but I have copied HT from earlier versions and it works fine, once you get past a couple of startup glitches.

  • Disabling MITM protection per the define above does not work - there's no longer any visible connection attempt.

    After many trials of many different things, suddenly the serial port began to work. If there's anything worse that something that stops working for no reason, it's got to be something that starts working for no reason! And I was able to see and enter a passkey, which apparently worked. After that, nothing. I need to now dig into the docs as I've gotten past the full-top issue. But I see the following sequence. Is the error message about adjusting RAM boundaries a real issue, and if so, how do I go about making that adjustment? Some linker script somewhere, perhaps?

Related