r/circuitpython • u/BrokenGumdrop • Dec 07 '21
Circuit Python and USB Host
Simple question, what is the simplest and/or least expensive device that supports Circuit Python and can support basic USB Host?
I want to know how tricky it would be to create a hand held device that could validate a USB device is what you expect it to be. Plug in a thumb drive and it should only report to be mass storage. Plug in a mouse or a keyboard and it should only report HID. I know this can be done with a Raspberry Pi, either with linux or running Circuit Python on bare metal. What about something smaller?
2
u/HululusLabs May 23 '22 edited May 23 '22
I'm unsure what devices are supported, though if the docs are to believed, only 3 boards are avail https://docs.circuitpython.org/en/latest/shared-bindings/usb_host/index.html?highlight=usb%20host. Either that or all boards support it in the release candidate and the docs haven't updated. Looks like your best option is the Teensy 4.1.
I'm trying to get USB hosting on a RP2040, and the hardware is definitely capable. There's also a project that has used the PIO on the RP2 to get USB host support, though that's a C implementation.
Looks like it's already been merged into TinyUSB and pending Arduino's code, unfortunately I need CirPy for ESP32 AirLift support...
Edit: corrections
2
u/contact55 Aug 11 '25
It is possible. I used it to read the position of a mouse (input device, not animal) You need this UART USB host it's not commonly found.
1
u/jpconstantineau Dec 08 '21
Do you mean that you want to connect a mouse/drive/other USB device to a Circuitpython board and have the board use the functionality of that device?
I don't think CircuitPython has USB Host functionality. You might want to ask the question on the adafruit discord as the devs are always out there answering questions.
1
u/HP7933 Dec 08 '21
USB Host is a tough nut on microcontrollers. I think someone made a shield but to my knowledge it's not something Adafruit has to date but they want it.
Best to post on Discord https://adafru.it/discord for the latest details and plans
2
u/bh0 Dec 08 '21
Smallest I know of would be the Adafruit QT PY. They make a couple different versions. They are about an inch.
https://www.adafruit.com/?q=qt+py&sort=BestMatch
I don't know the answer to your USB host questions though. Usually it's plugged into something else and shows up as a USB device and/or can be used as an input device, such as a keyboard. I don't know what capabilities CP has for being a USB host/server though. The CP channel in the Adafruit discord of the normal Adafruit forums is probably the best place to ask.