Linux Restart LIRC if remote control is (re-)connected (udev rule) - Printable Version +- Kodi Community Forum (https://forum.kodi.tv) +-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33) +--- Forum: Supplementary Tools for Kodi (https://forum.kodi.tv/forumdisplay.php?fid=116) +--- Thread: Linux Restart LIRC if remote control is (re-)connected (udev rule) (/showthread.php?tid=149957) |
Restart LIRC if remote control is (re-)connected (udev rule) - binwiederda - 2012-12-29 For some reason, LIRC doesn't realize when the USB dongle for my remote control (Medion X10) is reconnected (unplug USB, plug it back in). Only after I restart lirc with /etc/init.d/lirc restart, the remote works again. In syslog, that looks like this: Code: Dec 29 16:33:00 kernel: [20216.136118] usb 3-1: USB disconnect, device number 2 QUICK AND DIRTY FIX: Restart lirc whenever the remote is (re-)connected I use udev to automatically restart LIRC when the remote is connected via USB 1) Find idProduct/idVendor by monitoring /var/log/syslog for a string like this (when USB dongle of remote is connected) $ tail -f /var/log/syslog Code: ... 2) Now figure out idProduct and idVendor $ cat /sys/devices/pci0000:00/0000:00:1d.0/usb6/6-2/idProduct 0006 $ cat /sys/devices/pci0000:00/0000:00:1d.0/usb6/6-2/idVendor 0bc7 3) Create a udev rule for: restart lirc when USB dongle of remote control is connected $ vi /etc/udev/rules.d/80-lirc-restart-on-x10-connect.rules SUBSYSTEM=="usb", ACTION=="add", ATTRS{idProduct}=="0006", ATTRS{idVendor}=="0bc7", RUN+="/etc/init.d/lirc restart" That's it. If you reconnect, it should now look like this: Code: Dec 29 16:33:10 kernel: [20226.544088] usb 3-1: new low speed USB device number 3 using uhci_hcd |