Reverse engineering a BLE clock - Perfect Time
Linux Magazine|#272/July 2023: Open Data
What do you do when all your Bluetooth clocks show slightly different times? With some reverse engineering, you can write a Python program to synchronize your clocks.
Koen Vervloesem
Reverse engineering a BLE clock - Perfect Time

A while ago, I bought a ThermoPro TP358, a Bluetooth Low Energy (BLE) digital thermometer with a display. The ThermoPro shows the temperature, humidity, and air comfort indicator, as well as the time and day of the week. Its big display is nice for immediate feedback, but the device also lets you read its values and view graphs in the ThermoPro Sensor app, available on Android and iOS (Figure 1). Moreover, every time you connect to the device with the app, it synchronizes the time.

While that is a nice feature, I have a couple of other types of Bluetooth sensors with a clock, and I didn’t want to use multiple apps to view the sensor measurements and synchronize the clocks. For the sensor measurements, a solution already exists: Software such as Home Assistant [1] supported my devices out-of-the-box, letting me view their measurements in Home Assistant’s dashboard. However, I couldn’t find any solution that let me synchronize the time across all of my Bluetooth clocks without using the individual apps.

From past experience reverse engineering other Bluetooth devices, I knew that it should be possible to intercept the synchronization commands between my Android phone and the clock. My plan was to figure out the meaning of the commands and then reimplement the same time synchronization command in a Python script that I could run once a day on a Raspberry Pi. This article describes how I did this for the ThermoPro TP358, but you can use the same procedure with any other BLE device.

Investigating BLE Traffic Logs

Diese Geschichte stammt aus der #272/July 2023: Open Data-Ausgabe von Linux Magazine.

Starten Sie Ihre 7-tägige kostenlose Testversion von Magzter GOLD, um auf Tausende kuratierte Premium-Storys sowie über 8.000 Zeitschriften und Zeitungen zuzugreifen.

Diese Geschichte stammt aus der #272/July 2023: Open Data-Ausgabe von Linux Magazine.

Starten Sie Ihre 7-tägige kostenlose Testversion von Magzter GOLD, um auf Tausende kuratierte Premium-Storys sowie über 8.000 Zeitschriften und Zeitungen zuzugreifen.

WEITERE ARTIKEL AUS LINUX MAGAZINEAlle anzeigen
URL filtering with Pi-hole Into the Funnel
Linux Magazine

URL filtering with Pi-hole Into the Funnel

Supporting browser plug-ins, network-based DNS blockers like Pi-hole help protect you against online tracking and unwanted content.

time-read
10+ Minuten  |
#274/August 2023: The Best of Small Distros
Artificial intelligence on the Raspberry Pi Learning Experience
Linux Magazine

Artificial intelligence on the Raspberry Pi Learning Experience

You don't need a powerful computer system to use Al. We show what it takes to benefit from Al on the Raspberry Pi and what tasks the small computer can handle.

time-read
7 Minuten  |
#274/August 2023: The Best of Small Distros
MakerSpace Manage your greenhouse with a Raspberry Pi Pico W Sheltered Growth
Linux Magazine

MakerSpace Manage your greenhouse with a Raspberry Pi Pico W Sheltered Growth

You can safely assign some greenhouse tasks to a Raspberry Pi Pico W, such as controlling ventilation, automating a heater, and opening and closing windows.

time-read
7 Minuten  |
#274/August 2023: The Best of Small Distros
Control Center
Linux Magazine

Control Center

Tipi gives you complete control of more than 100 applications and services. A mouse click is all it takes to install the apps.

time-read
6 Minuten  |
#274/August 2023: The Best of Small Distros
In One Fell Swoop
Linux Magazine

In One Fell Swoop

Topgrade detects all the package managers installed on a system and executes them one by one at the command line.

time-read
3 Minuten  |
#274/August 2023: The Best of Small Distros
Go Faster!
Linux Magazine

Go Faster!

The fastest way through a curve on a racetrack is along the racing line. Instead of heading for Indianapolis, Mike Schilli trains his reflexes with a desktop application written in Go, just to be on the safe side.

time-read
9 Minuten  |
#274/August 2023: The Best of Small Distros
Math Magic
Linux Magazine

Math Magic

MathLex lets you easily transform handwritten math formulas to digital format and use them on the web.

time-read
5 Minuten  |
#274/August 2023: The Best of Small Distros
Custom Repair Toolkit
Linux Magazine

Custom Repair Toolkit

You can do more with System Rescue than just repair broken systems. By adding tools and scripts, you can create a custom rescue environment that meets your needs.

time-read
8 Minuten  |
#274/August 2023: The Best of Small Distros
At Your Disposal
Linux Magazine

At Your Disposal

Debvm lets you quickly create a temporary virtual machine with a small memory footprint, ideal for testing scripts or mixing repositories

time-read
4 Minuten  |
#274/August 2023: The Best of Small Distros
A Fresh Breeze
Linux Magazine

A Fresh Breeze

Vanilla OS, an immutable filesystem, seamlessly integrates applications from other distributions with an innovative container-based package manager.

time-read
5 Minuten  |
#274/August 2023: The Best of Small Distros