Python Library v1.7.4 Released for BleuIO

January 23, 2026
Python Library v1.7.4 Released for BleuIO

We are pleased to announce the release of BleuIO Python library v1.7.4, a stability-focused update that improves logging clarity and, most importantly, significantly enhances how applications recover from unexpected dongle disconnections.

This release is designed to make long-running Python applications more reliable when working with BleuIO dongles in real-world environments.

Compatibility

Python library v1.7.4 is tested and verified with the following firmware versions:

  • BleuIO Standard: v2.7.9.51 or later
  • BleuIO Pro: v1.0.5.6

Note: This library version does not support firmware 2.2.0 or earlier on BleuIO Standard (SSD005).

What’s New in v1.7.4

This release introduces a refinement to the logging system used by the Python library. Previously, many internal messages were logged at the INFO level, which could result in excessive output in production environments. In version 1.7.4, all such messages have been moved to the DEBUG level, except for the firmware version message, which remains at the INFO level. This change provides a cleaner default log output while still allowing developers to access detailed diagnostic information when debug logging is enabled.

Reliable Recovery After Dongle Disconnection

The most significant improvement in Python library v1.7.4 is a fix for an issue related to recovering from lost communication with the BleuIO dongle. In earlier versions, the library could encounter problems if the dongle was unplugged, reset using the ATR command, or disconnected due to a crash or system error. In such cases, applications often required a full restart to regain communication.

This issue has now been resolved. When communication with the dongle is lost, the library raises a clear and consistent exception, BleuIOException: Port to BleuIO is not open. This allows applications to detect the failure immediately and implement recovery logic without terminating the program.

Exception Handling and Reconnection Example

With the improved error handling in this release, developers can catch the exception raised when the port is no longer available and reinitialize the BleuIO object to restore communication. The example below demonstrates how an application can continuously query the dongle, detect a disconnection, and automatically reconnect once the dongle becomes available again.

from bleuio_lib.bleuio_funcs import BleuIO
import time


my_dongle = BleuIO()
dongle_connected = True
while 1:
    try:
        print(my_dongle.ati().Rsp)
        time.sleep(2)
    except Exception as e:
        if "Port to BleuIO is not open!" in str(e):
            print("Error communicating with dongle: ", e)
            dongle_connected = False
            while not dongle_connected:
                try:    
                    my_dongle = BleuIO()
                    dongle_connected = True
                    print("Reconnected to dongle")
                except Exception as e:
                    print("Reconnection failed: ", e)
                    time.sleep(2)
                    pass

Example Output

[{'R': 7, 'dev': 'Smart Sensor Devices', 'hw': 'DA14683 (P25Q80LE)', 'name': 'BleuIO'}, {'R': 7, 'fwVer': '2.7.9.55', 'gap_role': 'dual'}, {'R': 7, 'connected': False, 'advertising': False}]
[{'R': 8, 'dev': 'Smart Sensor Devices', 'hw': 'DA14683 (P25Q80LE)', 'name': 'BleuIO'}, {'R': 8, 'fwVer': '2.7.9.55', 'gap_role': 'dual'}, {'R': 8, 'connected': False, 'advertising': False}]
Error processing serial data: ClearCommError failed (OSError(22, 'The I/O operation has been aborted because of either a thread exit or an application request.', None, 995))   <------------- When I pulled out dongle and plugged it in again
Traceback (most recent call last):
  File "C:\Users\emil\AppData\Roaming\Python\Python38\site-packages\bleuio_lib\bleuio_funcs.py", line 387, in __poll_serial
    self.rx_buffer += get_data()
  File "C:\Users\emil\AppData\Roaming\Python\Python38\site-packages\serial\serialutil.py", line 652, in read_all
    return self.read(self.in_waiting)
  File "C:\Users\emil\AppData\Roaming\Python\Python38\site-packages\serial\serialwin32.py", line 259, in in_waiting
    raise SerialException("ClearCommError failed ({!r})".format(ctypes.WinError()))
serial.serialutil.SerialException: ClearCommError failed (OSError(22, 'The I/O operation has been aborted because of either a thread exit or an application request.', None, 995))
Serial exception in polling thread: ClearCommError failed (OSError(22, 'The I/O operation has been aborted because of either a thread exit or an application request.', None, 995))
Traceback (most recent call last):
  File "C:\Users\emil\AppData\Roaming\Python\Python38\site-packages\bleuio_lib\bleuio_funcs.py", line 387, in __poll_serial
    self.rx_buffer += get_data()
  File "C:\Users\emil\AppData\Roaming\Python\Python38\site-packages\serial\serialutil.py", line 652, in read_all
    return self.read(self.in_waiting)
  File "C:\Users\emil\AppData\Roaming\Python\Python38\site-packages\serial\serialwin32.py", line 259, in in_waiting
    raise SerialException("ClearCommError failed ({!r})".format(ctypes.WinError()))
serial.serialutil.SerialException: ClearCommError failed (OSError(22, 'The I/O operation has been aborted because of either a thread exit or an application request.', None, 995))
Error communicating with dongle:  Port to BleuIO is not open!  <-------------  Here I catch the exception and handle it
No BleuIO dongle COM port available!
Reconnection failed:  No BleuIO dongle COM port available!
No BleuIO dongle COM port available!
Reconnection failed:  No BleuIO dongle COM port available!
No BleuIO dongle COM port available!
Reconnection failed:  No BleuIO dongle COM port available!
Reconnected to dongle  <----------------------- Bootloader exits and the BleuIO COM port is available
[{'R': 2, 'dev': 'Smart Sensor Devices', 'hw': 'DA14683 (P25Q80LE)', 'name': 'BleuIO'}, {'R': 2, 'fwVer': '2.7.9.55', 'gap_role': 'dual'}, {'R': 2, 'connected': False, 'advertising': False}]
[{'R': 3, 'dev': 'Smart Sensor Devices', 'hw': 'DA14683 (P25Q80LE)', 'name': 'BleuIO'}, {'R': 3, 'fwVer': '2.7.9.55', 'gap_role': 'dual'}, {'R': 3, 'connected': False, 'advertising': False}]

With this approach, your application can continue operating seamlessly even after unexpected interruptions.

Upgrade Recommended

Updating to Python Library v1.7.4 is quick and straightforward. If you already have a previous version installed, start by upgrading the package through pip. Run the following command in your terminal or development environment:

pip install --upgrade bleuio

This will fetch and install the latest version of the library.

Python library v1.7.4 is a reliability-driven update that delivers cleaner logging and robust recovery from connection loss. These improvements make BleuIO-based Python applications more stable, easier to maintain, and better suited for continuous and production-level use. We strongly recommend this update for all developers working with BleuIO in Python.

Share this post on :

Leave a Reply

Your email address will not be published. Required fields are marked *

Follow us on LinkedIn :

Order Now