Controlling Host Machine USB Ports

Is it possible to use Klipper to talk to devices, specifically fans, connected to the USB ports of the host machine?
I have a printer controlled from a Linux Mint laptop running Klipper which has plenty of ports to spare, but the driverboard for my printer has no more sockets for fans. As such, I wanted to add USB controlled fans to my machine and was wondering if I could use Klipper to automatically control their behavior.

Normally a fan attached via USB only uses GND and +5V so you are not able to control it from the machine.
If you have free driver ports on your MCU board you can install pin extender like the following:
Those work pretty well!

1 Like

For OctoPrint this was developed:

It works with Esp8266/ESP32, Arduino Mega, Nano or some other MCU capable of Serial communications to create (additional) GPIO pins.

1 Like

Unfortunately I don’t believe my board has the pins required for that module or other ones I have seen online

Even if I cant fine tune the USB fans’ speeds, just having capability to say “turn on at layer 2” would be enough. Is this also not possible?

Not directly.

Why don’t you use a pico as a second mcu? It’s quite inexpensive and has some GPIOs.

Mostly because my familiarity with electronics and klipper is zero. This is my first printer, for context.

I have managed to work around my issue by converting some unused LED headers on my printer’s control board to power the fans, which has worked well for me so far. The voltages and amperage pushed is the same for the LED and fan ports, strangely, so it works.

Just curious. Can you explain exactly what you did?

There were LED ports on the board that use the same header (jst xh 2.54) and had the same voltage and current output as the fans I needed. So I just found what pins they used and assigned them as fans in my printer.cfg file.

1 Like

Do yourself a favor and start reading here RPi microcontroller - Klipper documentation
The link from Sineos I posted above might bring you faster to your goal.
Right now you are going down the wrong path.

Eventually I probably will, but for now this workaround suits my needs. I think as I upgrade my printer more and more I will start doing the things the right way haha

This is a perfectly fine and correct approach.
The alternative as mentioned @hcet14 is valid as well but requires more effort since you will need to connect MOSFETs to the pins of the RPi Pico / Blue Pill / whatever in order to control fans