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

Windows 10, Thingy 52 BLE

I'm attempting to write a plugin/dll to pull data from the Nordic Thingy52. I can scan all devices that are paired with windows 10, and load up the services, etc.

I can also read from descriptors that have explicit Read permissions. However, when I attempt to set a characteristic (such as motion data) to notify, or write to a service configuration characteristic, It instantly disconnects.

I loaded up the Thingy Firmware as a debug build from the github repo, and logged the data thingy_log.txt

It appears to reboot 20+ times. Int he Jlink RTT Viewer I would sometimes see drv_ext_gpio.c line 466 error (in Keil it's a blank line) (correction: line 446)

err_code = drv_sx1509_data_modify((1UL << pin_number), 0);
RETURN_IF_ERROR_EXT_GPIO_CLOSE(err_code);

Is there a sequence to connecting to the Thingy that's done in android/iOS apps that I'm missing here?

Edit: I am Currently connecting by getting the Config service, then getting motion, sound, and UI services (I don't need the rest) from the DeviceInfo on windows.

I am then attempting to write characteristic values for motion config, etc. But nothing stays connected. Do I need to be doing some sort of MTU request?

  • Hi jublin,

    Just did a test on a Microsoft Surface 2 with Windows 10 version 1703 (Creators update). I used the Bluetooth LE Explorer app which was downloaded from the Windows Store.

    With the app I was able to connect to Thingy:52 and read the GATT profile. In addition I was able to:

    1. Read and write device name with the device name characteristic (EF680101-9B35-4933-9B10-52FFA9740042)
    2. Start notifications for the temperature characteristic (EF680201-9B35-4933-9B10-52FFA9740042)
    3. Read and write Eddystone URL with the Eddystone URL characteristic (EF680105-9B35-4933-9B10-52FFA9740042)
    4. Start notifications for the Euler characteristic (EF680407-9B35-4933-9B10-52FFA9740042)

    Could you try to recreate these steps? Also make sure your Windows 10 version is updated since Microsoft has made several recent improvements to their BLE drivers and APIs.

    If you manage to get it working with the Bluetooth LE Explorer app you might want to take a look at the source code for tips on how to write your plugin/dll. I also recommend these videos introducing BLE for Windows developers.

    Also, there is no need to do an MTU request unless you are using the speaker or microphone on Thingy:52. The reason for this is to get an adequate throughput.

    Ketil

  • So this doesn't work either.

    Running BLE Explorer on Windows Version 1709 (fall 2017 update), I still get device unreachable on trying to connect, and the Thingy LED's appear to flash a bright blue/white before going back into advertising mode. I can't even list all the characteristics.

    This is a little funny, because I essentially had the same issue with TI sensortag on version 1703, where it wouldn't ever write out (but the device wouldn't reset).

    edit: unpaired from system and tried again, and it connects.

    I can get notifications, but I cannot write to the motion config characteristic still.

  • So, I think i've narrowed down the problem, but have no idea how to fix it.

    I'm using this nuget package: github.com/.../README.md

    Which stops at Anniversary update prior to Spring Creators update. Spring update added pairing-free ble device enumeration and connection. If I have the device previously paired (which I have been doing for multiple other devices), it will fail to connect and show the device as unreachable. If I pair the device and leave the settings window open (Thingy thinks it's connected), Bluetooth LE will Let me connect. If I turn the device off/on, it will be unreachable.

    In my windows application, If I pair and leave the window open, I can write the notify out and such, but the valuechanged for whichever characteristic is never hit.

    Any ideas on that?

  • If I understand you correctly you are now able to connect to your Thingy:52 from the Bluetooth LE Explorer app. You are also able to list the complete GATT Profile and start notifications.

    Please try this: Write a new name (10 bytes or less) to the device name characteristic with UTF-8 as the format, using the Bluetooth LE Explorer app. Does it show the new name when you go back to the GATT overview?

    The reason I ask you to change the device name rather than the motion config characteristic is just to make it simple to verify if write operations work properly. The motion config characteristic is a bit more involved and if you try to write an invalid value it will not work and I am unsure if the Bluetooth LE Explorer app will let you know if it failed and why. See the list of Thingy:52 GATT Services and Characteristics for details.

  • I am unable to provide any help regarding the nuget package although I agree that it might be out of date.

Related