Bluetooth Low Energy (BLE) is the same short-range wireless technology used by wireless earbuds and fitness trackers — it's built to sip very little power. The Nordic UART Service (NUS) mode covered here turns that connection into something that feels just like a serial cable (the same kind you'd use to print text to your computer), except wireless: your board can send and receive plain text to a nearby phone, tablet, or computer using low power consumption.
1. Real-World Uses
BLE UART is the easiest way to get short-range, low-power wireless text/number exchange between your board and a phone:
- A wireless "serial monitor" — read your project's sensor values from your phone, standing across the room, without a USB cable.
- Simple remote control apps — pair a generic BLE terminal app (or a custom-built one) with your robot/project to send commands like "forward" or "stop" from a phone screen.
- Telemetry without any Wi-Fi network — great for demos in places with no Wi-Fi (a classroom, a science fair booth), since BLE just needs the two devices near each other, no router or password.
- Battery-friendly wearables and remotes — BLE uses far less power than Wi-Fi (Section 7.1), making it a better fit for small battery-powered gadgets that need to last for days, not hours.
2. Specifications & Service UUIDs
- Compatible Boards: ESP32, Raspberry Pi Pico W, Pico 2 W.
[!IMPORTANT] Real BLE functionality is ESP32-only in C++. Every block below cleanly no-ops on a Pico board compiled to C++ (an empty statement, or a hardcoded
falsefor the "Is Connected?" check) — Pico W/2W only get real BLE behavior in MicroPython mode.
- Conflicts with: BLE HID and ESP-NOW (Sections 7.4/7.2) — you can't use this extension's blocks alongside either of those in the same project.
- UUIDs (Nordic UART Service Standard):
- Service UUID:
6E400001-B5A3-F393-E0A9-E50E24DCCA9E - TX Characteristic:
6E400003-B5A3-F393-E0A9-E50E24DCCA9E— Notify (MicroPython also allows Read on this one; the C++ side only ever declares Notify) - RX Characteristic:
6E400002-B5A3-F393-E0A9-E50E24DCCA9E— Write
- Service UUID:
3. How it Works (Auto-Detecting Message Dispatch)
Unlike ESP-NOW's explicit S:/N:/V: tag prefixes (Section 7.2), BLE UART auto-detects what kind of message just arrived, and can fire more than one receive-event block for the same incoming message:
- The String Received handler always fires for anything received.
- If the text also parses cleanly as a number, the Number Received handler also fires with that value.
- Otherwise, if the text contains a
:(and isn't a valid number), the Key-Value Received handler fires instead, splitting on the first:.
So sending "25.5" fires both String and Number Received; sending "Temp:25.5" fires String and Key-Value Received; sending "hello" fires only String Received.
