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

oral-b Library

  • 7 Devlogs
  • 22 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.

Ship #1

I built a Node.js library for bidirectional Bluetooth communication with Oral-B smart toothbrushes, without needing the app! The most challenging part was definitely reverse engineering the Bluetooth characteristic logic in the Oral-B Android app using jadx.

Since testing out this project may be difficult for obvious reasons (not too many people have an overpriced smart toothbrush xD), the demo link will bring you to a sample demo video of how it works!

  • 7 devlogs
  • 22h
Try project → See source code →
Open comments for this post

1h 41m 36s logged

I spent some time cleaning up the package.json and implementing some bug fixes like adding reads and subscriptions to a queue (since before it would send them at the same time and crash the brush occasionally). Some newer brushes also require an “unlock code” to use the Bluetooth API, so I implemented that too!

The first version is now live on npm.js!

0
0
26
Open comments for this post

3h 48m 24s logged

I’ve finally finished working on the documentation! I also added a commands table in the README.md which lists all of the current commands and a link to their designated Markdown page.

I’m preparing to publish it to npm.js now!

0
0
6
Open comments for this post

1h 50m 58s logged

I finished adding some more commands: deviceState which tells you what “state” the brush is in (running, idle, charging, etc), buttonState which allows you to subscribe to button events and notifies you when the power or mode button was pressed, and brushingTime which allows you to view the live stopwatch as you brush your teeth.

I built a simple demo script to give you all a visual example of how these can be used!

0
0
11
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
3
Open comments for this post

2h 10m 55s 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
5
Open comments for this post

4h 15m 52s 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
4

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…