Parts needed


BLED112 Dongle







I am trying to start writing down the solutions i come across to annoying problems. My latest one, was trying to communicate to a NRF51 from windows 7. I  had always wanted to learn to use python,  so thought this would be a good stepping stone into the language, but i was wrong.  After two full 15 hour days, uninstalling, installing, and reinstalling all manner of things needed for Python to get bluetooth to work, i gave up. It wasn’t so much a python problem, but more of a Windows 7 being a pain in the backside when it comes to running BLE stacks.

A few years ago when i was developing MiniWear, i came across another way of getting BLE working on Windows 7, so decided to go back to that. It uses the BLED112 dongle, which has its own built in BLE stack, which was the exact problem i was having before. I manged to get some basic code running in C (a blog describing the setup process can be found here), but then thought that the same could be done in Python, so i did a quick search and there was python lib called BGlib . After a few quick tweaks to the example code, i could scan for BLE devices.

I had been having compatibility issues with some python modules, so i ended having an installation of python 3.4, which was from 2014. I installed the latest pyserial from, then tried the BGlib example code, and it had a few problems… 1) it didn’t like the xrange function, so i updated that to the range function, and then it complained about “TypeError: ‘float’ object cannot be interpreted as an integer”, and after quick google search i changed the / operator to // which works for ints in python. After that everything was working, so i wanted to share the code in case it helps someone.

I am not developing this code further at the moment,  as i don’t understand python nearly well enough, and it would take me a little too long to get upto speed.

On the NRF51 side, i was using the NRF51-Dk with SDK 12.3.0 using s130 softdevice’s (version2) and running the ble_app_hrs example code.


Python Code

Output from running the code