2

I need for my raspberry a USB connected device like a button that can be color illuminated and can be pressed. I want to use it to trigger at my raspberry certain actions in sw.

I fond this https://www.ultimarc.com/usbbutton/control-interface/usbbutton/ but the SDK is not supporting linux unfortunately. "When pressed, “types” a user-configured sequence of up to 48 keyboard characters into the PC on a single press." This "typing" is in my case not usable, as its a embedded device that needs login first.

I thought I can create a simple polling sw that polls the button state if pressed and sets the LED regarding the pressing, e.g once pressed red, second pressed green, third red, ... Unfortunately the sdk is only for windows..

Does anybody has a suggestion what product I can use instead ?? Or maybe i can use the sdk also for linux somehow?

4
  • this may help linuxjournal.com/article/7353
    – jsotola
    Commented Feb 22, 2021 at 20:04
  • Why does it need to be USB-connected? You might have simpler possibilities with a Pi, since it has GPIO, which is optimal for buttons.
    – PMF
    Commented Feb 28, 2021 at 7:30
  • Why is the "typing" not usable to you? Even if you are not logged in, you should be able to have software run at boot time that can listen for the HID input and set the color of the button appropriately.
    – Glen Yates
    Commented Aug 24, 2021 at 20:36
  • Thanks Glen for your post. I thought Its not usable for me, because I use a embedded system on a Raspberry PI that demands login. What I have tried is to create a user with autologin, that can use the command line after boot immediately, without any login needed, but in general the login process is the biggest problem. How can I listen to the HID input even without login ?? Do you know a method ? Commented Aug 25, 2021 at 7:11

2 Answers 2

0

I've a couple of these gadgets. They identify themselves as HID Keyboards so by default they will sent chars to your computer.

There is no SDK as such for non-windows boxes but its just keypresses at the end of the day. I use libusb to monitor the keypresses for the specific device and then act on them.

Here is a link to a GitHub project which does something similar in Rust I found it very useful as it has examples for setting up the key codes etc. libusb is a known quantity and available for multiple languages so a good starting point.

https://github.com/RobbieClarken/tomatina

1
  • As I said in my Question: I know that some devices has this feature, but I cant use it. Its as with a keyboard, I have to be logged in before I can type commands, and in my case this is not possible."When pressed, “types” a user-configured sequence of up to 48 keyboard characters into the PC on a single press." This "typing" is in my case not usable, as its a embedded device that needs login first. Commented Mar 1, 2021 at 10:27
0

Look into Arduino boards with ATmega32u4. The original one from Arduino is called Leonardo, it's great for prototyping but probably too big for the final application. And then there's a whole bunch of third-party boards of various sizes, down to thumbnail size.

Not the answer you're looking for? Browse other questions tagged or ask your own question.