📲 BLE Pairing (SPP) — Wireless Terminal
Guide to configure the BLE virtual serial port (SPP) and send commands to the Rinho device from your phone, as if it were a USB cable.
This guide covers BLE SPP pairing (wireless terminal). If you need to configure BLE sensor reading (temperature, humidity, fuel), see the BLE Sensors guide.
🤔 What is BLE SPP for?
The BLE SPP (Serial Port Profile) module allows opening a virtual serial port from the phone to:
- 🔧 Configure the device in the field without a USB cable
- 🐛 Debug in real time (
>SDB1<) viewing the output on the phone screen - 📡 Query sensor, GPS, communications status and more
- 📤 Receive texts from the device (using rules with
@BTHdestination)
BLE SPP works simultaneously with BS/BSW sensors. Enabling CXBTH does not interfere with BLE sensor reading — they complement each other.
🔧 Prerequisites
| Requirement | Detail |
|---|---|
| Device | Spider IoT, Smart IoT or Zero IoT |
| Firmware | With BLE support (see notes per device below) |
| Phone app | Cargando... |
| Range | The phone must be within BLE range (approx. 10-30 meters) |
Firmware per device
| Device | Required firmware | Note |
|---|---|---|
| Spider IoT | .nimble.ota | Load on a partition, switch with >SFRMCP< |
| Smart IoT | .nimble.ota | Load on a partition, switch with >SFRMCP< |
| Zero IoT | Built-in firmware | Turn off WiFi with >SSSWIFPWR00< before using BLE |
Zero IoT: No special firmware needed. Just disable WiFi with >SSSWIFPWR00< and the BLE module will be available.
📶 Configure BLE SPP step by step
Enable CXBTH with name and PIN
Use the CXBTH command to activate SPP:
>SCXBTH1,RINHO_IOT,12345<| Parameter | Value | Description |
|---|---|---|
1 | Enable | 1 = Turn on, 0 = Turn off |
RINHO_IOT | Name | BLE name visible from the phone (up to 16 characters) |
12345 | PIN | Access password (up to 16 characters) |
Without password: If you don’t want to use a PIN, leave the field empty: >SCXBTH1,RINHO_IOT,<. In this case it is not necessary to send QPW when connecting.
Verify configuration
>QCXBTH<Expected response:
>RCXBTH1,RINHO_IOT,12345;ID=...Connect from the phone
- Open Cargando...
- Go to Devices (hamburger menu)
- Select Bluetooth LE
- Search for the device with the configured name (e.g.:
RINHO_IOT) - Tap to connect
Authenticate with QPW
If a PIN was configured, the first message to send after connecting is:
>QPW12345<The device will respond with OK if authentication was successful. From there, any command can be sent as if it were via USB cable.
If QPW is not sent as the first message (when a PIN is configured), the device will ignore all commands.
💡 What can you do via BLE SPP?
Everything the same as via serial cable:
| Action | Example |
|---|---|
| Query version | >QVR< |
| Configure sensors | >SBS00E,AC233FA24B16,10,60,0,INVALID< |
| Query sensors | >QBS00<, >QBS00.temp< |
| Activate debug | >SDB1< |
| Configure rules | >SRL00E;TRG=BS02+;ACC={GCQ00H}< |
| Update firmware | >SFRMM1< |
| Restart device | >SRST< |
📤 Send text to the phone from rules
You can use the @BTH destination in event engine actions to send text to the phone connected via BLE:
// When a beacon is detected, send text to the BLE terminal
>SRL08E;TRG=BS00+;ACC={STX SENSOR DETECTADO;@BTH}<This is useful for:
- Field notifications when an event occurs
- Confirming that a rule triggered correctly
- Real-time visual debugging
⚡ Turn BLE on and off with ignition
In some scenarios it is convenient to turn BLE on only when the vehicle is running to save battery:
// Turn on BLE with ignition ON
>SRL31E;TRG=IGN+;ACC={SCXBTH1}<
// Turn off BLE with ignition OFF
>SRL32E;TRG=IGN-;ACC={SCXBTH0}<The SCXBTH command turns on and off the complete BLE module, so it is not necessary to control BLEPWR separately.
🔧 Troubleshooting
| Problem | Possible cause | Solution |
|---|---|---|
| BLE name doesn’t appear on the phone | CXBTH disabled | Verify with >QCXBTH<, enable with >SCXBTH1,name,pin< |
| Connects but doesn’t respond to commands | Missing QPW authentication | Send >QPWpin< as the first message |
SCXBTH responds ERR | Firmware without BLE support | Spider/Smart: load .nimble.ota. Zero: verify >SSSBTHPWR11< |
| Disconnects frequently | Out of range or interference | Bring the phone closer to the device (less than 10 m) |
| Cannot connect via BLE | WiFi active on Zero IoT | Turn off WiFi with >SSSWIFPWR00< |
Debug (SDB1) shows nothing via BLE | Debug is sent only via USB serial port | Use >SDB0+BLX< for BLE-specific debug, or view the data on the USB cable |
📖 Command summary
| Command | Function | Reference |
|---|---|---|
>SCXBTH1,name,pin< | Enable BLE SPP terminal | CXBTH |
>SCXBTH0< | Disable BLE SPP | CXBTH |
>QCXBTH< | Query SPP configuration | CXBTH |
>QPWpin< | Authenticate via BLE | CXBTH |
>STX text;@BTH< | Send text to BLE terminal | Event engine |
>SSSWIFPWR00< | Turn off WiFi (Zero IoT) | — |
>SSSBTHPWR11< | Turn on BLE (Zero IoT) | — |
🎯 Next steps
- 📡 BLE Sensors — Read temperature, humidity, fuel and presence
- 🚀 Getting Started — Basic device configuration
- 🧠 Event Engine — Create advanced rules
- 📡 BLE Commands — Complete reference for BS, BSW, BE and CXBTH