NordicThingy 52 sample - BLE possibly not working?

Good day everyone.

I'm trying to start ConnectIQ development with the NRF dongle and BLE API.

I'm trying to check if BLE scanning is working with the CoinCollector sample, but I fail to get any scan results. 

Here scanning starts, the print is also logged in the debugger:

onScanResults should be called when it has found BLE devices:

However I'm not getting anything logged in the debugger, which probably means I'm not getting any scan results..?

I believe flashing the NRF dongle went fine, COM port also seems correct:

Any ideas? Thanks a lot!

  • Start with the NordicThingy52CoinColector sample and change nothing but adding this to the "contains" function in ThingyDelegate.mc and run it.

    if you don't have a Thing52 that's awake, you'll see no scan results otherwise.

    You'll see all the scan results for everything with this.

        private function contains(iter as Iterator, obj as Uuid) as Boolean {
            for (var uuid = iter.next(); uuid != null; uuid = iter.next()) {
    //add next line
    System.println("found="+uuid.toString());        
                if (uuid.equals(obj)) {
                    return true;
                }
            }
    
            return false;
        }

    After you flashed the nRF52840, did you unplug it/plug it back in so the new code gets loaded?

  • You can also try this to make sure that CIQ can see whatever sensor you are using:

    https://apps.garmin.com/en-US/apps/9bcc8b66-8385-4afb-b93e-f69e01422284

  • Hey Jim. I could change the contains function and will try that later today, however before that function is called I already have a printline statement in the onScanResult (see the screenshot in the original post). I believe the onScanResults function isn't even called as that line is not printed in the console?

  • Try re-flashing the dongle and after you do so, unplug the dongle and plug it back in, and check the com port hasn't changed.

    to make sure the sim is seeing the dongle to another com port in the sim's ble settings.  You should get an error.  Then change back to the real com port and there should be no error.  The only time this is checked is when you change the com port, and not each time the sim is started.  Otherwise, you get this error if you have the dongle unplugged and you start the sim to run any other app.

  • I just tried to re-flash and there might be an issue. The 2nd time after the USB detach-attach sound sounds an error appears.

    2022-10-20T13:46:09.429Z ERROR Failed to write: Error: Timeout while waiting for device  FDC58935D2DA to be attached and enumerated

    Is this incorrect? 

    Here is the full error log: https://pastebin.com/k5ufMiwk

    I didn't get an error after changing com ports without modifying it in the Simulator settings either. Once I did modify the com port the program no longer runs as I get "Failed to launch the app: Timeout"

    I also can't seem to erase the flash: 

    EDIT: just managed to change COM port to the correct one again and getting an error 

  • You are using nRDConnect for Desktop, correct?  Windows or mac? Updating to 3.12.0 on win 11 right now.  (It's been a few years since I flashed) and updating the programmer to 3.0.4

    The dongle I'm using was already flashed, but here is what I see:

    When I drag in the hex file, this:

    After flashing, I do see this:

    07:24:12.693
    Failed to write: Error: Timeout while waiting for device FEEDE20D3485 to be attached and enumerated
    So I programed the dongle with the Bluetooth low energy app (using nRF deskop), and verified that it didn't work with CIQ, then programmed the hex file that works with CIQ.  with unplugging and replugging after each step. I moved from com5 to com7, and it's working with com7 in the sim.
    At this point, I'm wondering about your app.  In my case, I'm using one I know works.  Are you still using the SDK samples with nothing but some added println calls?
  • By the way, I don't think you could ever use erase on the dongle, but could on the nRF52 DK.  That's why I loaded another one of the nordic apps, tried it, and then flashed the one for CIQ

  • I'd like to get into BT development. Do I have to buy the NRF52-DK or is it enough to buy the nRF52840-Dongle?

  • Either the dongle or the DK works fine.  Last or looked the dongle was $12US and cheaper than the DK.  You can go to just using sideloads bur for $12, using the sim is much faster and easier to get things working..

  • The dongle arrived. DOwnloaded the software, installed, and I even managed? to program it with the hex file. But when it finishes writing the FW I see this:

    Is this OK?

    I do see this: /dev/tty.usbmodemF72E23A706F41 (I'm on Mac)

    But when I enter either "/dev/tty.usbmodemF72E23A706F41" or "F72E23A706F41" in the simulator's BLE Settings it gives me this error message:

    And when I start any app (that doesn't even use BT) in the sim all I see is a white screen of the watch. When I delete the string or set it to any non existant filename and restart the sim, then it works again (but of course not the BLE)

    Any idea what's the problem?

    UPDATE: I tried it on another (older, intel) Mac, it's very similar behaviour, but not exactly.

    1. when I connect the dongle it can read the memory (IMHO), as it looks a bit different, at least it doesn't have the orange error message. I also wrote the hex file again to the dongle.

    2. When I open any (non BLE) app then it works

    3. When I run NordicThingy52 or NordicThingy52CoinColector then it doesn't start the simuator, because it crashes before anything could run in the sim (after 1 second of white screen). (BTW the same happened when I first ran the same app, wihtout the dongle being connected to the laptop)