# Web Keyboard ## About This project turns a Raspberry Pi Pico W or Raspberry Pi Pico 2 W into a web-based USB HID keyboard device. Users can access a webpage served over HTTP to enter keyboard input onto the host device of the Raspberry Pi Pico (2) W. Input keys can be entered through a keyboard on the client device or by pressing on the keys on the graphical interface served on the webpage. ![Web interface for Web Keyboard](web-ui.jpg) ## Setup [Installation and demo video](https://youtu.be/uORnxt5DLTw) Download the appropriate firmware file for your board, either webkeyboard-pico_w.uf2 or webkeyboard-pico2_w.uf2, from the latest [release](https://git.kkozai.com/kenji/webkeyboard/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 (2) W. After unmounting, connect the Raspberry Pi Pico (2) W with a micro USB cable to the host computer or other device. On initial boot, the Raspberry Pi Pico (2) W will enter Access Point mode with SSID "picokb" and password "password". Connect to this network with another device and open a browser window to http://192.168.0.1. Go to the "Configure W-Fi" page and enter the SSID and password to the network that you would like the Raspberry Pi Pico (2) W to connect. Optionally, also enter a hostname for the device and static IP information. Hit the "Save" button to save the network information to device flash. Browse back to the main UI page at http://192.168.0.1 and press "Reboot". The device should automatically connect to the network with the saved information. You can then connect to the device using a web browser at the device's assigned IP or hostname by accessing http://IP_ADDRESS or http://HOSTNAME (http://picokb if no hostname is set). If the Pico W fails to connect to the saved Wi-Fi network, it will once again enter Access Point mode, and you can connect to the device directly to modify the network information. Alternatively, you can use the device directly in Access Point mode by accessing the device at http://192.168.0.1. The program is set to reboot automatically to try to reconnect to the nextwork after 10 minutes of inactivity if no keyboard input is received during that time. ## Licensing This software is distributed under the [GNU General Public License version 3](LICENSE), with the exception of the libraries in the following section. ## Credits The project uses code from the following sources: - [MicroPython Project](https://github.com/micropython/micropython) for [dhcpserver.c/h](dhcpserver.c) distributed under the MIT license - [Raspberry Pi Pico SDK Examples](https://github.com/raspberrypi/pico-examples) for a modified version of [pico_w/wifi/lwipopts_examples_common.h](lwipopts.h) distributed under the BSD-3-Clause license - [TinyUSB](https://github.com/hathach/tinyusb) for template versions of [hid.c](hid.c), [tusb_config.h](tusb_config.h), and [usb_descriptors.c/h](usb_descriptors.c) distributed under the MIT license