https://github.com/sitic/http-hid-keyboard
Turn your Raspberry Pi into a remote keyboard, control via HTTP requests
https://github.com/sitic/http-hid-keyboard
hid http python raspberry-pi usb
Last synced: 2 months ago
JSON representation
Turn your Raspberry Pi into a remote keyboard, control via HTTP requests
- Host: GitHub
- URL: https://github.com/sitic/http-hid-keyboard
- Owner: sitic
- License: mit
- Created: 2023-11-05T22:26:00.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-11-06T03:27:29.000Z (over 2 years ago)
- Last Synced: 2026-04-13T02:41:56.805Z (2 months ago)
- Topics: hid, http, python, raspberry-pi, usb
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# http-hid-keyboard
Use a Raspberry Pi as a USB keyboard controlled through HTTP requests. We use this project to control a Siemens ACUSON SC2000 ultrasound machine by emulating a keyboard/footswitch. Currently, only predefined actions/keypresses can be triggered.
We use a Raspberry Pi 3 A+ with Raspberry Pi OS, but any Raspberry Pi with USB OTG support should work.
## Installation
```bash
sudo ./install.sh
```
will set the appropriate boot options for USB OTG and install a `usb-gadget.service` and `hid-webserver.service` systemd service. Reboot the Raspberry Pi after installation.
## Usage
Test if keypresses can be issued:
```bash
curl -X POST -H "Content-Type: application/json" -d '{"action": "ping"}' http://localhost:8080
```
You can define an actions in `main.py` and send them via HTTP POST requests to the webserver:
```bash
sudo systemctl restart hid-webserver
curl -X POST -H "Content-Type: application/json" -d '{"action": "save_recording"}' http://localhost:8080
```