On Tue, May 9, 2023 at 7:04 PM Alan C. Assis wrote: > Hi Everyone, (sending again with right subject) > Since many here probably faced similar challenge in the past let me ask: > How to export HID buttons events from NuttX to Linux?
USB HID and/or Bluetooth HID ? :-) https://www.usb.org/hid https://www.bluetooth.com/specifications/specs/human-interface-device-profile-1-1-1/ There is an example app in NuttX Apps for USB HID Keyboard.. but I did not use it myself.. mouse works similar way :-) https://github.com/apache/nuttx-apps/tree/master/examples/hidkbd > Explaining the issue: I have an ESP32 board with LCD and touchscreen > and I want to create a low cost alternative to Elgato StreamDeck, but > unfortunately ESP32 doesn't have USB. Is Bluetooth HID an option? That would require no external hardware / modifications, just a standard Bluetooth HID implementation that should work out of the box on all platforms with no additional custom drivers. Also you can leverage WiFi block and transport HID over TCP/IP somehow and that would provide even broader access but that would require some driver/software/daemon on the target machine. As for USB, in a perfect situation you would have USB Device block in the MCU and you can create set of logical devices each for a given function (one physical USB connection can host many logical devices for instance mouse, keyboard, uart/cdc, mass storage, etc) that you describe with a descriptors and those tell what endpoints are read/write sink/sources of a function data (kind of similar to BLE). One physical device can have several configurations that change on the fly so you can switch logical functions as you wish. But you need a USB Device block for that. I miss that part in ESP32 too :-( The most common solution in that situation is to use MCU with USB Device or external chip that would enable USB HID functionality but that may cost similar to cheapest MCU with USB Device block. The ESP32-C3 or ESP32-C6 seems to have some sort of USB-JTAG/UART block. I did not play with this one yet.. but for compatibility reasons it may use USB HID transport for UART and JTAG.. if so maybe it would be possible to cheat the MCU block somehow in order to provide USB HID mouse/keyboard functionality :-P > So I think I need something similar to Microsoft VHF (bad name > Microsoft, shame on you) > https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/virtual-hid-framework--vhf- > > AFAIK Linux doesn't support Virtual HID (at least not yet). > > The best option I found was netstick: https://github.com/moslevin/netstick I would go for Bluetooth HID (widely adopted standard but short range), or the HID over WiFi using above projects (custom part on the target machine but more versatile) :-) Good luck and have fun! :-) -- CeDeROM, SQ7MHZ, http://www.tomek.cedro.info