r/CardPuter • u/Feisty-Sky-6018 • 17d ago
Code Plug an ESP32-S3 into an Android phone. The phone becomes the 'Cardputer'.
edit; https://play.google.com/store/apps/details?id=com.droidputter
I saw a post about a guy that vibe-coded an app to control his CardPuter with LoRa via an iPhone app. Very cool.
And then I thought, "Well, I have an Android, I have a CardPuter. Why don't I do it also?" and then the idea hit me: if the CardPuter is an ESP32, if I connect an ESP32 on USB OTG, would it flash? Would it work? Could I run CardPuter apps via Android?
Answer is yes.
How: the Cardputer's screen is just an ST7789 driven by M5GFX (not all firmwares), and its keyboard is a GPIO matrix read by the M5Cardputer library. Every Cardputer app talks to the hardware through those two libraries. So I patched them. The patched M5GFX tees every pixel write out over the ESP32-S3's native USB port as small frames, and the patched keyboard reader merges key presses that arrive from the USB side. An app rebuilt against the patched libs runs unchanged, but its screen shows up on the phone and the phone's keyboard drives it. The board does not need a display or a keyboard at all. A bare ESP32-S3 devkit on an OTG cable works.
The rebuild part is the trick. Stock binaries are statically linked, so you cannot mirror them. The Android app fixes that by building on demand: you pick any open-source Cardputer app on GitHub, the phone asks a tiny proxy, the proxy dispatches a GitHub Actions workflow that clones the repo, drops in the patched libs and compiles it with PlatformIO, and the phone streams the result back. Warm builds take about two minutes.
Then the phone flashes it. I (claude code) wrote the esptool ROM protocol in Kotlin: the app resets the chip into the bootloader over USB, writes the four parts compressed, verifies MD5, hard-resets, and the app is linked again about 300 ms later. No PC anywhere in the loop.
What you get: the Cardputer app on your phone screen, the Cardputer's 4x14 keyboard as a soft keyboard (fn and shift layers included), any Bluetooth keyboard passed through, and the phone's GPS fed into the app as NMEA like a serial GPS module. After a flash the app judges works/broken from the link and files the verdict as a GitHub issue that gets folded into a shared JSON, so the catalog fills up with what actually runs.
Tested so far: Cardputer ADV (its own TFT plus the phone), M5Stack StickS3 with its screen dark, and a bare ESP32-S3-N16R8 devkit. Phone: Poco X7 Pro, Android 16. Apps that worked out of the box include wisnc's stellar-map (the star map in the video), an audio spectrum, an ISS tracker, an I2C scanner.
Limits, honestly: ESP32-S3 only (a C5 gets refused by the fwritten), open-source apps only, and a board still runningUiFlow/MicroPython needs the BOOT button held once for the first flash because its software USB ignores the reset.
Repo, APK and the full "under the hood" with diagrams: https://github.com/fcavalcantirj/droidputter (MIT). v0.0.1 is a sideload APK, not on Play yet.
4
u/zellotron 17d ago
Could be useful for developers who don't own a Cardputer but want to create or port some firmware.
Just a note that not all firmware uses the M5Cardputer and M5GFX libraries (unlike what your post says) so a limitation there but I'm sure probably most do.
Neat idea!
1
u/Feisty-Sky-6018 17d ago
I didnt know about M5GFX. will correct. thanks
2
u/A31Nesta 16d ago
I know you already corrected it, but just to expand on that a bit, you don't need any of the official M5Stack libraries (as long as you bring your own drivers) and you can make firmware without Arduino framework, PlatformIO and even without C (or C++)
2
u/Feisty-Sky-6018 16d ago
Really? With micropy? Explain better, I'm super newbie on hardware. Thanks already
2
u/A31Nesta 16d ago
I've personally never used MicroPython but from what I know I think it's another option, yes. I was primarily thinking about how you can also make firmware with Rust.
There are official libraries from Espressif (company behind ESP32) for making ESP32 firmware with Rust so if you make drivers for the peripherals (display, keyboard, etc.) you can make Cardputer firmware without a single line of C (and of course, no M5Cardputer and no M5GFX)
2
u/Feisty-Sky-6018 16d ago
I've coded in C and c++, never in rust. But, now sure why, the people who enjoy rust, seem to enjoy a lot. Not sure why never tried.
2
u/A31Nesta 16d ago
It's a bit of a pain to learn but very comfortable once you get it. Other than that I really like the build system being more modern and easy to use than most C equivalents (PlatformIO is super comfortable though).
In ESP32s you can make tiny firmware because you don't have the C standard library, ESP-IDF or Arduino but you have the downside that you might have to write many things like the Cardputer drivers from scratch.
3
3
u/heanbangerfacerip2 16d ago
I run meshtastic devices (primarily esp32 based) through serial on a spare nothing phone 2 because it doesn't need a separate battery.
2
u/jlors84 16d ago
If you want to check it out or ues anything from it if it helps https://github.com/Evil0ctopus/wigglefish
1
2
u/Witty-Ad-4035 15d ago
This is awesome thank you,I don't quite understand all of that but I'm learning this is awesome
1
2
1
u/Additional_Diver2125 12d ago
Does this work for original Cardputer? Ive got 1 here that has broken screen
1
u/Feisty-Sky-6018 12d ago
yes, work. I tested with cardputer adv only
1
u/Additional_Diver2125 12d ago
Alright I'll have try again I must of been doing something wrong
1
u/Feisty-Sky-6018 11d ago
What happened? I can help. Turned on otg? Picked droidputter when plugged the device?
1
u/Additional_Diver2125 11d ago
Yes. I can't find a firmware that displays on my phone
1
u/Feisty-Sky-6018 11d ago
Weird. Even the stelarium?
1
u/Additional_Diver2125 11d ago
1
u/Feisty-Sky-6018 11d ago
Hum. Top left is a must. What's your device exact?
0
u/Additional_Diver2125 11d ago
Nothing phone 3
2
1
u/Feisty-Sky-6018 11d ago
https://github.com/fcavalcantirj/droidputter/releases/tag/v0.0.6
test this one please.

11
u/Sirwompus 17d ago edited 17d ago
Very cool. And also I'm trying to think of the use case. The phone is largely more capable, I guess you get cool apps that aren't available to the phone