r/u_chLeei•
chLeei

I automated my blog posting with a Raspberry Pi Pico instead of a headless browser

r/SideProject has a Not-AI projects megathread running right now, and it made me want to write up the one side project I built this year that has no model call anywhere in it.

I wanted to automate publishing to my blog and a few social platforms. The obvious answer is Playwright or Puppeteer. I went the other way: I flashed a Raspberry Pi Pico as a USB HID device so it shows up as a real keyboard and mouse, then drive Chrome with it over a serial JSON protocol.

The host sends things like {"cmd":"mouse_move","x":120,"y":-40} and the firmware turns that into HID reports. macOS cannot tell it apart from my actual keyboard, because at that layer it is not different.

Things I did not expect:

Pointer acceleration makes absolute positioning genuinely hard. A delta of 50 moved the cursor 421 pixels, a delta of 127 moved it 1573. I ended up measuring a gain table and doing greedy decomposition per axis, then closing the loop by reading the real cursor position after every move.

It is slow. About 58ms per keystroke round trip over serial, and that is firmware side, so the host cannot fix it. A 2000 character blog post with images takes about three minutes. The only way to speed it up is to press fewer keys, not to press them faster.

Every editor lies to you in a different way. One of them reports bold state as always false, so any conditional toggle silently inverts halfway through the document. Another returns an empty string from getSelection even when text is clearly selected. I ended up verifying through the clipboard instead.

Would I recommend this over Playwright for most people? No. It is slower and more fragile. But it was a genuinely fun problem, and I learned more about HID, pointer acceleration and accessibility APIs than I would have from any tutorial.

Happy to answer questions if anyone is doing something similar.

Posted Aug 4, 2026, 9:04 AM UTC

10
Loading comments…