A cinematic devlog · ESP32 × YOLOv8 × PID · Night #1
A WiFi rover. A fried board. A savior from a side pocket.
The story of a robot that learned to hunt — and strike.
"The vision was simple.
The night had other plans."
The original concept was almost embarrassingly simple: a Raspberry Pi, a pi-cam, two motor drivers, and a mandate to cause mischief. Pens were to be its primary target. A little desk gremlin, sneaking up on stationery. Nothing fancy.
We didn't know that the night had already written a different script. One with a much more dramatic second act.
It happened without ceremony. One moment the Raspberry Pi was the star of the show. The next — silence. A very specific kind of silence that every hardware hacker knows. The silence of a board that will never boot again.
It was sitting in a side pocket the whole time. The ESP32-CAM module — a fingerprint-sized board with a camera, WiFi, and just enough computational grit to replace an entire Raspberry Pi setup. We just had to rebuild the whole system architecture around it. In one night.
Two web servers. One board. Port 80 for HTTP motor control. Port 81 for the MJPEG video stream. Splitting them kept everything responsive — the ESP32's HTTP library gets cranky trying to handle both simultaneously.
Not a changelog. A crime scene. Each bug, documented with the unflinching clarity of someone who had to live through it.
GetAsyncKeyState() — live, physically-held keyboard state. Ghost exorcised.GetAsyncKeyState() is system-wide. Doesn't care what window is focused. Click away to Google something — bot randomly starts driving into a wall.INVERT_STEERING = True. One flag. One line. Forty-five minutes of debugging. Classic.Plain color detection. HSV color space. Hunt for red. Press P and the bot switches into autonomous predator mode.
The naive version was "blob left → spin left, blob right → spin right." It worked. It looked terrible. All stop-turn-stop-go, overreacting to every wobble. So we built it properly.
Way off? Rotate in place. Moderately off? Arc drive — correct aim while still closing the distance. As the target fills the frame, forward pulses ease off. It doesn't come in hot.
Once the bot closes the distance — once that bounding box fills enough of the frame to count as "arrived" — it stops. Then it fires the slash motor. One burst. The arm swings.
A second L298N. A separate motor mounted on top, hidden like a folded wing. Nobody knew it was there. The audience watched it crawl. They held their breath. Then they understood what the arm was for.
Somewhere along the way the web page stopped being a random set of directional buttons. It became an actual control panel — live camera feed, manual drive controls, slasher arm on demand, and a target-picker right in the feed itself. Point at what you want hunted. Flip to autonomous. Watch it stalk.
Same brain. Same PID. Same arc-drive-vs-rotate logic. Now it aims at whatever you pointed it at instead of whatever happened to be red.
The entire job of this robot is "go near red thing, hit it." That's a photoresistor and a servo's worth of problem. Here's the tally of what it got instead:
INVERT_STEERING boolean — earning its entire existence because a $3 camera module and a chassis disagreed about which direction counts as left.A Raspberry Pi died mid-build. Two concurrent web servers on one microcontroller. WiFi carrying both video and control. OS-level keyboard hooks. Two independent vision pipelines. A tuned PID loop. A browser front end. All of it had to talk to each other — so a little rover could sneak up on a highlighter and knock it off the table.
GetAsyncKeyState() · Foreground-window focus check so it doesn't self-drive on alt-tabA desktop-roaming, WiFi-controlled chaos gremlin built on an ESP32-CAM. By default it hunts down and ambushes anything red on your table. Hand it a specific target through the camera feed and it goes sneaky about that instead. Full browser control panel for driving it and firing the slasher arm yourself — whenever you just want to mess with things.
They watched it crawl in. Slow. Deliberate. Tracking the pen without missing a beat. The room held its breath. Nobody knew what the arm was for — until it fired.
The real footage. The actual bot. Tracking, closing in, and delivering the strike — as it happened on the night.