Udev rules triggers multiple times
Hi!
I'm trying to start a SNES emulator on my Raspberry Pi 2 when I connect my USB joystick. So I don't have to use the keyboard at all. The thing itself is not important, obviesly. I don't even use the emulator, but my girlfriend does. And more importantly, it's irritating not understanding what is happening. So, my udev rule looks like this: Code:
ACTION=="add", KERNELS=="1-1.4", SUBSYSTEMS=="usb", DRIVERS=="usb", ATTRS{idVendor}=="0079", ATTRS{idProduct}=="0011", ATTRS{product}=="USB Gamepad ", RUN+="/home/pi/bin/udevrunsnes.sh" Heres what I'm running (Noobs/Raspbian): Code:
$ uname -a |
Perhaps worth monitoring udev to see what events are occurring when the device is attached
Code:
udevadm monitor The only workaround I can think of is to invoke a wrapper script that only runs your desired script once, and sets a flag accordingly. |
All times are GMT -5. The time now is 10:02 AM. |