Replacing the firmware on my Eufy C220 camera without touching the flash
I bought a eufy Indoor Cam C220 because it was pretty cheap compared to what you got, and I naively thought I could connect it to my Home Assistant to I could check the cats when I was gone. But no it was entirely locked to the app and getting it to connect to Home Assistant was tedious work that maybe wouldn't even work.
So I just pried it open, extracted the firmware with my T48 Universal Programmer and let deepseek take a look at it. Long story short the result is eufy-c220-open: the camera boots from its SD card into an RTSP server, a web UI, two-way audio and working PTZ. Nothing is written to its flash. Pull the card and it is a stock eufy camera again.
So basically a SD card that jailbreaks your camera, but remove the SD card and it's back to stock. And the secret is just a script called iq.sh.
The way in
The camera is a Rockchip RV1103B: single Cortex-A7, 16 MiB of SPI NOR, 64 MiB
of DDR, uClibc, a 5.10 kernel. The usual routes were closed. UART gives you a
U-Boot log but nothing more, because the boot device tree marks the serial port disabled and the kernel has no console driver built in. U-Boot itself has
bootdelay=0 and its command interface compiled out.
I used tools like moria, mithril and REA to let my agent decompile and analyze the firmware and it found some something absolutely wonderful and horrifying:
in the vendor's app.sh, line 101 runs /mnt/sdcard/iq.sh as root, on every boot, with no signature check. That is an unauthenticated root execution primitive shipped to every owner of the product. It is also the entire basis of this project. I have mixed feelings about that, which is roughly why
SECURITY.md
documents it properly rather than just using it quietly.
Once you can run a script as root from the card, you don't need to touch flash at all. iq.sh starts a telnet daemon and then launches stack.sh, which kills the
vendor app and its supervisors, and brings up the four processes that make up
our stack. Delete one file from the card and the next boot is stock again, with
the vendor app and its cloud account exactly where they were. It isn't really a
firmware modification at all, which is the point.
The code
The code base takes care of the following things:
The watchdog. /dev/watchdog is fed by the vendor's resource scheduler, and it is configured nowayout — 35 seconds after the last write, the SoC resets. Kill the vendor app to free the memory the encoder needs, and you have 35 seconds before the board reboots itself, taking your logs with it. So the fix is that our video producer pokes the watchdog as a side effect of streaming. The consequence is that if anything makes the process hang for more than half a minute results in a reboot.
The audio codec lies about its rate. Two-way audio came out either an octave high or slow and deep, and it wasn't a resampling bug. The codec consumes exactly twice the rate ALSA thinks it opened: ask for 8 kHz and it plays 16 kHz of real time. So ALSA's buffer accounting is wrong by a factor of two, non-blocking writes get dropped, and matching the “right” numbers gives you a chipmunk. The thing that worked was to stop fighting it and make the discrepancy explicit: open the stream at 8 kHz, produce content at 16 kHz, and give playback its own process so the writes can block instead of being discarded.
Night vision can't use one threshold. The IR-cut filter is a latching solenoid on two GPIOs and the IR LEDs are on another. My first rule used the same luma window for both directions, which didn't work: in night mode the camera is lit by its own LEDs, so the automatic exposure normalises the image and the “it got dark” reading never fires. The same room measured about 21 in day mode and 126 in night mode. The fix is asymmetric and a bit paranoid: switching to night uses the day-mode reading, while switching back to day switches the LEDs off, takes an unlit frame two integrations later, and compares that. Two agreeing probes, with backoff, or it stays dark.
In the end
What I wanted by the end was that someone with a card reader and a Linux box could get a working camera. So this is what you run:
git clone https://github.com/yeold/eufy-c220-open.git
cd eufy-c220-open
./make-card.sh /run/media/$USER/CARD
That builds five device tools with the cross compiler, stages them plus the boot
hook onto the card, and prints the md5 of everything it wrote. Boot the camera, wait about forty seconds, and the web UI is at http://<camera>:8080 and RTSP is
at rtsp://<camera>:8554/cam0. --wifi writes the network config, --mqtt
writes the Home Assistant broker config.
The interesting work in that script is the refusal cases. It won't write to anything that isn't a mounted writable FAT32 filesystem, and it won't make a card while a required binary is missing.
What kinda works
- PTZ homing drives each axis into a mechanical stop and times the dwell. The driver never reports the stall. It works but it's kinda wonky.
- The night-vision rule is replayed against recorded scenes and exercised on the camera in daylight, but a whole dark night at real low light is the one thing my bench couldn't fake. The probe thresholds are a measured guess.
- Recordings mux to MP4 for the browser, and a few access units per clip fail to decode. That's on the capture side.
If you have one of these cameras, a card reader and some patience, the README has the whole path from a fresh clone to a camera that answers on your LAN.





















