In this tutorial, we demonstrate how to connect the BleuIO Bluetooth Low Energy dongle to the Waveshare RP2350A USB Mini development board to create a dual-mode USB serial bridge. This example highlights the process of communicating with BleuIO using AT commands via USB host mode. It serves as a great starting point for anyone looking to build their own BLE application using this compact and powerful board.
About the Waveshare RP2350A USB Mini
The Waveshare RP2350A USB Mini is a development board built around the Raspberry Pi RP2350 microcontroller. It features a dual-core architecture, combining ARM Cortex-M33 and RISC-V Hazard3 cores, running at up to 150 MHz. The chip includes 520KB of SRAM and 2MB of onboard flash, making it suitable for advanced embedded applications.
What sets this board apart is its USB-A connector with support for USB host mode, allowing it to communicate directly with USB peripherals like the BleuIO dongle. This makes it an ideal host controller for Bluetooth Low Energy (BLE) applications.
Project Overview
This project demonstrates a dual-mode USB serial bridge implemented on the RP2350A board. The bridge allows the board to simultaneously function as:
A USB host using PIO-USB on GPIO 12/13, connected to a device like BleuIO.
A USB device, appearing as a virtual COM port when connected to a PC.
Data is transparently forwarded between the host and device interfaces, allowing you to communicate with BleuIO from a terminal on your PC.
This example project is useful for anyone looking to build a standalone USB host application using BleuIO. You can use the source code as a base and expand it into a more complex BLE project by sending and receiving AT commands directly from the RP2350A board.
Use Case
Imagine a scenario where you want to build a small, embedded BLE sensor gateway. Using the RP2350A as a USB host and BleuIO as the BLE interface, you can develop a powerful BLE solution without needing a full-sized computer. This approach is ideal for prototyping custom BLE applications, sensor data acquisition, or even building a mini BLE scanner.
In host mode, the RP2350 board uses PIO-USB to emulate USB host functionality on GPIO pins 12 (D+) and 13 (D-). You can connect any CDC-compatible device, such as a USB-to-serial adapter or the BleuIO dongle, to these pins.
Once connected, the application automatically detects and configures the device. All incoming and outgoing serial data is forwarded and can be monitored through the debug UART interface.
Device Mode (Native USB Port)
When the RP2350A’s native USB port is connected to your PC, it appears as a virtual serial port. This allows you to communicate with the BLE dongle (connected via host mode) using a terminal application like PuTTY or Tera Term.
This enables full-duplex communication, letting you send AT commands to BleuIO and receive responses directly from your PC.
Debug Output (UART on GP0/GP1)
To observe internal debug messages, connect a UART adapter to GPIO 0 (TX) and GPIO 1 (RX) with a baud rate of 115200. This output includes information such as device enumeration, data flow, and potential errors—essential for troubleshooting and development.
Building the Project
To build the firmware, you can either use the provided build script or follow a manual setup.
You can find the complete source code for this project on GitHub:
mkdir build && cd build cmake .. -DCMAKE_BUILD_TYPE=Release make -j4
After building, a rp2350_serial_bridge.uf2 file will be generated.
Flashing the Firmware
Hold the BOOTSEL button on the RP2350 board and connect it to your PC via USB.
The board will mount as a USB mass storage device.
Copy the generated rp2350_serial_bridge.uf2 file to this drive.
The board will reboot and start running the dual-mode USB bridge application.
You can now insert the BleuIO dongle into the USB-A port of the RP2350A board and begin communication from your PC.
Code Structure
main.c – Main entry point of the application.
serial_host_bridge.c/h – Handles the USB CDC host implementation.
tusb_config.h – TinyUSB configuration file.
CMakeLists.txt – Build configuration for CMake.
Getting Started with Your Own BLE App
This project is just a starting point. It demonstrates how to set up USB host/device mode and communicate with a CDC-based USB dongle like BleuIO. From here, you can extend the code to parse responses, interact with BLE devices, or trigger actions based on received data.
By combining the flexible RP2350A platform with BleuIO, developers can create their own powerful standalone BLE applications for IoT, sensors, or industrial control—without relying on a full computer.
Source Code
You can find the complete source code for this project on GitHub:
Indoor air quality is an important factor in workplace health, home comfort, and industrial safety. Monitoring CO2, particulate matter, temperature, humidity, and other environmental metrics can help prevent health issues, optimize HVAC usage, and maintain compliance with building standards. In this tutorial, we’ll walk through building a complete air quality monitoring solution using the BleuIO USB dongle and the HibouAir BLE sensor. We’ll use Python to collect data, InfluxDB to store it, and Grafana to visualize it in real time.
This project works entirely offline, runs on both macOS and Windows, and is suitable for personal, educational, or professional use. Whether you want to monitor a home office or manage sensors in an industrial setup, this system is simple to deploy and easy to scale.
What You Need
You will need one BleuIO USB dongle and one HibouAir BLE sensor. These two devices form the core of the setup. The BleuIO dongle will connect via a serial port and act as a BLE Central, continuously scanning for BLE advertisement packets sent by the HibouAir sensor.
For software, you’ll need Python 3, InfluxDB, and Grafana, all of which are available for both macOS and Windows. You’ll also install a few Python packages (pyserial and influxdb) to allow your script to read data over the serial port and write it to the database.
About Grafana
Grafana is an open-source analytics and visualization platform designed to display time-series data. It integrates seamlessly with databases like InfluxDB, allowing users to create interactive and customizable dashboards. In this project, Grafana serves as the front end for visualizing live air quality data coming from the HibouAir sensor. Its intuitive interface and support for powerful queries make it ideal for monitoring environmental conditions over time, setting alerts, and gaining actionable insights from BLE sensor data.
macOS Installation
On macOS, it’s easiest to install tools using Homebrew. You can install everything with the following commands:
Make sure Python and pip are added to your system path. You can then install Python packages via:
pip install pyserial influxdb
Also, identify your BleuIO COM port by opening Device Manager and checking Ports (COM & LPT). You’ll see something like COM3, which you’ll use in the Python script.
Setting Up InfluxDB
After installing InfluxDB, you need to create a database that will store sensor readings. On macOS, open your terminal. On Windows, use Command Prompt or PowerShell.
To enter the InfluxDB CLI:
influx
Inside the CLI, run:
> CREATE DATABASE hibouair > SHOW DATABASES > EXIT
This creates a database called hibouair, which your Python script will use to log environmental data.
You don’t need to set up authentication for local testing. If you do secure your instance later, remember to update Grafana and the Python script with your username and password.
Configuring Grafana
Once Grafana is installed and running, open your browser and go to:
http://localhost:3000
The default username and password are:
Username: admin Password: admin
After logging in, you’ll be asked to set a new password. Once you’re in the Grafana dashboard:
Go to Settings → Data Sources
Click Add data source
Choose InfluxDB
Set the following:
URL: http://localhost:8086
Database: hibouair
User and Password: leave empty unless you’ve enabled authentication
HTTP Method: GET or POST (default is fine)
Click Save & Test
You should see a success message confirming Grafana can read from InfluxDB.
Connecting BleuIO via Serial Port
Insert your BleuIO USB dongle.
On macOS, find the port using: ls /dev/cu.usbmodem* Example: /dev/cu.usbmodem4048FDEBA6D01
On Windows, check Device Manager → Ports (COM & LPT) and find something like COM3 or COM4.
This port will be used in your Python script to open a serial connection to the dongle.
The Python Script
The Python script initializes the BleuIO dongle in Central mode, sends a scan command (AT+FINDSCANDATA), and reads the BLE advertisement packets from the HibouAir sensor. The data, which arrives in hexadecimal format, is decoded to extract values like temperature, humidity, CO2, VOC, PM1, PM2.5, PM10, light, noise, and pressure. The script then writes this data to InfluxDB with a timestamp.
To avoid storing duplicate values, the script only logs the first valid reading per scan cycle. It waits for a configurable period (e.g., 20 seconds) before scanning again.
You can view and copy the complete Python script from the GitHub repository linked below.
Make sure to replace the serial port path and board ID in the script with your actual values.
Creating a Dashboard in Grafana
With data flowing into InfluxDB, it’s time to visualize it in Grafana. Start by creating a new dashboard:
From the left menu, go to Dashboards → New → Add new panel
In the query editor, select your InfluxDB data source
Enter the following query to display CO2 levels: SELECT last("co2") FROM "air_quality" WHERE $timeFilter GROUP BY time($__interval)
This query fetches the latest CO2 readings from the air_quality measurement. You can change "co2" to "temp", "hum", "voc", "pm25" or any other field depending on what you want to display.
Grafana will automatically plot the data on a line chart. You can switch to a gauge, bar, or other visualizations from the panel settings. You can also set thresholds, value ranges, and colors to improve readability.
Repeat this process to add more panels for temperature, humidity, VOCs, PM2.5, PM10, and other values.
Once your dashboard is complete, click Apply, then Save the dashboard to reuse it later.
Output
How It Works
This system leverages BLE advertisement broadcasting from HibouAir and AT command-based serial communication with the BleuIO dongle. The dongle scans for a specific board ID using AT+FINDSCANDATA=<board_id>=3, and the Python script reads and decodes each advertisement received. The decoded data is immediately sent to InfluxDB using the official client library.
Grafana queries this time-series data and displays it in real time. Since all components are local, there is no dependency on external servers or cloud APIs. The system is also modular, so you can easily scale it to support multiple sensors, extend the decoder for other BLE formats, or forward data to cloud-based platforms in the future.
Use Cases
This setup is ideal for a range of applications. In an office environment, monitoring CO2 and humidity can help optimize ventilation and improve productivity. In factories or workshops, tracking particulate matter and VOCs ensures air quality compliance and safety. For researchers and students, this project provides a hands-on, local, and open-source method to study environmental changes. Even in residential settings, it can help detect poor air circulation or pollutant spikes. The simplicity of this solution makes it accessible to both developers and non-developers alike.
Extending the Project
There are several ways to expand this project:
Add support for additional BLE data types, such as HibouAir’s type 08 advertisements for NO₂
Set up Grafana alerts to notify you when CO2 exceeds 800 ppm or humidity drops below 30%
Export historical data from InfluxDB to CSV for offline analysis
Run the Python script as a background service on system boot
Connect multiple sensors to cover multiple rooms or areas
With minimal changes, you can also run this setup on a Raspberry Pi or Linux server.
With just a BleuIO dongle, a HibouAir sensor, and a few open-source tools, you’ve built a fully functional air quality monitoring solution. The system is flexible, lightweight, and runs entirely offline. It provides real-time insights into indoor environmental conditions and can be adapted for a variety of applications.
Node-RED, a flow-based development tool for visual programming, has become a favorite among IoT developers for rapidly building and testing automation workflows. In this article, we explore how to use BleuIO, a Bluetooth Low Energy (BLE) dongle, within Node-RED to interact with BLE devices like HibouAir—an affordable and reliable air quality monitoring sensor.
We will demonstrate:
How to send BLE commands to BleuIO and read back data
How to scan for BLE advertisements from a HibouAir device
How to decode and display real-time air quality data like CO2, temperature, and humidity on a live dashboard
By the end, you’ll have a working Node-RED BLE setup using BleuIO and a HibouAir sensor.
What is Node-RED?
Node-RED is an open-source, flow-based programming tool built on Node.js. It offers a browser-based visual interface that allows developers to connect hardware devices, APIs, and services using prebuilt “nodes.” Originally developed by IBM, Node-RED has grown into one of the most accessible platforms for prototyping and building IoT and automation solutions.
What makes Node-RED especially appealing is its simplicity. Without needing to write complex code, developers can drag and drop logic blocks and wire them together to build powerful flows. It supports a wide range of protocols, including MQTT, HTTP, and—through serial communication. With its real-time data handling, debugging tools, and powerful dashboard feature, Node-RED becomes an ideal choice for BLE-based IoT projects like this one.
What is HibouAir?
HibouAir is a compact and affordable air quality monitoring device developed by Smart Sensor Devices. Designed for both indoor and outdoor use, it transmits real-time environmental data over Bluetooth Low Energy (BLE), making it easy to integrate into any smart environment. The sensor measures key air quality parameters such as CO2, temperature, humidity, particulate matter (PM1.0, PM2.5, PM10), VOCs, light intensity, noise levels etc. This simplicity makes it a perfect fit for developers and system integrators working with platforms like Node-RED, where data can be read, decoded, and visualized in minutes.
What We Built
We built a flow in Node-RED that:
Sends an AT command to put BleuIO in central role (AT+CENTRAL)
Sends a scan command to search for HibouAir devices (AT+FINDSCANDATA)
Reads the advertisement data from a known board ID (e.g., 220069)
Decodes the BLE hex payload using a custom decoder function
Extracts and displays live air quality values (CO2, temperature, humidity) in the dashboard
Requirements
To replicate this project and visualize air quality data using Node-RED and BleuIO, you’ll need the following hardware and software:
BleuIO Dongle
A plug-and-play USB Bluetooth Low Energy (BLE) dongle that supports AT commands over serial. Get BleuIO
HibouAir Sensor
An affordable air quality monitoring device that broadcasts environmental data via BLE advertisements. Get HibouAir
Node-RED
A low-code flow-based development tool to wire together devices, APIs, and services. Node-RED Installation Guide
Tip: You can install Node-RED globally via npm:
npm install -g --unsafe-perm node-red
Node-RED Dashboard
An additional Node-RED module used to create UI dashboards. Dashboard GitHub Repo Install it with:
cd ~/.node-red npm install node-red-dashboard
HibouAir Decoder Script
A Node.js-based decoding script that extracts sensor values from BLE advertisement data.
A serial in node reads back raw BLE advertisements. These are filtered and passed through a custom decoder only if they match a specific prefix like 5B0705 and contain the HibouAir board ID.
3. Decode Payload
We placed a hibouair-decoder.js script next to settings.js and loaded it globally using:
The decoder function parses the hex payload into human-readable sensor values.
4. Show on Dashboard
Finally, we use dashboard gauge widgets to show live values:
CO2 in ppm
Temperature in °C
Humidity in %RH
The Node-RED dashboard UI gives a beautiful, real-time snapshot of your air quality.
Live Dashboard
Live readings of CO2, temperature, and humidity.
A snapshot of the working Node-RED flow using BleuIO and HibouAir.
Use Cases
This solution opens doors for a wide variety of applications. In smart classrooms, it ensures students learn in environments with healthy air quality, which can significantly affect concentration and wellbeing. In modern office spaces, monitoring CO2 and temperature helps facilities maintain optimal working conditions, improving both productivity and comfort.
For developers and researchers, this integration offers an easy way to prototype BLE applications, decode custom advertisements, and visualize data with minimal setup. Environmental agencies or facility managers can use this same setup for on-site testing and audits without needing cloud connectivity.
Even at home, you can deploy this as a DIY setup to monitor indoor air conditions and get real-time alerts when CO2 levels get high due to poor ventilation.
What You Can Do Next
Now that you have a live setup showing CO2, temperature, and humidity from HibouAir on a Node-RED dashboard, the possibilities for extending this flow are endless.
To store and track trends, you can add a chart node that logs values over time. This enables historical analysis of indoor air conditions, which is useful for compliance, optimization, or just awareness.
If you’re concerned about thresholds, consider adding a switch node that triggers alerts—say, if CO2 levels rise above 1000 ppm or the temperature exceeds 30°C. This could be used to turn on ventilation or send a mobile notification.
You might also want to persist data to a local SQLite database or forward readings to a cloud-based API for further processing or sharing. This transforms your flow into a powerful edge gateway.
Finally, you can export the complete flow as a template, allowing colleagues, customers, or community users to import it directly and start monitoring with their own HibouAir and BleuIO setup.
Try It Yourself
You can import the full Node-RED flow here and start using it with:
Just install Node-RED, load this flow, and you’ll start seeing real-time air quality readings in your browser dashboard.
This tutorial shows how BleuIO seamlessly integrates with platforms like Node-RED to help developers quickly build BLE-powered applications. Combined with a device like HibouAir, this setup makes monitoring air quality simple, affordable, and accessible—without any advanced hardware or coding requirements.
We encourage you to extend this example, share your flows, or reach out to us with new ideas. BLE development doesn’t have to be hard. With BleuIO and Node-RED, it’s just a few clicks away.
Monitoring environmental data in real time is becoming increasingly important, whether you are tracking air quality in an office, monitoring home conditions, or running a smart city project. With the BleuIO dongle and a BLE-enabled sensor like the HibouAir, it is remarkably simple to gather this data and share it with the world in a format that is open, accessible, and easy to consume.
This project demonstrates how you can turn BLE advertisement data into a live-updating RSS feed. The result is a transparent, shareable, and continuously updated stream of environmental measurements that anyone can subscribe to, whether they are using a standard RSS reader, a smart home dashboard, or an industrial system.
Project Overview
At its core, this project uses the BleuIO dongle to scan for BLE advertising packets from a HibouAir environmental sensor. The HibouAir broadcasts valuable metrics such as temperature, humidity, pressure, and CO2 levels over BLE advertisements. Instead of relying on a local desktop application or complicated server-side setups, this project leverages the power of modern browsers using the Web Serial API to connect directly to the BleuIO dongle over the USB port.
Once connected, the user can trigger BLE scans from within the browser. The scan runs every 30 seconds, decoding the broadcasted data in real time. Each new data point is sent to a lightweight PHP script on the server, which stores and appends the data in an RSS feed (rss.xml). This RSS file is immediately accessible to any subscriber or reader, allowing people to see live updates on the environmental conditions around the sensor.
The entire system is designed to be simple and easy to maintain. The frontend is styled with Tailwind CSS to ensure a responsive, polished interface. The user can connect, start scanning, stop scanning, and instantly visualize decoded data in a clear, scrollable log area.
Requirements
To build and run this project, you will need the following:
Permissions to write to rss.xml (you may need to set proper file permissions on your server)
How It Works
The project flow is straightforward. First, the user plugs the BleuIO dongle into their machine. Using the Web Serial API, the web page establishes a secure, permission-based connection with the dongle, sending standard AT commands to initiate scanning. The page decodes the advertising data using JavaScript, translating raw BLE packets into readable environmental measurements.
Every 30 seconds, a scan command is sent, retrieving the most recent advertising broadcasts. When a valid HibouAir packet is detected, the temperature, humidity, pressure, and CO2 values are extracted, timestamped, and then posted to the server using a simple JSON POST request. The PHP script running on the server receives these decoded values and appends them to the existing RSS feed. The result is a continually growing XML feed that any RSS reader can parse and display.
This approach removes the need for any heavy backend logic or traditional data pipelines. With the combination of the BLE advertisement protocol, the Web Serial API, and the simple power of RSS, the system remains robust, efficient, and fully open-standard.
Real-World Use Cases
There are many practical applications for this type of BLE-to-RSS feed system. In a smart building, it can provide real-time updates on air quality for facilities managers. Research labs can monitor and record environmental changes over time, sharing data with collaborators instantly. Homeowners could integrate the feed with smart thermostats or ventilation systems, optimizing air quality dynamically based on conditions broadcast by the HibouAir.
This approach is also perfect for educational settings, where students can learn about BLE communication, environmental sensors, and open-standard data sharing in a single, hands-on project. For communities or public-facing projects, the RSS feed provides a transparent, shareable view of conditions in a local area, encouraging citizen science or public environmental monitoring.
Why This Matters
Traditionally, BLE data collection has required local scripts, drivers, and other installation-heavy methods. Thanks to the Web Serial API, this entire solution can run in the browser, with no software to install apart from a modern web browser. The user grants permission to the serial port, connects the dongle, and can immediately start scanning, decoding, and sharing data.
By pushing this data into a simple RSS format, you gain compatibility with a huge ecosystem of readers and dashboards without reinventing the wheel. RSS is universal, easy to parse, and instantly shareable. This means a single HibouAir board and a BleuIO dongle can power an environmental feed accessible to anyone, anywhere.
Getting Started
This project is easy to set up. You only need a BleuIO dongle, a HibouAir board, a standard PHP-capable web server, and a modern web browser such as Chrome. The HTML page includes everything needed to connect to the dongle, issue scan commands, and decode results using JavaScript. Tailwind CSS ensures the user interface is polished and responsive.
After decoding, the environmental data is posted to a PHP script which appends it to an RSS feed file. From there, any visitor or RSS reader can subscribe to see the latest measurements. There is no complex backend, no cloud account, and no paid services — just a clean, standards-based solution that you can host yourself.
Source Code
The full project source code — including the HTML, JavaScript, PHP, and Tailwind-powered frontend — is available on GitHub. You can download, modify, or extend it as needed for your use case.
Feel free to clone the repository, fork it, and contribute improvements or suggestions.
Output
This project shows how BleuIO, in combination with Web Serial and simple RSS technology, can deliver an impressive, real-time environmental data feed. With minimal setup and a truly modern web-first architecture, you can build a robust, transparent, and shareable monitoring system in just a few hours.
If you are looking to explore BLE scanning, build a real-time environmental monitor, or simply share sensor data with the world in an open way, this project is a perfect starting point. Give it a try, and transform your local BLE sensors into a globally available data feed that anyone can use.
At Smart Sensor Devices, we are proud to introduce the BleuIO Script Generator – an AI-powered assistant that enables developers to instantly create valid BLE scripts using official BleuIO AT commands. Whether you’re a seasoned BLE expert or just getting started, this intelligent tool dramatically accelerates your workflow and minimizes errors.
What Is the BleuIO Script Generator?
The BleuIO Script Generator is a custom GPT (Generative Pre-trained Transformer) built using OpenAI’s advanced language model, trained and fine-tuned with the full BleuIO command reference. It understands how the BleuIO USB dongle works, including:
All AT commands
Syntax structures
Command usage examples
Valid output formats
With this AI assistant, you can now generate working scripts in Python, JavaScript, Shell, or any other language using real BleuIO commands—no more guessing or checking documentation line by line.
How Does It Help Developers?
The BleuIO Script Generator transforms the BLE development experience by offering intelligent, real-time support tailored to the needs of developers at all levels. One of its greatest strengths lies in rapid prototyping. You can simply describe your desired behavior in natural language—for example, “Create a script that connects to BleuIO and then scans for BLE devices for 5 seconds.”—and the generator instantly returns a ready-to-run script. It uses official AT commands like AT+CENTRAL, AT+GAPSCAN=5, correctly formatted and accompanied by helpful explanations.
Another major benefit is its language flexibility. Whether you’re working in Python, JavaScript, or even shell scripting, the Script Generator adapts the output to your preferred programming language, making integration seamless regardless of your tech stack. In addition to generating code, it promotes error-free development by relying solely on verified, up-to-date BleuIO AT commands. This minimizes the chance of sending unsupported or invalid instructions to your dongle, ensuring smoother workflows and reduced debugging time.
What sets this tool further apart is its built-in learning support. It doesn’t just produce scripts—it educates. You can ask the assistant questions like “What does AT+GAPSCAN=5 do?” or “How can I start advertising in extended mode?” and receive clear, example-based responses grounded in real command behavior. Whether you’re debugging, experimenting, or trying to better understand BLE communication, the BleuIO Script Generator acts as both tutor and tool.
Search for “BleuIO Script Generator” by Smart Sensor Devices
Start chatting with it like a BLE expert assistant
Once you’re in, simply describe your task, and the generator will respond with code, documentation, and suggestions.
Why This Matters
At Smart Sensor Devices, we built the BleuIO dongle to make BLE development simpler, faster, and more accessible. Now, with AI as your development partner, you’re no longer bound by manuals or guesswork.
The BleuIO Script Generator removes friction from your workflow, so you can:
Focus on building real BLE solutions faster
Prototype smarter IoT and automation systems
Support team members with varied skill levels
Whether you’re building a hobby project, an enterprise product, or teaching BLE concepts, this AI tool accelerates learning and development.
Ready to Start?
Visit bleuio.com and get your BleuIO dongle today. Pair it with the BleuIO Script Generator, and you’ll be writing powerful BLE scripts with ease—no matter your programming experience.
Looking to detect nearby Bluetooth devices based on how close they are? With the BleuIO USB dongle and a simple Python script, you can create a BLE proximity alert system that triggers a sound when a specific device is within signal range. This setup filters devices based on signal strength (RSSI), allowing you to monitor only those within a defined proximity.
This project is ideal for anyone exploring BLE applications such as access control, IoT automation, or even security demos.
Use Cases
The BLE Proximity Alert System can serve various real-world scenarios:
Secure Zone Monitoring By defining a signal strength threshold, the system only responds to devices that are physically close—perfect for protecting sensitive areas like server rooms or restricted workspaces.
Proximity-Based Device Interactions Trigger actions such as pairing or unlocking devices only when a known BLE tag or smartphone comes within a defined range, improving both UX and security.
Awareness and Educational Demos Demonstrate proximity-based alerts in classrooms or public exhibits to show how BLE technology can be used for social distancing or presence detection.
Smart Home or Office Automation Use proximity as a trigger to automate actions—such as turning on lights, sending notifications, or logging user presence—without needing additional sensors.
Requirements
To run this BLE proximity alert system, you’ll need:
BleuIO Dongle A USB Bluetooth Low Energy dongle that supports AT command communication and works with macOS, Windows, and Linux. This dongle will be used to scan for nearby BLE devices and filter based on signal strength.
Close Beacon Device In this project, we use a Close Beacon as the target BLE device. These compact beacons broadcast Bluetooth advertisements, making them ideal for proximity detection demos.
Python 3.x Ensure Python is installed on your system. The script uses Python to handle serial communication and control logic.
Sound File A short .wav or .mp3 audio file (e.g., beep.wav) placed in the same directory as the script. This sound will be played when the target BLE device is detected within the defined proximity.
Required Python Library
Only one external Python library is needed:
pyserial – for handling communication with the BleuIO dongle via the serial port.
You can install it using:
pip install pyserial
No additional audio libraries are required on macOS or Windows; the script uses the built-in afplay tool for macOS and winsound for Windows to play audio.
How It Works
When you launch the script, it establishes a serial connection with the BleuIO dongle. It then sets an RSSI filter using the AT+FRSSI command, which limits scan results to only those devices whose signal strength is above a certain threshold (i.e., closer in physical distance). For example, setting a filter of -76 means the scan will ignore devices with weaker signals (further away) and only show those nearby.
Every 30 seconds, the script initiates a BLE scan using AT+GAPSCAN=3. It parses the output in real time, looking for a specific MAC address. If the device is detected, the system immediately plays a sound to alert the user. This process repeats continuously, offering reliable detection based on proximity rather than just presence.
Important Notes
Serial Port Update the SERIAL_PORT variable in the script to match your operating system:
macOS: Typically /dev/cu.usbmodemXXXX
Windows: Usually COM3, COM4, etc.
MAC Address Replace the default value with the MAC address of your target BLE device.
RSSI Threshold Modify RSSI_FILTER_THRESHOLD at the top of the script to define how close the device must be to trigger the alert. Acceptable values range from -1 (very strong signal) to -99 (very weak).
Sound File Make sure the beep sound file (e.g., beep.wav) is present in the same folder as the script.
You can find the complete Python script with configuration options and logic here:
import platform
import serial
import time
import subprocess
if platform.system() == "Windows":
import winsound
# ==== CONFIGURATION ====
SERIAL_PORT = '/dev/cu.usbmodem4048FDEBA6D01' # Update as needed
#SERIAL_PORT = "COM8" # Update as needed
BAUD_RATE = 9600
TARGET_DEVICE_MAC = "D0:76:50:80:15:32"
SOUND_FILE = "beep.wav" # Must exist in the same folder
# RSSI filter threshold: Acceptable range is -1 to -99
RSSI_FILTER_THRESHOLD = "60" # You can input without '-' sign
# ========================
def play_beep():
try:
if platform.system() == "Windows":
winsound.PlaySound(SOUND_FILE, winsound.SND_FILENAME)
else:
subprocess.call(["afplay", SOUND_FILE])
except Exception as e:
print(f"Failed to play sound: {e}")
def connect_to_bleuio():
try:
ser = serial.Serial(SERIAL_PORT, BAUD_RATE, timeout=1)
time.sleep(2)
# Send basic AT to wake up
ser.write(b"AT\r\n")
time.sleep(0.5)
# Ensure threshold has leading '-'
rssi_value = RSSI_FILTER_THRESHOLD
if not rssi_value.startswith("-"):
rssi_value = "-" + rssi_value
command = f"AT+CENTRAL\r\n".encode()
ser.write(command)
print(f"BleuIO set to central role\n")
time.sleep(0.5)
# Send AT+FRSSI command
command = f"AT+FRSSI={rssi_value}\r\n".encode()
ser.write(command)
print(f"RSSI filter set to {rssi_value} dBm\n")
time.sleep(0.5)
return ser
except Exception as e:
print(f"Error connecting to BleuIO: {e}")
return None
def scan_for_device(ser):
ser.write(b"AT+GAPSCAN=3\r\n")
end_time = time.time() + 5
while time.time() < end_time:
if ser.in_waiting:
line = ser.readline().decode(errors="ignore").strip()
print(line)
if TARGET_DEVICE_MAC in line:
print("Target device found! Triggering alert...")
play_beep()
print("Scan complete.\n")
def main():
ser = connect_to_bleuio()
if not ser:
return
print("Connected to BleuIO. Starting periodic scan...\n")
while True:
scan_for_device(ser)
time.sleep(30)
if __name__ == "__main__":
main()
Conclusion
This BLE proximity alert system is a great example of using signal strength (RSSI) to filter and detect nearby Bluetooth devices. It’s a lightweight, effective solution that can be easily customized for different applications—from home automation to enterprise access control. The source code is entirely open and flexible, allowing anyone to adapt it for their own use cases and expand it with additional features such as logging, notifications, or integration with cloud services.
This is an example project—but the building blocks can easily become part of something much bigger.
Monitoring nearby Bluetooth Low Energy (BLE) devices is essential for developers, testers, and engineers working with IoT, smart sensors, or proximity-based applications. To simplify this process, we’ve developed a visual tool—BLE Star Topology Visualizer—that connects to a BleuIO USB dongle and graphically maps nearby advertising BLE devices using RSSI-based distance estimation. This project not only provides a live BLE scan but also visualizes the proximity of devices in a central-node star topology.
What This Tool Does
The BLE Star Topology Visualizer is a web-based application that:
Connects to a BleuIO USB dongle via Web Serial API.
Performs a BLE GAP scan using AT+GAPSCAN=x to detect nearby BLE devices.
Displays detected devices as nodes around the central BleuIO dongle.
Uses RSSI (Received Signal Strength Indicator) to:
Color-code devices (green = strong signal, red = weak signal).
Adjust the visual distance from the center (closer = stronger signal).
Shows device MAC address, RSSI, and name (if available) in a tooltip on hover.
Requirements
To use this BLE Star Topology Visualizer, you’ll need a BleuIO USB dongle, which acts as the central scanning device. The dongle is responsible for performing GAP scans and returning nearby Bluetooth advertising data, including RSSI values and device names. No additional drivers or installations are needed—just plug in the BleuIO dongle, open the web app in a supported browser, and you’re ready to start scanning and visualizing.
Why This is Useful
BLE developers often depend on terminal-based command outputs to monitor advertising packets from nearby devices. While functional, this raw data can quickly become difficult to interpret—especially in environments with dozens of concurrent BLE signals. The BLE Star Topology Visualizer simplifies this challenge by transforming complex scan results into an interactive graphical map. It offers an immediate visual representation of proximity, density, and signal strength, helping developers, testers, and engineers better understand their BLE environment at a glance. Whether it’s estimating coverage, validating signal strength, or analyzing deployment patterns, this tool bridges the gap between data and insight.
Use Cases
This visualizer can serve many real-world needs. In a smart office or industrial IoT setup, it helps pinpoint where BLE beacons or sensors are broadcasting from, enabling better device placement and coverage optimization. During security audits, it offers a quick way to detect and identify all BLE devices within range, helping spot unauthorized transmitters. In educational settings, instructors can use it to demonstrate how RSSI reflects signal strength and how Bluetooth devices advertise themselves. Additionally, developers working on new BLE-enabled hardware can use this tool for field testing, validating how their products behave under various proximity and interference conditions.
How It Works
1. BLEUIO Setup
The script utilizes BleuIO AT commands. Once connected, the script sends the following:
AT+CENTRAL to switch to scanning mode.
AT+SHOWRSSI=1 to prepare BLEUIO to show RSSI in output.
AT+GAPSCAN=5 to scan for 5 seconds and return a list of advertising devices.
2. GAP Scan Output Parsing
The GAP scan output is parsed using a regex pattern that extracts:
RSSI value
MAC address
Optional device name (e.g., “(HibouAIR)”)
If the same MAC appears multiple times (with and without name), the version with the name is prioritized and stored.
3. Visualization with D3.js
Using D3.js, the central node (BleuIO) is placed in the center. Each nearby device:
Appears as a circle node around it.
Is connected with a line whose length is proportional to the RSSI (inverted and scaled).
Shows color-coded signal strength:
Green: Strong RSSI ≥ -50
Yellow: Medium RSSI > -70
Red: Weak RSSI ≤ -70
A tooltip displays full device info (MAC, RSSI, and name) when hovered.
The BLE Star Topology Visualizer is a powerful yet simple tool that turns your BLE scan into an interactive experience. Whether you’re debugging, teaching, or optimizing device placement, this script offers a real-time glimpse into the invisible world of Bluetooth communication.
Bluetooth Low Energy (BLE) has become the backbone of modern wireless communication for low-power IoT devices. One of its core features — advertising — allows BLE devices to broadcast information without the need for pairing or a connection. From contact tracing to proximity marketing and sensor broadcasting, BLE advertising powers many real-world applications.
What Is BLE Advertising?
BLE advertising is a mechanism where a device sends out small packets of data at regular intervals to announce its presence. These packets are picked up by nearby BLE-capable central devices (e.g., smartphones, gateways, computers).
A typical BLE advertisement packet contains:
Flags: Indicating capabilities like discoverability
Local Name: Device name (optional)
Service UUIDs: Describing the services the device supports
Manufacturer Specific Data: Custom payload defined by the manufacturer
Other fields: e.g., TX Power, service data, etc.
The total payload size is limited to 31 bytes, which includes all AD (advertising data) fields. Crafting this data properly is crucial to avoid errors and ensure compatibility with BLE scanners.
BLE Advertising with BleuIO and AT Commands
Traditionally, crafting BLE advertising packets required working with complex SDKs or embedded C libraries. But with BleuIO, things are much simpler — thanks to its powerful AT command set.
Here are two useful AT commands for advertising:
AT+ADVDATA= sets the advertising payload using a colon-separated hex format
AT+ADVSTART starts broadcasting the advertising packet
Example:
AT+ADVDATA=07:FF:5B:07:01:02:03:04
AT+ADVSTART
This advertises a Manufacturer Specific Data block:
07: Total length of this AD field
FF: Type = Manufacturer Specific
5B07: Manufacturer ID (Smart Sensor Devices)
01020304: Custom payload
Using this simple format, you can test different advertising payloads, simulate sensor broadcasts, or even debug BLE scanning applications.
A Web Tool for BLE Advertising
To make things even easier, we’ve created a web-based BLE advertising builder that works right inside your browser.
Lets you connect to your BleuIO dongle directly from the browser
Offers two modes:
Builder Mode: Enter data by field — length, type, manufacturer ID, and custom payload
Raw Mode: Paste a full, colon-separated advertising packet directly
Automatically sends AT+ADVDATA and AT+ADVSTART commands
Displays real-time feedback from BleuIO (e.g., OK, INVALID PARAMETER)
Includes built-in validation so you don’t exceed the 31-byte BLE limit
Use Cases
Whether you’re a developer, educator, or BLE hobbyist, this tool is perfect for:
✅ Rapid testing of advertising formats
✅ Simulating BLE sensor outputs (like HibouAir)
✅ Learning how BLE advertising packets are structured
✅ Teaching BLE fundamentals without needing mobile apps or complex tools
BLE advertising is a critical piece of the Bluetooth ecosystem, and mastering it opens up a world of possibilities. With BleuIO’s simple AT interface and our new browser-based payload builder, creating, testing, and learning BLE advertising has never been easier.
Bluetooth Low Energy (BLE) has become the backbone of modern wireless devices, powering everything from fitness trackers and smart home devices to environmental sensors and industrial monitors. One of the most important enhancements to BLE came with the introduction of Bluetooth 5.0: extended advertising. While legacy BLE advertising served many applications well, it had limitations that became apparent as developers tried to broadcast richer and larger amounts of data. With extended advertising, BLE has unlocked a new level of flexibility and power.
In this blog, we will explore what BLE extended advertising is, why it is important, how it differs from legacy advertising, and what types of use cases it enables. We will then show how the BleuIO Pro USB dongle supports extended advertising, and we will walk through two real-world experiments: first, using a Google Pixel 7 to advertise extended packets and scanning them with BleuIO Pro, and second, using BleuIO Pro itself to advertise extended packets. This hands-on approach will help illustrate how extended advertising works in practice.
What Is BLE Extended Advertising?
BLE devices advertise their presence and capabilities through short packets called advertising packets. Prior to Bluetooth 5.0, these packets were limited to a maximum of 31 bytes and were transmitted over three primary advertising channels (37, 38, and 39). While this was adequate for broadcasting a device name, some flags, and perhaps a small amount of service or manufacturer data, it quickly became insufficient for more advanced use cases.
Bluetooth 5.0 introduced extended advertising, it increases the maximum data payload from 31 bytes to up to 255 bytes in a single extended packet, and with chained packets, it can go up to approximately 1650 bytes. This innovation allows devices to broadcast richer datasets without needing to establish a BLE connection, saving power and improving efficiency.
Why Do We Need Extended Advertising?
As BLE has matured, the demand for more capable broadcasting has increased. Environmental sensors often need to transmit multiple data points, such as temperature, humidity, CO2 levels, and battery status. Asset trackers may need to include an identifier, timestamp, status code, and other metadata. Legacy BLE advertising simply cannot fit this level of information into its small packet size.
Extended advertising solves this problem by allowing significantly larger payloads, making BLE suitable for use cases where connectionless communication is preferred. It also helps reduce interference on the crowded 2.4 GHz band by moving much of the advertising traffic to secondary channels. Overall, extended advertising expands the potential of BLE in both consumer and industrial applications.
What Is the Difference Between Legacy and Extended Advertising?
Legacy BLE advertising uses 31-byte packets on the three primary advertising channels. It is supported on almost all BLE devices, making it extremely compatible but also quite limited. Extended advertising, on the other hand, allows devices to broadcast on secondary channels and increases the maximum payload size to 255 bytes per packet, or even over 1600 bytes when chaining is used. Extended advertising is only available on devices with Bluetooth 5.0 or later.
Where legacy advertising only offers basic modes like connectable, scannable, and non-connectable, extended advertising introduces advanced modes, including periodic advertising. This flexibility allows developers to optimize their broadcasts for speed, range, or robustness.
Real-World Use Cases
Extended advertising opens the door to many exciting applications. Smart environmental sensors can broadcast detailed data snapshots without requiring a connection, reducing power consumption and simplifying deployments. Asset tracking devices can send rich identifiers and telemetry data. Smart lighting systems can broadcast control profiles or diagnostics. Even firmware updates or broadcast-based messaging become more practical with extended advertising. These capabilities make extended advertising a game changer for IoT, industrial monitoring, logistics, and smart city deployments.
How We Used the Pixel 7 to Advertise Extended Packets
To explore extended advertising in practice, we started with a Google Pixel 7 smartphone running Android 13, using the nRF Connect app to configure and broadcast extended advertising packets. Inside the app, we created a new advertiser and carefully adjusted the settings. We enabled Extended Advertising and disabled Legacy Advertising to ensure we stayed in BLE 5.0 mode. We set the advertising properties to connectable and scannable and prepared a payload that combined a Complete Local Name along with several Manufacturer Specific Data blocks.
Our goal was to simulate realistic sensor readings, so we included data blocks such as Temp:24.5, Hum:55.6, PM2.5:15.2, and CO2:440, along with several test tags for demonstration purposes.
When we scanned this advertising payload using BleuIO Pro, we observed a total payload length of approximately 141 bytes, which is well above the 31-byte limit of legacy BLE advertising and only possible thanks to Bluetooth 5.0 extended advertising.
Before scanning with the BleuIO Pro dongle, we had to enable extended scan results. This was done using the ATES command:
ATES=1
This toggle turns on extended scanning, which is off by default. Once enabled, we scanned for the Pixel 7’s MAC address using:
AT+SCANTARGET=[1]MAC_ADDRESS=4
We were then able to see the full advertised data on the BleuIO Pro side, confirming that the Pixel 7 was successfully broadcasting extended advertising packets.
How We Used BleuIO Pro to Advertise Extended Packets
Next, we set out to test BLE extended advertising in the other direction: advertising from the BleuIO Pro dongle itself.
We began by configuring the advertising parameters with the following command:
AT+ADVEXTPARAM=0=1=0=160=320=7=0=0=0=1=0=1=0=0
Here’s what these parameters mean:
HANDLE: 0 — the advertising handle we are configuring.
mode: 1 — general discovery mode.
properties: 0 — non-connectable and non-scannable, which allows maximum payload.
primary_intv_min / max: 160 / 320 — the minimum and maximum advertising interval.
primary_channel_map: 7 — enabling all three primary advertising channels.
local_addr_type: 0 — using a public address.
filt_policy: 0 — no filtering policy.
tx_power: 0 — default transmit power.
primary_phy / secondary_phy: 1 — using the 1M PHY on both primary and secondary channels.
This payload contained a Complete Local Name block and repeated Manufacturer Specific Data blocks, again simulating sensor readings and test data. When we scanned this advertising from the Pixel 7 using nRF Connect, we were able to see the full payload, confirming that BleuIO Pro was successfully broadcasting extended packets.
Final Thoughts
BLE extended advertising represents a major advancement for Bluetooth Low Energy technology. By lifting the 31-byte payload limit and moving traffic onto secondary channels, it enables a wide range of applications that were previously impractical or impossible.
Through our experiments using the Pixel 7 and BleuIO Pro, we were able to demonstrate both advertising and scanning of extended packets, providing a solid foundation for developers and enthusiasts interested in exploring this powerful feature. Whether you are working on smart sensors, asset trackers, or industrial devices, understanding extended advertising will allow you to push the boundaries of what BLE can achieve.
We look forward to seeing how you apply this technology in your own projects. If you have screenshots, data examples, or need help integrating extended advertising into your applications, feel free to reach out — we’d be happy to collaborate or offer advice.
At BleuIO, we aim to provide versatile, easy-to-use Bluetooth Low Energy (BLE) solutions that can run across a wide range of platforms. Today, we’re excited to showcase a new environment where BleuIO works perfectly: the CoreMP135 from M5Stack Technology Co., Ltd.
We tested running our BLE sniffer script on this compact Linux industrial controller — and it worked seamlessly.
You can find the BleuIO Pro USB Dongle available for purchase here on DigiKey.
About CoreMP135
The CoreMP135 is a highly integrated Linux-based industrial control host powered by the STM32MP135DAE7 chip. It features a single-core ARM Cortex-A7 processor running at up to 1 GHz and is equipped with 4Gb (512MB) of DDR3L SDRAM.
Key highlights include:
Dual Gigabit Ethernet interfaces
USB 2.0-A and USB-C ports
CAN FD, RS485, and Grove I2C/UART connectivity
2.0-inch IPS capacitive touchscreen
1W speaker for audio output
Low-power design with a built-in RTC and rechargeable battery support
Pre-installed Debian Linux system on MicroSD — ready for development right out of the box
DIN rail mounting support for industrial installations
You can find the CoreMP135 available for purchase here on DigiKey.
Running BleuIO on CoreMP135
Using one of the CoreMP135’s USB ports, we connected the BleuIO dongle. After installing Python and the required libraries, the device immediately recognized BleuIO as a USB serial device.
We ran our BLE sniffer script without any issues.
Steps to Setup:
Plug the BleuIO dongle into one of the USB-A ports.
It’s lightweight, fast, and ideal for quick deployments or prototyping BLE-based solutions.
Output
Use Cases: Why Run BleuIO on CoreMP135?
Pairing BleuIO with the CoreMP135 opens up a range of practical applications across industries. In industrial environments, the setup can be used for continuous BLE monitoring, where devices like temperature or air quality sensors broadcast data that can be captured and logged locally. With its dual Gigabit Ethernet ports and USB connectivity, CoreMP135 serves well as a lightweight BLE-to-cloud gateway, collecting data from nearby BLE devices and forwarding it to cloud platforms for further analysis or real-time dashboards.
This setup also proves valuable for conducting Bluetooth security audits, allowing developers and testers to passively capture BLE advertisements and analyze potential vulnerabilities in connected devices such as wearables, beacons, or smart home equipment. For IoT developers, it provides a rapid prototyping platform where BLE applications can be built and tested without needing bulky workstations or cloud servers. And in the smart home space, CoreMP135 can act as a local BLE hub that listens for sensor data—such as motion, humidity, or presence—then triggers automation workflows through integrated edge logic.
The CoreMP135 from M5Stack is a powerful, compact Linux host, perfect for running BleuIO-based applications. This platform proves that BleuIO can operate smoothly not just on desktops or laptops, but also on rugged, embedded, and industrial devices.
Whether you’re building a smart factory solution, a BLE gateway, or simply experimenting with Bluetooth technology, the combination of BleuIO and CoreMP135 provides flexibility, reliability, and ease of deployment.