hid-remapper
hid-remapper copied to clipboard
Suggestion: Add wifi RPC protocol support to the hid-remapper firmware
I suggest adding an RPC protocol to the remapper software for in addition to the remapping functionality, allowing the HID-Remapper to receive keyboard and mouse events commands through Wifi.
Use case:
- The user works from a desktop and would like to control a secondary computer through their desktop's keyboard.
- The secondary computer has a HIP-Remapper device with wifi support, e.g. Raspberry Pi Pico W, or ESP32-S3, attached to its USB port.
- The user focus a small application, Remote HID Control, on their desktop, which then catches all keyboard and mouse events.
- The application sends the keyboard and mouse events through the HID RPC protocol to the the Raspberry PI Pico W which sends them on to the secondary host.
I volunteer to write the client application, Remote HID Control, at least on Linux. :-)
I tried doing starting this myself, but just adding to #include pico/cyw43_arch.h and cyw43_arch_gpio_put(CYW43_WL_GPIO_LED_PIN, 1); I got the following linkage error:
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: remapper.elf section `.data' will not fit in region `RAM'
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: region RAM overflowed
/usr/lib/gcc/arm-none-eabi/12.2.0/../../../../arm-none-eabi/bin/ld: region `RAM' overflowed by 170432 bytes
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
What is the problem? Can I get around this by removing some unused functionality, e.g. the ability for the user to remap the keyboard?
It's because we have copy_to_ram set, which means all the code has to fit in 264 KB. That's because I had issues with writing to flash otherwise (saving config), but I'm not sure if it's still relevant. Might only be relevant for the legacy remapper_classic binary. Anyway, remove that in CMakeLists.txt and it should run from flash just fine, just keep the above in mind.
I can confirm that remapper works without copy_to_ram set. Thanks! :smile:
On the other hand, I'm having a real difficulty incorporating pico w specific code into remapper. Here are some observations:
- Doing
#include pico/cyw43_arch.his not found with the default CMakeLists.txt configuration. - By various hoops (that I don't remember and can't reproduce) I was able to do the include the above succesfully and then create a remapper.uf2 file that I copied to the device. However, after doing those configuration changes, remapper doesn't do any remapping.
To be continued...
I'm making progress with my combined remapper and web server combo!
What I now need help with is how to inject a HID keyboard key into the USB host.