I’ve been helping a customer get 8 Mooshimeters connected through a BLED112 dongle using the Python API through a BLED112. The user found they were only able to connect to 3 Mooshimeters maximum, which seems odd because I know the BLED112 is based around the CC2540 (same chip as the Mooshimeter uses), which can support up to 8 simultaneous connections.
I tracked the issue down to a problem in the BLED112 firmware itself, and have amended that firmware to allow connection to more than 3 BLE devices. I’ve tested with 5 units so far (that’s as many as I have at my desk at the moment) and am successfully aggregating data from all 5 units to a single logfile.
Upgrading BLED112 Firmware
BlueGiga decided to artificially limit the number of simultaneous connections available on the BLED112. Why? I have no idea. But since the BLED112 is just a portable version of their BLE112 development board, it’s quite easy to update the firmware on it.
To follow these instructions, you’ll need:
- Windows 7 or later computer
- The BlueGiga Software Stack
- The default installation settings worked fine for me
Recompiling the Firmware
The goal of this section is to produce a new firmware binary to load onto the BLED112. If you want to skip this section, here is the one I made that will connect to 8 Mooshimeters. Use this as the input file for the next section, “Loading the Firmware to the Dongle”.
- Open C:\Bluegiga\ble-1.6.0-140\example\dkble112\usbcdc\config.xml in a text editor.
- Change the line that reads
1<connections value="3" />
1<connections value="8" />
- Yes, this is the only change. It seems like such an arbitrary restriction it made me slap my forehead.
- Open a command prompt and navigate to C:\Bluegiga\ble-1.6.0-140\example\dkble112\usbcdc
- Rebuild the project with the command “..\..\..\bin\bgbuild.exe project-ble112.bgproj”. The output should look like this:
- That’s it! Your new firmware file is the hex file in the usbcdc directory.
Loading the Firmware to the Dongle
Now that we have a patched firmware image, we need to load it to the BLED112. For this task we will put the dongle into a special bootloader mode, send the new firmware, and reboot the dongle.
- Connect the BLED112 to your computer
- Run ble2gui.exe . In the default installation of the BlueGiga Software Stack, it’s in C:\Bluegiga\ble-1.6.0-140\bin
- Select the correct COM port from the dropdown (A) and click the “attach/detach” button (B). The badge to the right of the button should turn green and say “Connected”
- Select “Commands->DFU”
- In the new DFU window, click “Boot Into DFU Mode”.
This will reboot the dongle into a special mode where it can receive firmware. It will enumerate to your PC as a different kind of device (not a COM port). You can check to make sure the DFU reboot has been successful by opening the device manager and looking for “BlueGiga Bluetooth Low Energy DFU”
- Select the firmware image to load on to the dongle by pressing the “Browse” button. If you built your own following the section above with default settings, the image will be at C:\Bluegiga\ble-1.6.0-140\example\dkble112\usbcdc\out-ble112.hex. If you downloaded the one I built, unzip the hex file and put it somewhere accessible.
- Press the “Upload” button. If successful, your window should look like this:
- You’re finished! Enjoy your newly enhanced BLED112.