demo · v138

Web Serial over Bluetooth (Android)

Probe the platform: is Web Serial available, and on Android does it now enumerate Bluetooth SPP serial devices? Hit "request port" to call the API, open a selected port, and write bytes to a real BT-bridged microcontroller.

checking support…

capability probe

navigator.serial user-agent platform android? BT permission API

connected port

statedisconnected transport vendor / product

terminal


      

the code

// Same Web Serial API call on Android 138+ now includes
// Bluetooth-SPP serial devices in the chooser dialog.
const port = await navigator.serial.requestPort({
  allowedBluetoothServiceClassIds: [
    "00001101-0000-1000-8000-00805f9b34fb" // SPP
  ],
});
await port.open({ baudRate: 9600 });
const writer = port.writable.getWriter();
await writer.write(new TextEncoder().encode("HELLO\n"));
writer.releaseLock();

see also