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!

  • Thanks, I am able to connect to 2 devices now. However, I am currently trying to connect with STM's sensorTile.box pro which does not advertise a service over BLE (can connect over BLE with phone through the nRF connect app). Is there another way to connect to a device through BLE (e.g. MAC address)?

  • With this app, you can see what CIQ can see from a real device: https://apps.garmin.com/apps/9bcc8b66-8385-4afb-b93e-f69e01422284

    Things like UUID and name aren't always available, but if you see the name, you can check for that instead of UUID,

    You can't see the MAC address for what you see in a scan, but with hasAddress, you can check against one your app knows.

  • Thanks a lot for your response and help! I am using the name to pair as you recommend, but after it goes within onConnectedStateChange, where I successfully find the characteristic and do the following within onConnectedStateChange:

    var cccd = char.getDescriptor(BluetoothLowEnergy.cccdUuid());

    if (cccd != null) {
    cccd.requestWrite([0x01, 0x00]b);
    }

    it never goes within 
    onCharacteristicChanged. Instead it briefly connects and then disconnects and goes back to scanning. Would you have any suggestions on how to fix this? Thanks again! Conversely, using the nRF connect phone app, I am able to continuously receive data from a characteristic with a notify property.

    Also if I want to connect to a device, do I have to register all its characteristics and services even if I am not using them or will it work if I just register the ones I use? 

  • Are you using the characteristic, associated with the services, which is associated with the specific device?  If you are using my code, that only handles one device at a time.

  • Yes I am using the characteristic, associated with a specific service I registered, and I am currently trying to communicate with only 1 device. It is able to find the descriptor of the characteristic it seems, but when I requestWrite(), onCharacteristicChanged() is not triggered. 

  • Not all characteristics support notify.  Do you know the one you are using does?

    Here for example is the definition for the thingy52.  You notice not all support notify. Some are just read, some read/write...

  • Yes, the one I am trying to use only supports Notify (no read, write)

  • With my pi based sensors, the Thingy52, HRM-PRO I use notify, and it works fine in all cases.  One thing I have noticed with some real devices, the BLE range is much smaller than others.  Right now, with the va5 I need to be closer the the sensor that with other devices

  • Thanks for checking! What if you don't register a service/characteristic you're not using? Does it still work?

    I also noticed that, so I have them very close together. 

  • Yes.  In the case of the thingy52, it's got a bunch of services, but I'll register at most 3 of them (that's all that's allowed)