Comments on: Turn Your Raspberry Pi Zero into a USB Keyboard (HID) https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/ Learn ESP8266, ESP32, Arduino, and Raspberry Pi Sun, 27 Jul 2025 12:20:02 +0000 hourly 1 https://wordpress.org/?v=6.8.2 By: Hieu https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-1075324 Sun, 27 Jul 2025 12:20:02 +0000 http://randomnerdtutorials.com/?p=49509#comment-1075324 In reply to Matt.

did you fix it? i have same error

]]>
By: Matt https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-1055326 Fri, 06 Jun 2025 08:13:10 +0000 http://randomnerdtutorials.com/?p=49509#comment-1055326 Anyone else having real problems with this?

Followed it multiple times with a fresh image and it always fails with:

Traceback (most recent call last):
File “/home/pi/RPi_Keyboard_Example.py”, line 9, in
write_report(NULL_CHAR2+chr(4)+NULL_CHAR5)
File “/home/pi/RPi_Keyboard_Example.py”, line 5, in write_report
with open(‘/dev/hidg0’, ‘rb+’) as fd:
FileNotFoundError: [Errno 2] No such file or directory: ‘/dev/hidg0’

]]>
By: nobody https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-1052616 Sat, 31 May 2025 05:50:06 +0000 http://randomnerdtutorials.com/?p=49509#comment-1052616 In reply to Manzazuu.

Thank you,

Removing my mini-usb to usb A OTG adatper, and just using a regular mini-usb to USB A cord worked like a charm.

On boot Windows said an unkown device was connected. After running the hidg0 configuration script the pi presented as a keyboard

bash: echo: write error: Cannot send after transport endpoint shutdown

]]>
By: ⠀ https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-1026073 Sat, 12 Apr 2025 06:44:11 +0000 http://randomnerdtutorials.com/?p=49509#comment-1026073 In reply to Cedric.

Yeahhh the same thing happens for my Pi Zero 2 W

]]>
By: Neli https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-1015052 Sun, 09 Mar 2025 17:04:09 +0000 http://randomnerdtutorials.com/?p=49509#comment-1015052 Hello everyone,i would like to ask you can someone use the above instructions in order to use raspberry pi zero 2w with Kali Linux os as pico ducky script?(HID)
Thank you

]]>
By: matt https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-990495 Tue, 10 Dec 2024 20:59:02 +0000 http://randomnerdtutorials.com/?p=49509#comment-990495 In reply to Chris.

Thank you for your input! I just got it to work with a Zero W and the Raspbian OS freshly installed.
Indeed, the steps are to be made.
And I can add, /etc/rc.local is not used anymore, so you have to run usr/bin/isticktoit_usb manually or through systemd on boot if you want it to work.

Thanks!!

]]>
By: Chris https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-982837 Wed, 13 Nov 2024 04:12:10 +0000 http://randomnerdtutorials.com/?p=49509#comment-982837 In reply to Seab.

Yes just got it working. Here are changes from the original instructions.

The config.txt file has moved. Do this instead of the first line:
$echo “dtoverlay=dwc2” | sudo tee -a /boot/firmware/config.txt
You need to add this to the END of the line in cmdline.txt here:
$sudo nano /boot/firmware/cmdline.txt

rootwait modules-load=dwc2,ghid
The hidg0 device permissions need to be set every boot:
$sudo nano /usr/bin/isticktoit_usb

Add this below the last line in a new line after “ls /sys/class/udc > UDC”
chmod 666 /dev/hidg0

]]>
By: Seab https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-982600 Tue, 12 Nov 2024 12:56:53 +0000 http://randomnerdtutorials.com/?p=49509#comment-982600 Anyone get this working in 2024?

]]>
By: Cross https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-934352 Fri, 05 Jul 2024 11:03:57 +0000 http://randomnerdtutorials.com/?p=49509#comment-934352 Hi, error with with line of code as raspbien has been updated. It longer uses boot/config.txt -> boot/firmware/config.txt or you will get error hidg0 not found. Took me. While to figure this one out

]]>
By: Umair Iqbal https://randomnerdtutorials.com/raspberry-pi-zero-usb-keyboard-hid/#comment-909284 Wed, 24 Apr 2024 06:56:17 +0000 http://randomnerdtutorials.com/?p=49509#comment-909284 In reply to Manzazuu.

I have checked cables, I am able to transfer data via that cable and port.

my setup is like:
i want this HID device to be keyboard of IPhone Device.
Iphone data i can access in raspberri pi, and phone is also charging.

Getting same error: Cannot send after transport endpoint shutdown.

]]>