How to get the BLED112 to connect to 8 devices


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:

  1. BLED112
  2. Windows 7 or later computer
  3. The BlueGiga Software Stack
    1. 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”.

  1. Open C:\Bluegiga\ble-1.6.0-140\example\dkble112\usbcdc\config.xml in a text editor.
  2. Change the line that reads
    <connections value="3" />

    to read

    <connections value="8" />
    1. Yes, this is the only change.  It seems like such an arbitrary restriction it made me slap my forehead.
  3. Open a command prompt and navigate to C:\Bluegiga\ble-1.6.0-140\example\dkble112\usbcdc
  4. Rebuild the project with the command “..\..\..\bin\bgbuild.exe project-ble112.bgproj”.  The output should look like this:

  5. 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.

  1. Connect the BLED112 to your computer
  2.  Run ble2gui.exe .  In the default installation of the BlueGiga Software Stack, it’s in C:\Bluegiga\ble-1.6.0-140\bin
  3. 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”

  4. Select “Commands->DFU”

  5. 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”

  6. 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.
  7. Press the “Upload” button.  If successful, your window should look like this:

  8. You’re finished!  Enjoy your newly enhanced BLED112.

4 Responses to “How to get the BLED112 to connect to 8 devices”

  1. sheikh September 8, 2020 at 4:12 am #

    very informative and well explained.
    Can you do a tutorial for bleuIO . here is the product

  2. Phermanspmc September 9, 2020 at 6:07 am #

    This is incredibly helpful, thanks so much for the post!
    The directory path in Recompiling the Firmware step 4 text is missing the “bin” sub-directory, shown in your figure.

    • James October 13, 2020 at 11:22 am #

      Good catch, thanks!

  3. Peter February 19, 2021 at 11:34 pm #

    I wanted to publicly and effusively thank James for his product and explanations for the way to talk to the Mooshimeter via Python on a PC. We at the National Renewable Energy Laboratory, Golden, Colorado are the customers who asked for his help for this. We apply high voltage (500 V to 1200 V, typically) to photovoltaic modules and want to measure the associated sourcing current over a voltage divider. Choosing resistors appropriately, the current we calculate by measuring voltage drop over one of the resistors is in the range of 1 x 10^-5 A to 1 x 10 ^-10 A.

    The Mooshimeter has been valuable as a low cost, electrically isolated voltage sense meter. Regular DMMs have common mode maximum voltage (between test leads and ground) in the hundreds of volts, but we needed to measure small voltage signals between the test leads at levels greater than 1000 V from ground. Sure, you can get optically isolated sensors, but they are only good for about 2 to 3 orders of magnitude resolution in voltage measurements. The DMM capability here with the Mooshimeter 24-bit resolution gets around 6 orders of magnitude for voltage measurements. Electrical isolation is achieved with the Bluetooth data transfer to the PC eliminating any wires between these and we use isolated power supplies providing 3 VDC for the Mooshimeters instead of the AA batteries to allow power for the long-term measurements.

    Please check out our paper “Advancing reliability assessments of photovoltaic modules and materials using combined-accelerated stress testing” in which the eight Mooshimeters are used in the subsystem that measures the leakage current in the photovoltaic module packaging. This is part of a larger system that evaluates the photovoltaic module reliability called “Combined-accelerated stress testing,” or C-AST.

    They are referred to as the electrically isolated digital multimeters (DMM) on page 4. I wish we had specifically called out the Mooshimeters there; however, we can do that in a future paper.

Leave a Reply