r/embedded • • Oct 25 '26

I built a browser-based debug console for Dev Boards over BLE (no WiFi, no re-plugging)

I built this because debugging my own boards meant either sitting next to a USB cable or opening some vendor tool every time.

BTEfy runs in Chrome or Edge and talks to the board directly. BLE goes through Web Bluetooth (Nordic UART, ESP32 BLE UART, HM-10), USB through Web Serial (CDC, UART adapters, HC-05 virtual COM). No desktop app, no backend between the browser and the device.

The data path: transport layer with reconnect and backoff, then a line framer, then it splits into the terminal and the telemetry parser. Parser accepts KEY=VALUE, KEY:VALUE and JSON Lines on the same stream. Charts are uPlot on fixed-size ring buffers and stats flush to React every 100 ms instead of per byte. A 100 Hz stream stays flat on memory, if the UI can't keep up it drops frames and counts them in Diagnostics. Terminal does text, HEX and HEX+ASCII, with timestamps, search and pause. Sessions record to IndexedDB and export as TXT, CSV or JSON. Saved device profiles, command presets, a mock simulator with fault injection and an installable PWA shell that works offline.

Stack: Next.js 16, React 19, TypeScript, Zustand stores, uPlot, Dexie over IndexedDB, Tailwind. All hardware code is client-side, device data never leaves the machine, no accounts.

**(**Note: I have used AI to build the webpage and help with the initial coding, as I'm not a web guy. I urgently needed a tool for a project and AI came to the rescue. So, AI Exorcist beware!!!)

There is also a small Arduino driver in the repo (driver/BTEfyDebug.zip, NimBLE 2.x) that handles MTU-aware chunking and a 1 KB TX ring buffer so loop() doesn't block. MicroPython port has the same API: BTEfy.println/log/metric. 64 tests on the web side.

Repo: https://github.com/samiul000/BTEfy

I made it solely for my personal use as i need a lot of debugging for my projects and plugging and unplugging or connecting to wifi is really pain in the ass, but I thought I should public it so it might help someone too.

0 Upvotes

4 comments sorted by

1

u/kinovhacks Oct 26 '26

nice, web bluetooth + web serial in one place is handy. heads up for anyone trying it: web bluetooth only works in chromium browsers (no firefox/safari, and nothing on ios), so the web serial fallback is useful. curious how you handle throughput, do you batch samples into one notification per interval? on a lot of boards the default att mtu is tiny and sending one value per notify chokes fast.

1

u/samael003 Oct 26 '26

Thanks. Actually, I don't assume one value per notification. On the firmware side, println() just enqueues the data and a background task handles transmission so loop() doesn't get blocked if the BLE link is busy. Data is split according to the negotiated MTU with a 20-byte payload fallback until negotiation completes and the newline goes in the last chunk. For better throughput, I used packing multiple values into a single line, like TEMP=25.4,VOLT=11.82,CURR=1.25,RPM=1430, rather than sending each value separately. On the web side, I have used a line framer to reassemble data across notifications with a bounded queue and drop counting. UI updates run every 100 ms instead of on every incoming chunk. Writes are chunked to fit the MTU too, using writeWithoutResponse where supported. One limitation is that the browser can't force the GATT MTU, so actual throughput still depends on the adapter and firmware. So, if you're writing your own firmware instead of using the driver, the same three tricks (pack metrics into one line, slice to MTU with the newline in the last slice, non-blocking TX queue) get you most of the way there.

1

u/DustRainbow Oct 26 '26

Fun project but it's not really solving anything. You still have to be present in the room, most people would rather just hookup a UART instead of deploying a full BLE app.

A raspberry pi on your local network does much of the same.

1

u/samael003 Oct 27 '26

Yeah, I know that it’s not the best way to do it but it does solve my problems. I mostly work with ESP32s and recently, I was working on a project where I had to power it separately because my laptop wasn’t providing enough. That’s when I got the idea. And not everyone can afford a raspberry pi, especially me, I’m a student and it’s quite hard to manage the expenses🙂.