r/raspberry_pi • • 9d ago

Show-and-Tell Turned a $30 Bluetooth pixel clock into a smart weather clock with my Pi

Post image

A few months ago I ordered this $30 pixel clock on Amazon: https://www.amazon.com/dp/B0GY3BX9QC

It has a 32x16 LED matrix and is advertised as programmable but the customization is limited to a list of presets in the companion mobile app. And it loses time whenever there is a power outage, requiring me to manually connect over Bluetooth in the app to re-sync the time.

Since I didn't love any of the presets, I gave the app APK to Claude and asked it to reverse engineer the Bluetooth communication. It successfully did so and now I can fully manage the clock without the app, including updating the display, adjusting LED brightness, and syncing the time.

The code for controlling the clock and instructions to use it are on GitHub: https://gist.github.com/t1m0thyj/4445e29c1520ac2764489865ae40da86

Now I have the following automations powered by the iledclock.py driver script on my Pi 3:

  • Background image is refreshed every 30 min to show weather info (current temperature and 2-frame animation of conditions), which is retrieved with the free OpenMeteo API.
  • Brightness is adjusted to match ambient brightness in the room, using gpiozero.LightSensor to read data from an LDR (Light-Dependent Resistor).
  • Time is synced when the clock controller script starts (whenever the Pi reboots after a power outage), and every 24 hours to prevent clock drift.

I've not shared the code for these automations yet, as they are heavily customized for my setup (e.g., the LDR readings are shared by another Python script over a socket). But I'll share relevant snippets if anyone is interested.

121 Upvotes

13 comments sorted by

8

u/Gizmo45 9d ago

How does the Pi control it? Is it mounted inside the enclosure? 

6

u/Cinderhazed15 9d ago

They said they reverse engineered the Bluetooth protocol - I’m guessing they use Bluetooth on the pi to control it.

6

u/t1m0thyj 9d ago

Correct, it would be cool to have the Pi inside the clock but I'm controlling it remotely over Bluetooth from a Pi 3 that I use as my home automation hub, and have not made any hardware changes to the clock itself.

4

u/N72826 8d ago

I recently did the same thing for my aquarium lights!

3

u/t1m0thyj 8d ago

Saw your post, thanks for sharing! I didn't expect reverse engineering to be so easy but am tempted to try it with Govee smart lights next.

3

u/viper2035 8d ago

Very cool project. Do you have any interest to make an home assistant add-on for the display?

2

u/t1m0thyj 8d ago

No I don't have Home Assistant set up, but I like this idea a lot! If anyone has interest in porting the script to HA feel free.

3

u/lamyjf 8d ago

Would be nice to just use the clock as a countdown timer, can that be done? (no need for the bottom part.)

3

u/t1m0thyj 8d ago

Updated the gist to include commands for alarms, stopwatch, and countdown timers. Haven't tested it yet but expect it to work as these commands follow the same pattern as the default clock function.

2

u/t1m0thyj 8d ago

It should be, there's a Countdown timer function in the phone app. I didn't reverse engineer all of the widgets but can try that one tonight after work.

2

u/Zealousideal_Ad5358 6d ago
  1. How do you get an APK file off an iPhone these days? Does it still get backed up to your computer as an APK file?
  2. I thought Claude would refuse to reverse engineer proprietary software. 

2

u/t1m0thyj 6d ago

I don't know how to back up an APK from my Android phone. Downloaded it from a mirror (APKPure) on desktop and the link is in the gist.

Claude does have guardrails around this but they seem weak. When I asked it to reverse engineer the Bluetooth interface, it first tried to install a Java package to do this and failed because it decided that was an unsafe command. I didn't have to push it to try harder, it automatically fell back to installing a Python package to do the job instead.

3

u/dearmash 8d ago

I have a different clock I use webserial to connect to over bt from the browser, I'll have to try and see if I can get that working with this also.

Thanks for the write up!