I was thinking of adding some more GPIO near the printer board via a RP2040 based microcontroller. Maybe something as simple as a raspberry pi pico. I could run a bunch of lines from the Pi 3A for a similar purpose, but was trying to minimize the number of wires that have to run from opposite corners of the printer.
Personally, my first choice would be USB
I believe the steps there would be:
Flash pico with klipper firmware (or is it menuconfig? Not familiar with this step for a secondary MCU)
When choosing a board, make sure there’s enough Flash on the MCU for Klipper and that the MCU is supported by Klipper.
Good point. Since the SKR Pico and Raspberry Pi Pico both use an RP2040 as their main chip and have at least 2MB of additional flash on the board (klipper firmware is <64 kb I think) the Pi Pico should work.
I’ve been running Raspberry Pi Pico (RP2040) as an extra mcu for the last few years for exactly this purpose, adding GPIO to the printer, and have been very happy with it.
It’s connected to the host (a PC in my case) via USB and I have it on a breadboard magnetically attached to a 3D printed bracket right on the front of the printer where stock LCD screen used to be mounted which makes connecting accelerometer (for input shaping), another sensor, relay, etc. a breeze. I can just turn the power off (IMPORTANT), wire in a new (supported) device to GPIO without soldering, edit config files per Klipper documentation, and voilà in minutes!
Breadboards are definitely not meant to be a permanent wiring solution, especially since I have it physically connected to the printer and hence coupled to all of the printer’s vibrations while printing, but I’ve had no issues over a couple of years now.
And if you run out of GPIO, for another $4 you can always add another Pi Pico to your setup.