mirror of
https://codeberg.org/r4gus/PassKeeZ.git
synced 2026-11-17 03:20:30 +00:00
Page:
Raspberry Pi Pico W 2 as Roaming Authenticator
No results
1
Raspberry Pi Pico W 2 as Roaming Authenticator
David Sugar edited this page 2026-02-06 14:23:02 +01:00
Table of contents
WIP
Configuration
The first step is to configure the Raspberry Pi Pico W 2 as a USB gadget.
- Append
dtoverlay=dwc2to the end of/boot/firmware/config.txt - Create a new file
/etc/modules-load.d/usb.confand add the following:
dwc2
libcomposite
- Create a new file
/usr/bin/passkeez_usband make it executable:
sudo touch /usr/bin/passkeez_usb
sudo chmod +x /usr/bin/passkeez_usb
- Append the following to
/usr/bin/passkeez_usb:
#!/bin/bash
cd /sys/kernel/config/usb_gadget/
mkdir -p passkeez
cd passkeez
echo 0x1d6b > idVendor # Linux Foundation
echo 0x0104 > idProduct # Multifunction Composite Gadget
echo 0x0100 > bcdDevice # v1.0.0
echo 0x0200 > bcdUSB # USB2
mkdir -p strings/0x409
echo "70 61 73 73 6b 65 65 7a 2d 30 30 2e 30 30 2e 30 31" > strings/0x409/serialnumber # passkeez-00.00.01
echo "David P. Sugar (r4gus)" > strings/0x409/manufacturer
echo "PassKeeZ USB Passkey Dongle" > strings/0x409/product
mkdir -p configs/c.1/strings/0x409
echo "Config 1: ECM network" > configs/c.1/strings/0x409/configuration
echo 250 > configs/c.1/MaxPower
# Add functions here
mkdir -p functions/hid.usb0
echo 1 > functions/hid.usb0/protocol
echo 1 > functions/hid.usb0/subclass
echo 8 > functions/hid.usb0/report_length
echo -ne \\x06\\xD0\\xF1\\x09\\x01\\xA1\\x01\\x09\\x20\\x15\\x00\\x26\\xFF\\x00\\x75\\x08\\x95\\x40\\x81\\x02\\x09\\x21\\x15\\x00\\x26\\xFF\\x00\\x75\\x08\\x95\\x40\\x91\\x02\\xC0 > functions/hid.usb0/report_desc # https://nodeloop.org/tools/hid-report-descriptor-tool?d=BtDxCQGhAQkgFQAm_wB1CJVAgQIJIRUAJv8AdQiVQJECwA
ln -s functions/hid.usb0 configs/c.1/
# End functions
ls /sys/class/udc > UDC
- Create a new systemd service
/etc/systemd/system/passkeez_usb.service:
[Unit]
Description=PassKeeZ USB device startup script
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
WorkingDirectory=/
ExecStart=/usr/bin/passkeez_usb
Restart=on-failure
RestartSec=5
[Install]
WantedBy=multi-user.target
- Enable the service
sudo systemctl enable passkeez_usb.service - Restart
After the restart you should find the following folder on the system: /sys/kernel/config/usb_gadget/passkeez/. When listing connected USB devices on your host (e.g. by running ioreg -p IOUSB on macos) one should see a connected PassKeeZ USB Passkey Dongle.