Compare commits
2 Commits
v0.3.0
..
e2e2246c5a
| Author | SHA1 | Date | |
|---|---|---|---|
|
e2e2246c5a
|
|||
|
16c743cb22
|
@@ -1,8 +1,8 @@
|
||||
# Pico BLE HID
|
||||
|
||||
This project uses a Raspberry Pi Pico W as a Bluetooth Low Energy adapter for
|
||||
a wired USB HID input peripheral, allowing it to connect to a host device
|
||||
over BLE using HID over GATT Profile.
|
||||
This project uses a Raspberry Pi Pico W or Pico 2 W as a Bluetooth Low Energy
|
||||
adapter for a wired USB HID input peripheral, allowing it to connect to a host
|
||||
device over BLE using HID over GATT Profile.
|
||||
|
||||
|
||||
## Setup
|
||||
@@ -12,7 +12,7 @@ over BLE using HID over GATT Profile.
|
||||
### Hardware
|
||||
|
||||
You will need the following hardware to make the device:
|
||||
- Raspberry Pi Pico W
|
||||
- Raspberry Pi Pico W or Raspberry Pi Pico 2 W
|
||||
- USB extension cable
|
||||
- (Optional) Momentary push button
|
||||
|
||||
@@ -20,19 +20,19 @@ You will need the following hardware to make the device:
|
||||
|
||||
|
||||
You will need to cut the USB extension in half and connect the wires from the
|
||||
female end to the Raspberry Pi Pico W. The default configuration is to attach
|
||||
the USB's green wire to pin 1/GP0 and USB's white wire to pin 2/GP1. You will
|
||||
also need to connect the red to 5V VBUS/VSYS (since you'll be powering from the
|
||||
USB connection, VBUS should be fine) and the black to any ground pin. Pin 38
|
||||
is the closest and most convenient, or the ground test point TP1 on the back
|
||||
will also work. While you can connect the Raspberry Pi Pico to the host device
|
||||
using the micro USB port and a micro USB cable, since you have already
|
||||
sacrificed half of the USB extension cable, you might as well use the male half
|
||||
to create a standard USB-A connection. If you wish to do so, then simply
|
||||
connect the red and black wires of the male connector end to VBUS (5V) and GND,
|
||||
respectively. For the data wires, you can solder them to the two test points
|
||||
TP2 and TP3 on the back of the Raspberry Pi Pico. The white cable goes to TP2
|
||||
and the green cable to TP3.
|
||||
female end to the Raspberry Pi Pico (2) W. The default configuration is to
|
||||
attach the USB's green wire to pin 1/GP0 and USB's white wire to pin 2/GP1. You
|
||||
will also need to connect the red to 5V VBUS/VSYS (since you'll be powering
|
||||
from the USB connection, VBUS should be fine) and the black to any ground pin.
|
||||
Pin 38 is the closest and most convenient, or the ground test point TP1 on the
|
||||
back will also work. While you can connect the Raspberry Pi Pico (2) W to the
|
||||
host device using the micro USB port and a micro USB cable, since you have
|
||||
already sacrificed half of the USB extension cable, you might as well use the
|
||||
male half to create a standard USB-A connection. If you wish to do so, then
|
||||
simply connect the red and black wires of the male connector end to VBUS (5V)
|
||||
and GND, respectively. For the data wires, you can solder them to the two test
|
||||
points TP2 and TP3 on the back of the Raspberry Pi Pico (2) W. The white cable
|
||||
goes to TP2 and the green cable to TP3.
|
||||
|
||||

|
||||
|
||||
@@ -43,29 +43,29 @@ relief is a good idea.
|
||||
|
||||
### Software
|
||||
|
||||
Download the ble_hid.uf2 file from the latest
|
||||
[release](https://git.kkozai.com/kenji/pico_ble_hid/releases) and flash
|
||||
onto the Raspberry Pi Pico W by holding down the BOOTSEL button while plugging
|
||||
Download the ble_hid-pico_w.uf2 (for Pico W) or ble_hid-pico2_w.uf2 (for Pico 2
|
||||
W) file from the latest
|
||||
[release](https://git.kkozai.com/kenji/pico_ble_hid/releases) and flash onto
|
||||
the Raspberry Pi Pico (2) W by holding down the BOOTSEL button while plugging
|
||||
into your computer so that it appears as a USB drive, then transfer the
|
||||
firmware file onto the Pico W. After unmounting, the firmware install is
|
||||
firmware file onto the Pico (2) W. After unmounting, the firmware install is
|
||||
complete.
|
||||
|
||||
## Usage
|
||||
|
||||
Connect the Raspberry Pi Pico W into any USB power source (a good, small power
|
||||
bank will work), then plug in the desired peripheral into the female USB
|
||||
Connect the Raspberry Pi Pico (2) W into any USB power source (a good, small
|
||||
power bank will work), then plug in the desired peripheral into the female USB
|
||||
socket. After about a second, the onboard LED will light up, indicating it is
|
||||
ready to be paired over Bluetooth LE.
|
||||
|
||||
From the host machine, go to your Bluetooth settings and pair with the
|
||||
"Pico BLE HID" device. The LED should turn off when pairing begins, and it will
|
||||
turn back on when pairing is complete and the Raspberry Pi Pico W is
|
||||
ready to receive inputs. This will take a few seconds, so be patient.
|
||||
Once the light is back on, your device should work over the Bluetooth
|
||||
connection. When connecting a power-hungry device such as a gaming keyboard
|
||||
with many LEDs, the sudden power draw when plugging in can cause issues, so it
|
||||
is recommended to turn off the LEDs before connecting to the Raspberry Pi Pico
|
||||
W.
|
||||
turn back on when pairing is complete and the Raspberry Pi Pico (2) W is ready
|
||||
to receive inputs. This will take a few seconds, so be patient. Once the light
|
||||
is back on, your device should work over the Bluetooth connection. When
|
||||
connecting a power-hungry device such as a gaming keyboard with many LEDs, the
|
||||
sudden power draw when plugging in can cause issues, so it is recommended to
|
||||
turn off the LEDs before connecting to the Raspberry Pi Pico (2) W.
|
||||
|
||||
If you connected a push button to GP5, then pressing the button will switch
|
||||
between Bluetooth connection mode and USB passthrough mode. In USB passthrough
|
||||
|
||||
+1
-1
@@ -65,7 +65,7 @@ uint8_t const * tud_descriptor_configuration_cb(uint8_t index)
|
||||
|
||||
if ( device_state == DEVICE_ACTIVE ) {
|
||||
uint8_t desc_initial[TUD_CONFIG_DESC_LEN+TUD_CDC_DESC_LEN+1] = {
|
||||
TUD_CONFIG_DESCRIPTOR(1, 4+num_mounted, 0, TUD_CONFIG_DESC_LEN+TUD_CDC_DESC_LEN+num_mounted*TUD_HID_DESC_LEN, 0x00, 100),
|
||||
TUD_CONFIG_DESCRIPTOR(1, 2+num_mounted, 0, TUD_CONFIG_DESC_LEN+TUD_CDC_DESC_LEN+num_mounted*TUD_HID_DESC_LEN, 0x00, 100),
|
||||
TUD_CDC_DESCRIPTOR(ITF_NUM_CDC, 4, EPNUM_CDC_NOTIF, 8, EPNUM_CDC_OUT, EPNUM_CDC_IN, 64),
|
||||
};
|
||||
memcpy(desc_configuration, desc_initial, TUD_CONFIG_DESC_LEN+TUD_CDC_DESC_LEN);
|
||||
|
||||
Reference in New Issue
Block a user