Direct Bluetooth
Web Bluetooth opens a BLE channel straight from the browser to Leanbot. No MQTT, no backend, no middle server that has to stay alive.
Send serial commands straight to Leanbot over Web Bluetooth, watch ultrasonic distance in real time, then drive the motors and gripper from a single tab.
System / 01
From the BLE radio down to the browser cache. Everything runs in a single tab, with no native install and no middleman.
Web Bluetooth opens a BLE channel straight from the browser to Leanbot. No MQTT, no backend, no middle server that has to stay alive.
Telemetry D<number> is read in real time from Leanbot.pingCm(). Under 15 cm the distance panel turns red and the firmware protection stays armed.
Drive LbMotion from the D-Pad with a 300 ms heartbeat failsafe, plus LbGripper to open or close the gripper from the touch screen.
The Service Worker stores /controller and every one of its chunks, so the control deck still opens without internet. This landing page still needs a connection.
Protocol / 02
TX commands are written as characters to the characteristic that supports write or writeWithoutResponse. RX telemetry arrives over notify as a single line.
Active service UUID
0000ffe0-0000-1000-8000-00805f9b34fb
6e400001-b5a3-f393-e0a9-e50e24dcca9eRX telemetry
D45\nHeartbeat failsafe
300 msWhile a direction button is held, H is sent every 300 ms. Lift your finger → S is sent immediately. If the heartbeat stops, firmware auto-stops before the robot hits anything.
Sequence / 03
Power the robot on and make sure the LB555870 BLE module isn't bound to another device. Turn on Bluetooth on your phone or laptop.
Tap the Connect button, pick Leanbot in the Web Bluetooth chooser, then allow access. The app finds the write and notify characteristics automatically.
Hold a direction button to move — heartbeat H is sent every 300 ms and S fires automatically when you let go. Dial in speed, guard, line follower, and gripper.
Compatibility
Web Bluetooth needs a recent Chrome or Edge and a secure context (HTTPS or localhost). On Android, enable Bluetooth and the Nearby Devices permission. iOS doesn't support Web Bluetooth yet.