We’re pleased to announce the release of BleuIO Pro firmware v1.0.7.3, introducing new MTU negotiation commands, improved GATT discovery stability, and optimized handling of complex Bluetooth Low Energy (BLE) devices.
This update gives developers greater control over BLE connections while improving performance and reliability when working with peripherals containing large GATT databases.
New MTU Negotiation Controls
Firmware v1.0.7.3 introduces two new AT commands for managing MTU negotiation.
AT+REQMTU – Request MTU Exchange Manually
The new AT+REQMTU command allows developers to initiate a GATT client MTU exchange at any point after establishing a BLE connection.
This provides greater flexibility when testing peripheral behavior, debugging connections, or managing specific connection workflows.
AT+AUTOMTU – Control Automatic MTU Negotiation
The new AT+AUTOMTU command lets developers enable or disable automatic MTU negotiation during connection parameter updates.
AT+AUTOMTU=1 – Enable automatic MTU negotiation.
AT+AUTOMTU=0 – Disable automatic MTU negotiation.
When disabled, developers can use AT+REQMTU to trigger the exchange manually, allowing more predictable connection handling in automated scripts and applications.
Improved GATT Discovery Stability
This release addresses an issue where BleuIO Pro could unexpectedly reset while discovering services and characteristics on peripherals with exceptionally large GATT databases.
The discovery engine has been redesigned to use a sequential streaming architecture instead of memory-intensive hierarchical caching.
With this improvement, GATT attributes are processed dynamically and sent to the USB interface as they are discovered.
Key benefits include:
Reduced memory consumption during GATT discovery.
Improved connection stability with complex BLE peripherals.
Support for up to 165 characteristics within a single service.
More efficient processing of large GATT profiles.
These improvements apply to the following commands:
AT+GETSERVICES
AT+GETSERVICESONLY
AT+GETSERVICEDETAILS
GATT Discovery Output Changes
With the new streaming architecture, discovered GATT attributes are reported immediately as they are processed.
One small change affects the presentation order of descriptors. Previously, descriptors such as CCCDs (0x2902) appeared directly after their associated characteristics. They are now grouped at the end of the corresponding service block.
Important: All JSON fields in verbose mode and standard text-mode output strings remain unchanged. Only the order of descriptor entries has been modified.
Developers using custom parsers that depend on descriptor ordering should review their implementation to ensure compatibility.
How to Update Your Firmware
Updating your BleuIO Pro is straightforward.
You can download the latest firmware and follow the step-by-step update instructions in our official documentation:
Both methods provide a simple way to get your BleuIO Pro running the latest firmware.
We recommend updating to v1.0.7.3 to benefit from the latest MTU controls, improved GATT discovery stability, and support for larger peripheral profiles.
In this tutorial we will use CircuitPython to turn a Cytron MOTION 2350 Pro into a HibouAir scanner. The board’s RP2350 has no Bluetooth radio of its own. A BleuIO dongle in the board’s USB-A host port provides Bluetooth Low Energy, and a short CircuitPython program talks to it with ordinary AT commands.
The program scans for air quality monitoring device HibouAir advertisements, decodes them, and keeps the latest readings in global variables. One of them, the PM10 value from a HibouAir PM sensor, is ready to be used by the rest of your program. As an example, the program turns a hobby servo on one of the board’s servo ports into an analog PM10 gauge.
Everything runs on the board. No computer is needed once the code is in place, and the HibouAir sensors do not need to be paired.
With circup installed on your computer, one command copies both:
circup install asyncio
Everything else the program uses is built into CircuitPython: usb_host, usb.core, json, binascii, microcontroller, pwmio and time. The servo is driven with pwmio directly, so it needs no extra library. No boot.py is needed.
What Does This Project Do?
1. The board becomes a USB host
The MOTION 2350 Pro’s USB-A port is driven by the RP2350’s PIO. CircuitPython starts it with usb_host.Port on GPIO24 and GPIO25. The board definition has no named pins for this port, so the program uses the raw pins.
2. CircuitPython finds BleuIO
The program waits until a device with vendor ID 0x2DCF and product ID 0x6002 appears, which is BleuIO. It selects the dongle’s configuration and sets DTR and RTS, so that BleuIO starts sending its output.
3. The dongle is brought into a known state
BleuIO remembers what it was doing, so a scan from an earlier run may still be going. The program first sends Ctrl-C three times to stop it. It then throws away everything the dongle sends until it has been quiet for 0.3 seconds. After that it sends:
ATE0, which turns echo off
ATV1, which turns verbose mode on, so every reply is one line of JSON
4. BleuIO scans for HibouAir only
AT+FINDSCANDATA=FF5B07
This reports only advertisements that contain FF5B07. FF is the AD type for manufacturer-specific data, and 5B 07 is HibouAir’s company ID, 0x075B, as it appears in the packet. Each result arrives as a line such as:
The program walks the advertisement’s AD structures until it finds the HibouAir manufacturer data. This works whether or not the flags field comes first. Counting from the company ID, the sensor beacon (beacon type 0x05) holds:
Offset
Field
Format
2
Beacon type
0x05 for sensor readings
3
Board type
0x03 is the PM sensor
4–6
Sensor ID
as shown in the HibouAir app, e.g. 22026A
9
Pressure
16-bit little-endian, tenths of hPa
11
Temperature
16-bit little-endian, signed, tenths of °C
13
Humidity
16-bit little-endian, tenths of %rh
17
PM1.0
16-bit little-endian, tenths of µg/m³
19
PM2.5
16-bit little-endian, tenths of µg/m³
21
PM10
16-bit little-endian, tenths of µg/m³
23
CO2
16-bit big-endian, ppm
6. The readings are kept in global variables
pm10: the latest PM10 value in µg/m³, or None until a PM sensor has been heard
pm10_sensor: the ID of the sensor it came from
pm10_time: time.monotonic() when it arrived, so that a stale value can be recognised
sensors: a dictionary with everything the last beacon of every HibouAir sensor said, keyed by sensor ID
If you have more than one PM sensor, set PM_SENSOR_ID to the one pm10 should follow. If nothing has been heard for 15 seconds, the program starts the scan again.
Showing PM10 on a Servo Gauge
The MOTION 2350 Pro has eight servo ports, on GP0 to GP7, each with a PWM channel of its own. The program drives a servo on GP0 as a needle: 0 µg/m³ at 0 degrees, and 100 µg/m³ or more at 180 degrees.
With that full scale, the PM10 limits the HibouAir app uses fall at simple angles. That is where to draw the bands on a paper scale behind the servo arm:
PM10
Level
Needle
0–20 µg/m³
Good
0–36°
20–50 µg/m³
Fair
36–90°
50–100 µg/m³
Poor
90–180°
100 µg/m³ and above
Bad
180°
The gauge is its own asyncio task, beside the reader and the command logic:
It sends a 50 Hz servo signal, from 500 µs at 0 degrees to 2500 µs at 180.
It moves the needle 2 degrees every 20 ms, so the arm swings to a new reading instead of jumping.
At start it sweeps once across the whole scale. A servo that is not connected is then noticed at once, instead of being taken for clean air.
Once the needle has been still for half a second, the pulses stop. A servo told to hold a position holds it actively, and at 0 degrees, the commonest reading of all, it pushes against its end stop and hums. Without pulses an ordinary hobby servo goes quiet and stays where it is.
The pulses start again when a new reading moves the needle by at least one degree, so readings of 0.0 and 0.1 µg/m³ taking turns do not wake it.
Connect the servo to the GP0 servo header, matching the servo cable to the markings next to the header. Check Cytron’s datasheet for how the servo ports are supplied before connecting a larger servo.
The settings are at the top of code.py:
SERVO_PIN: the port, board.GP0 to board.GP7
PM10_FULL_SCALE: the PM10 value at 180 degrees
SERVO_MIN_US and SERVO_MAX_US: the pulse widths at the ends. Narrow them if your servo strains at its end stops.
SERVO_STEP_DEG: how fast the needle moves
SERVO_REST_S and SERVO_DEADBAND_DEG: how long the needle is still before it rests, and how far a reading must move it to wake it
The board’s four DC motor drivers, on GP8 to GP15 (board.M1A to board.M4B in CircuitPython), would suit a different use of the same value, such as running a fan faster as PM10 rises.
Why the Flush After Ctrl-C Matters
Ctrl-C stops the scan, but whatever BleuIO had already queued still arrives afterwards. Often the last piece is a line cut off in the middle, sometimes with a byte that is not valid UTF-8.
In early versions of this program, a reader that tried to decode that line before removing it from its buffer stuck on it. Every later piece of data was appended behind the same broken line, and the program heard nothing more, in about half of all restarts.
The program now does two things:
It removes each line from the buffer before decoding it, so a broken line costs that line only.
It discards everything until the dongle has been quiet before sending the next command.
With both in place, the start-up worked every time in repeated tests, whether the dongle was fresh (echo on, verbose off) or left in verbose mode by an earlier run.
How to Run the Project
Step 1: Install CircuitPython
Download the CircuitPython UF2 for the Cytron MOTION 2350 Pro and put the board into its UF2 bootloader mode. On RP2350 boards this is done by holding BOOT while pressing RESET, or while connecting the USB cable. Copy the UF2 to the RP2350 drive that appears. The board restarts as a drive named CIRCUITPY.
Step 2: Add the libraries
Run circup install asyncio, or copy the asyncio folder and adafruit_ticks.mpy from the library bundle into CIRCUITPY/lib.
Step 3: Copy the program
Save the code at the end of this post as code.py on the CIRCUITPY drive. CircuitPython starts it as soon as the file is saved.
Step 4: Connect BleuIO
Insert the BleuIO dongle into the board’s USB-A port. Do not connect BleuIO to the computer for this setup.
Step 5: Connect the servo (optional)
Plug the servo into the GP0 servo header. It sweeps once from 0 to 180 degrees and back when the program starts, then follows PM10, and goes quiet whenever the needle is still.
Step 6: Watch the serial console
Open the board’s serial console at 115200 baud. Use Mu, Thonny or the CircuitPython web workflow, or on macOS and Linux:
screen /dev/cu.usbmodem2101 115200
The device name differs from computer to computer. If the console shows raw REPL; CTRL-B to exit, an editor has left it in raw REPL mode: press Ctrl-B, then Ctrl-D to start code.py.
Expected Output
BleuIO dongle found! (0x2dcf:0x6002)
CDC Control Lines (DTR/RTS) enabled.
Starting background USB reader task...
Starting the HibouAir scan...
[Sending]: ATE0
[Sending]: ATV1
[Sending]: AT+FINDSCANDATA=FF5B07
[HibouAir 22026A] PM10 0.1 ug/m3 PM2.5 0.1 PM1 0.0 21.8 C
[HibouAir 22008C] board 0x04, 21.5 C, 39.8 %rh, CO2 459 ppm
[HibouAir 220095] board 0x04, 20.8 C, 42.9 %rh, CO2 411 ppm
[HibouAir 22005A] board 0x04, 19.6 C, 44.2 %rh, CO2 721 ppm
[HibouAir 220265] board 0x09, 19.8 C, 45.5 %rh, CO2 533 ppm
Every HibouAir sensor in range appears with its ID. Lines from the PM sensor show the particle readings; the others show temperature, humidity and CO2. Each new PM line also updates pm10.
This project is a practical example of how BleuIO can bring Bluetooth Low Energy connectivity to development boards without built-in Bluetooth support. Using the Cytron MOTION 2350 Pro and CircuitPython, we demonstrated how to scan for HibouAir sensors, read real-time data, and use that data to control a servo motor.
The complete source code is available for developers to explore, modify, and integrate into their own projects. Whether you’re building sensor monitoring systems, automation solutions, or custom IoT applications, this example provides a starting point for using BleuIO with compatible development boards.
In this tutorial, we will build a simple BLE-to-cloud air quality gateway using HibouAir, BleuIO, Python, Cloudflare Workers, and Cloudflare D1.
A HibouAir sensor will advertise its air quality measurements over Bluetooth Low Energy. BleuIO, connected to a computer through USB, will scan for a specific HibouAir device and provide the BLE advertising data to a Python application through the serial port. The Python application will decode CO2, temperature, and humidity, display the measurements in the terminal, and upload them to a Cloudflare Worker. The Worker will then store the measurements in a Cloudflare D1 database.
This project is intentionally kept simple. It demonstrates how BleuIO can act as the Bluetooth interface for a desktop or gateway application without requiring the application itself to manage a Bluetooth stack.
Why Cloudflare D1?
Cloudflare D1 is a serverless SQL database built on SQLite. It works particularly well with Cloudflare Workers, allowing us to create a small HTTP API without running our own server.
For a project like this, there are several advantages:
No database server to install or maintain
No local web server required
HTTPS is handled automatically
Cloudflare Workers can communicate directly with D1
D1 supports regular SQL
A useful free tier is available
The database remains accessible even when the Computer running the BLE gateway is offline
This makes it convenient for prototypes, BLE gateways, environmental monitoring projects, demonstrations, and small IoT applications.
For this example, the Computer only needs to run the Python gateway application. Everything after the HTTP request is handled in the cloud.
From the Cloudflare dashboard, go to the D1 database section and create a new database.
For this tutorial, we will call it:
hibouair-db
Once the database has been created, open its SQL Console.
Run the following SQL:
CREATE TABLE IF NOT EXISTS readings (
id INTEGER PRIMARY KEY AUTOINCREMENT,
board_id TEXT NOT NULL,
measured_at TEXT NOT NULL DEFAULT CURRENT_TIMESTAMP,
co2 INTEGER NOT NULL,
temperature REAL NOT NULL,
humidity REAL NOT NULL
);
CREATE INDEX IF NOT EXISTS idx_readings_board_time
ON readings(board_id, measured_at);
This creates a simple table containing:
Database ID
HibouAir board ID
Timestamp
CO₂
Temperature
Humidity
The measured_at field is generated automatically by D1 when the reading is inserted.
A stored record will look conceptually like this:
id 1
board_id 220069
measured_at 2026-10-05 14:42:30
co2 623
temperature 24.1
humidity 43.7
Step 2: Create the Cloudflare Worker
Next, create a Cloudflare Worker.
Now go to:
Workers & Pages → Create application
Create a basic Worker. ( you can choose “Start with Hello world”)
The Worker will sit between our Python application and the D1 database.
For this project, we can name it:
hibouair-api
and then press deploy.
After creating the Worker, open the code editor and replace the default code with the following :
Enter the same secret that was configured in the Cloudflare Worker:
CLOUDFLARE_API_KEY=YOUR_REAL_API_KEY
The info.txt file should not be committed to GitHub because it contains the API key.
Step 9: How the HibouAir Data Is Read
BleuIO communicates with our Python application using simple AT commands over the serial port.
The application first connects to BleuIO and places it in central mode.
It then searches for our HibouAir board ID using:
AT+FINDSCANDATA=220069=5
Here:
220069
is the HibouAir board ID, and:
5
defines the scan duration.
BleuIO handles the Bluetooth Low Energy scanning and returns the matching BLE advertising information over serial.
This means the Python application does not need to directly communicate with the operating system’s native Bluetooth API.
BleuIO then returns the advertising data to Python.
Step 10: Decode the HibouAir Advertisement
The Python application searches the advertising payload for the HibouAir data section:
5B070
For the HibouAir advertisement used in this example, the application extracts the three measurements needed for this project. Temperature, Humidity and CO2. The result becomes a normal Python structure similar to:
The Cloudflare Worker validates the key and inserts the measurement into D1.
The Python application therefore never connects directly to the database.
Step 12: Run the Application
Before running the project, make sure no other program is currently using the BleuIO serial port.
For example, close any active BleuIO connection in:
BleuIO application
screen
serial monitor
terminal program
other Python application
Then run:
python3 main.py
The application should connect to BleuIO.
You should see output similar to:
BleuIO + HibouAir + Cloudflare D1
---------------------------------
BleuIO port : /dev/cu.usbmodem4048FDEBA6D01
HibouAir ID : 220069
Scan interval: 30 seconds
Trying BleuIO on /dev/cu.usbmodem4048FDEBA6D01 at 115200 baud...
BleuIO connected successfully.
Setting BleuIO to central mode...
Ready.
The application will then start scanning:
Scanning for HibouAir 220069...
Command: AT+FINDSCANDATA=220069=5
When a valid HibouAir advertisement is received and decoded, the terminal will display something similar to:
============================================
HIBOUAIR AIR QUALITY
============================================
CO2 623 ppm
Temperature 24.1 °C
Humidity 43.7 %RH
============================================
Uploading to Cloudflare D1...
✓ Reading stored successfully.
Next scan in 23 seconds...
The application continues running automatically.
There is no need to restart it for each measurement.
To stop the application, press:
Ctrl + C
Step 13: Check the Data in Cloudflare D1
Now return to the Cloudflare D1 database console.
Run:
SELECT *
FROM readings
ORDER BY id DESC
LIMIT 10;
You should see the measurements coming from HibouAir.
For example:
id board_id measured_at co2 temperature humidity
12 220069 2026-10-05 14:58:20 618 24.1 43.8
11 220069 2026-10-05 14:57:50 621 24.1 43.8
10 220069 2026-10-05 14:57:20 623 24.1 43.7
This tutorial intentionally stops at the database and API level.
The objective is to demonstrate the complete BLE-to-cloud data path while keeping the example easy to understand.
At this point, the data is already available in the cloud.
A developer could later build a dashboard showing:
Current CO₂
Current Temperature
Current Humidity
CO₂ history
Temperature history
Humidity history
A dashboard could request historical readings through additional Worker API endpoints.
It could also display thresholds, warnings, averages, minimum/maximum measurements, or other analytics.
Those features are deliberately outside the scope of this example because the main goal is to demonstrate how easily BLE data can be brought into a serverless cloud architecture using BleuIO.
We kept the project intentionally simple so that the individual parts are easy to understand and modify.
From here, the project can be expanded in many directions. Multiple HibouAir sensors could be monitored, additional air quality parameters could be stored, historical API endpoints could be created, and a complete cloud dashboard could be built on top of the existing data.