You are browsing as a guest. Sign up (or log in) to start making projects!

oral-b Library

  • 3 Devlogs
  • 13 Total hours

A Node.js library for bidirectional BLE communication with Oral-B smart toothbrushes! Discover and connect to brushes, read brushing data, and send commands like mode changes and light control.

Open comments for this post

7h 17m 26s logged

Been a while! Most of this 7 hours was spent digging through the source code of the Oral-B codebase again, but I finished implementing a Bluetooth command transport layer and added a command handler for easy additions. I also implemented protocol versioning, which each brush specifies in its manufacturer data so the host knows what commands/values are available for the brush. In most cases, the newer the brush model (especially in the iO series of brushes), the higher the protocol, resulting in more available commands / data values to read from.

I’ve also added the first incoming command: batteryLevel! This method requests battery data from the brush, and depending on the protocol version of your brush, you’ll be able to view info like the battery percentage, estimated runtime, and even the technical specifications of the battery (like voltage, current, temperature, etc).

From here on, all I’ll be doing is adding more support for commands!

0
0
1
Open comments for this post

2h 10m 30s logged

It’s been a while but I’m back!

I made huge changes to the overall layout of the library, and decided that…

  • Brush objects are the devices themselves, and will allow you to connect, disconnect, view its state, send/receive BLE commands, etc.
  • OralBClient will only act as a “discovery layer”, which lets you search for new Brush objects and keep track of your connections (like a “management” layer I guess you could call it???)

I finished building the connect/disconnect commands with an optional timeout option for connections, and I moved rssi and macAddress into getters so they’re read directly from the peripheral and update automatically. Had to switch to the @stoprocent/noble fork because the previous one caused issues with discovery in Fedora.

In OralBClient, I added a way to track the brushes and store the connected ones in a Map (so users don’t have to keep track of the Brush objects elsewhere). I also added the option to stop discovery early, and an adapter state check before it starts discovering (so it waits for the Bluetooth adapter to power on first!)

0
0
4
Open comments for this post

3h 32m logged

First devlog! Spent a LONG time exploring the Oral-B app codebase to learn about how devices are discovered, and what bytes are interpreted from the manufacturer data.

So far I’ve built a discover() method which hooks onto the @abandonware/noble library and searches for brushes nearby.

I managed to reverse engineer the manufacturer data payload which let’s me identify the model line of the brush and filter out non Oral-B devices! :D

0
0
3

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…