Lab

A web-page Bluetooth remote for the HM-10

A remote that is a web page: tap Connect, pick your HM-10, and hold an arrow to drive. Nothing to install. It works in Chrome or Edge on Android and on a laptop, in Samsung Internet, and on an iPhone through the free Bluefy browser. Not in Safari or Firefox.

It talks to any HM-10, or a BLE clone that carries its serial data on service FFE0, characteristic FFE1. Holding an arrow sends its letter every 150 ms; letting go sends one S. The slider sends a digit from 0 to 9, and any line your Arduino sends back appears in the box at the bottom. Test it with the car’s wheels in the air first.

Bluetooth remote (HM-10)

Not connected.

What this shows

A web page can talk to a Bluetooth Low Energy module such as the HM-10 through Web Bluetooth. It takes five calls in order: ask for a device, connect to it, open the serial service FFE0, take the characteristic FFE1, then write letters to it and listen for its notifications.

Web Bluetooth works in Chrome and Edge (desktop and Android), Opera and Samsung Internet. Safari on the Mac and the iPhone, and Firefox, have none; on an iPhone the free Bluefy browser bridges to Bluetooth. Browsers implement it for BLE only, so a Classic module such as the HC-05 or HC-06 can never connect from a web page.

The browser enforces three rules, and each one looks like a page that does nothing. The device chooser only opens from a tap, never on page load. The page must come from https:// or http://localhost, or navigator.bluetooth is missing. And Chrome rejects a write while another is still going, with 'GATT operation already in progress', so the remote keeps a queue and sends one letter at a time.

While an arrow is held, the remote sends its letter every 150 ms, so a car with a fail-safe that stops when the letters stop keeps moving only while your finger is down. Letting go, or switching to another app, sends one S.

Bluetooth delivers bytes, not messages, so a line from the Arduino can arrive split across two notifications. The remote buffers what arrives and shows a line only when its newline comes in.

How it was checked. The page was loaded in headless Chrome with no errors and tested against a simulated radio: hold Forward and it sends F every 150 ms, release and it sends one S, and a reply split across two packets shows as one line. It has not yet been run against a real HM-10. If yours behaves differently, write to me at [email protected] and say what the status line says.

Building the car from Build a Car With Your Kid? Use its own remote instead →
Make It Connect, the book this remote comes from →

Common questions

Why does the Connect button do nothing on my iPhone?
Safari has no Web Bluetooth, and neither does any other ordinary iPhone browser. Open the same page in the free Bluefy browser, which bridges to Bluetooth.
Can a web page connect to an HC-05 or HC-06?
No. Browsers implement Web Bluetooth for Bluetooth Low Energy only, and the HC-05 and HC-06 are Classic Bluetooth modules. Use a BLE module such as the HM-10, or a Classic app on Android.
Why does the chooser list my module but the page says service not found?
The page looks for the HM-10's serial service, FFE0, and characteristic FFE1. Some clones use other numbers. Read your module's service in an app such as nRF Connect and use those instead.
Do I need to pair the HM-10 in my phone's Bluetooth settings first?
No. The page connects to it directly. A phone that has paired it in its settings can keep hold of it, and then the page can't find it: forget it in the settings and try again.