adafruit / Adafruit_Blinka

Add CircuitPython hardware API and libraries to MicroPython & CPython devices
https://learn.adafruit.com/circuitpython-on-raspberrypi-linux
MIT License
453 stars 340 forks source link

No such file or directory: adafruit-blinka/functions/hid.usb1/dev #645

Closed aavendano closed 1 year ago

aavendano commented 1 year ago

Hi, I am using an RPI B 3 and Raspberry Pi OS. I am trying to build a remote keyboard using usb_hid. But I keep getting the error below.

FileNotFoundError: [Errno 2] No such file or directory: '/sys/kernel/config/usb_gadget/adafruit-blinka/functions/hid.usb1/dev'

It seems that I am missing some controllers. But I can not figure it out what or from where I should get it. Please, I would appreciate your help

Thanks!

Neradoc commented 1 year ago

What is your code ? I believe that you need to call something like:

import usb_hid
usb_hid.enable((usb_hid.Device.KEYBOARD,))

However, note that the only Raspberry Pis that support gadget mode are the Pi Zero (on the data USB port) and the Pi 4 (on the USB-C port), all the other Pis (and ports) go through an on-board hub, and cannot act as a keyboard.