Dieser Artikel ist älter als zwei Jahre und womöglich veraltet!

My toothbrush streams gyroscope data

Since a few month I own an electrical toothbrush from Phillips called Sonicare HX992B. It connects to an mobile App using Bluetooth that tells you how well you brushed your teeth, shows the orientation in real-time, and also notifies you when to change the brush for a new one.

Phillips Sonicare

I was curious how this exactly works. Since the application uses Bluetooth Low Energy (BLE), I used the nRF Connect app for Android to get a list of advertised services.

Screenshot of nRF connect
Screenshot of nRF connect

Now I had a list of 12 BLE services of which only four are standard services described on bluetooth.com. In addition to well-known services like Generic Access, Generic Attribute, Device Information and Battery Service, also eight custom services exist, that were created by the manufacturer. Every one of the first seven service UUIDs starts with 477ea600-a260-11e4-ae37-0002a5d5000 and ends with a number from 1 to 8 with number 3 missing. An additional eight service has a completely different prefix than the others.

UUIDService
0x1800Generic Access
0x1801Generic Attribute
0x180aDevice Information
0x180fBattery Service
477ea600-a260-11e4-ae37-0002a5d50001Unknown Service 1
477ea600-a260-11e4-ae37-0002a5d50002Unknown Service 2
477ea600-a260-11e4-ae37-0002a5d50004Unknown Service 4
477ea600-a260-11e4-ae37-0002a5d50005Unknown Service 5
477ea600-a260-11e4-ae37-0002a5d50006Unknown Service 6
477ea600-a260-11e4-ae37-0002a5d50007Unknown Service 7
477ea600-a260-11e4-ae37-0002a5d50008Unknown Service 8
a651fff1-4074-4131-bce9-56d4261bc7b1Unknown Other Service

By switching the device on and off, changing the strength and mode and also by changing the brush back and forth, I was able to identify some of the characteristics of the six services. By reverse engineering the code of the Android app using jadx I found information about the session storage and many other things.

ServiceSuffixActionsDescription
Handle (1)4010RWNHandle State: Off(0), Standby(1), Run(2),Charge(3), Shutdown(4) Validate(6), LightsOut(7)
4020R–?
4022R–?
4030R-N?
4040RW-?
4050RW-Current Time (Unix Timestamp)
Brushing (2)4070R-NCurrent session id
4080R–Mode (0x0=Clean, 0x2=White+, …)
4082RWNState (0=Ready, 1=Active, 2=Resume)
4090R-NActive time in seconds
4091R-NMode 2 (0x78=Clean, 0xa0=White+, 0xc8=Gum Health, 0xb4=Deep Clean+)
40a0R-N?
40b0R-NStrength (0,1,2)
40c0R-N?
Session Storage (4)40d0R-NLast session id (e.g. 0x2c05 = 1324)
40d2R–?
40d5RW-Session Type
40e0-WNRequest session (write session id, write 0x00 to 4110, get notification with data here and at 4100)
4100–N?
4110-WNSession Access Control Point
Orientation (5)4120RW-?
4130–NGyroscope Data
4140-WN?
Brush (6)4210R–NFC Tag Version
4220R–? INT8
4230R-NBrush Serial
4240R–Brush Manufacturing Date?
4250R–?
4254R–?
4260R–?
4270R–?
4280R–Brush Lifetime (Seconds)
4290R–Brush Usage (Seconds)
42a0R–Brush Type (None, Adaptive Clean, Adaptive White, Tongue Care, Adaptive Gums)
42a2R–?
42a4R–?
42a6RWN?
42b0R–NFC Payload (always phillips.com)
42c0R–? INT16
74310R–? INT16
4320R–? INT16
4330R–?
4360R–? (Only uses second byte)
84410RW-? INT16
4420RW-? INT32

According to the application sources, the last unknown service is called “Moonshine Streaming” and is used to update the firmware. I agreed with myself to not touch this one, since I could damage the firmware and would need to brush my teeth by hand again.

Since I could see a very course orientation displayed in the app during a cleaning session, I expected orientation data somewhere in the characteristics. I found them in the service 5. Once you enable notifications for the 4130 service, you get a data stream to byte arrays. It turns out, these are indeed the values of the gyroscope.

Gyroscrope
Gyroscope

I created a python library to interface with the toothbrush in Python. Feel free to experiment, find the meaning of the missing services and submit pull requests: https://github.com/joushx/python-sonicare

Weitere Artikel

Apps für Samsung Smart TVs analysieren

Apps für Samsung Smart TVs analysieren

Zurzeit sind Fernseher groß in Mode, die sich mit dem Internet verbinden können und die reine Verwendung als Fernseher um weitere Dienste erweitern.

Auch Apps kann man auf diesen Geräten installieren und so zum Beispiel Videos aus Mediatheken abrufen oder auf Online-Konten zugreifen.

Doch, was …

Johannes Mittendorfer
Johannes Mittendorfer
Ein „Paket-Virus“ analysiert

Ein „Paket-Virus“ analysiert

Alles beginnt mit einer Email, die ich angeblich von „USPS“, der US-amerikanischen Post, erhalten habe. Darin werde ich aufgefordert auf ein Bild zu klicken:

Email

Da ich solchen Emails, GMail hat diese schon in den Spam-Ordner befördert, nie vertraue habe ich mir die Nachricht etwas genauer …

Johannes Mittendorfer
Johannes Mittendorfer
Ampelschaltung mit Arduino

Ampelschaltung mit Arduino

Da ich mich jetzt im Besitz eines Arduino Mikrocontroller-Boardes befinde, nun ein erster Artikel über dieses faszinierende Stück Technik. Mit einem Arduino kann man einfach Elektronik ansteuern, wie zum Beispiel LEDs, Servos, Temperatursensoren usw., indem man ein Programm am Computer programmiert …

Johannes Mittendorfer
Johannes Mittendorfer