Cannot scan for devices over BLE using Garmin simulator + nRF52840 DK and the sample NordicThingy52 app

Hello, I am using an nrf52840 DK and trying to interface with the Garmin simulator to scan for devices over BLE. I am using the sample NordicThingy52 app and onScanResults() seems to never get triggered (added a print statement but never printed). I followed the instructions here: https://forums.garmin.com/developer/connect-iq/w/wiki/19/getting-started-with-connect-iq-ble-development and do not get an error when setting the COM port that the dev kit is connected to in BLE settings. I am using mac OS 14. 

Would anyone have any suggestions? Thanks in advance!

  • Sounds great, thanks! Not sure what is wrong then. It just keeps going back and forth between scanning and onConnectedChange. Would there be an intermediate step that is not allowing me to keep the connection/receive messages?

  • It could be your sensor requires a more advanced BLE implementation than Garmin provides.  There are changes in the works, as with the 7.0.x bonding looks like it has been added, though I've not tried it.

    "API 5.0.0 devices can also pair with BLE devices using Just Works pairing. The system will remember the bonded devices and allow you to reconnect with devices you have previously bonded with."

  • Thanks, trying that now. Also, through the nRF connect app I see that the UUID of the configuration characteristic that enables/disables notifying state of the characteristic is 2902. How would I implement that?

  • //Using 16 bit UUIDs
    //Ref. the Bluetooth Core Specification 5.2, Vol 3, Part B, section 2.5.1 UUID:
    
    //The first UUID in this pre-allocated range is known as the
    //Bluetooth Base UUID and has the value 00000000-0000-1000-8000-00805F9B34FB
    
    //(...)
    
    //The full 128-bit value of a 16-bit or 32-bit UUID may be computed by a simple
    //arithmetic operation.
    
    //128_bit_value = 16_bit_value * 2^96 + Bluetooth_Base_UUID
    
    
    //128_bit_value = 32_bit_value * 2^96 + Bluetooth_Base_UUID"
    
    //What it means in practice, is that you take a "base UUID" of 0000xxxx-0000-1000-8000-00805F9B34FB, 
    //and replace the x-es with the 16 bit UUID.

    So for example, with the HRM-PRO I use:

        var HR_SERVICE = Ble.longToUuid(0x0000180D00001000L, 0x800000805F9B34FBL);
        var HR_CHAR    = Ble.longToUuid(0x00002a3700001000L, 0x800000805F9B34FBL);    
  • Thanks a lot, hasn't worked yet but will keep trying. Also to trigger onCharacteristicWrite() how do you call the requestWrite() command?

  • Haven't figured out what the procedure is to write to a characteristic

  • Look ate the code I posted that uses a raspberry pi  CommQueue.mc.

  • Thanks a lot for the help, I am able to read and write to an Arduino. However, I am currently trying to read data from the STM's Sensortile box pro. I am able to connect to the device but I cannot read and it disconnects. Would it be possible to get your help? The code used for the sensor tile box pro is open source and it is possible/I have been trying to change the BLE driver/implementation but not sure how to do it correctly.

    These are the serial print outs when trying to connect with the Garmin simulator:

    >>>>>>CONNECTED d7:1:c0:c3:c3:93

    hci_le_advertising_set_terminated_event

    hci_le_channel_selection_algorithm_event

    aci_gatt_clt_proc_complete_event Ok

    <<<<<<DISCONNECTED

    aci_gap_set_advertising_configuration

    aci_gap_set_advertising_data_nwk

    aci_gap_set_advertising_enable


    and this is what I get for a successful connection with the phone (nRF connect app):

    >>>>>>CONNECTED 6d:5d:c0:7a:2e:ce

    hci_le_advertising_set_terminated_event

    hci_le_channel_selection_algorithm_event

    Error: ACI GATT Exchange Config Failed (0x85)

    hci_le_phy_update_complete_event Status=0x0

    TX_PHY=0x2

    RX_PHY=0x2

    aci_gatt_clt_proc_complete_event Ok

    Notification on Service Change Characteristic

    UUID Rescan Forced

    aci_gatt_srv_confirmation_event

    Start Iner@10Hz

  • I cannot trigger onCharacterisitcChanged even though I call  cccd.requestWrite([0x01,0x00]b); The characteristic is recognized (not null)