[mythtv-users] USB IR Receivers

Kirk Bocek t004 at kbocek.com
Thu Sep 3 19:27:15 UTC 2015



On 9/3/2015 11:51 AM, HP-mini wrote:
> On Thu, 2015-09-03 at 09:01 -0700, Kirk Bocek wrote:
>> On 9/3/2015 7:37 AM, Kirk Bocek wrote:
>>>
>>> I have patched mceusb.c and am working with the newer receiver. I will
>>> post if I get it working. Then I'll post about the Topseed.
>>>
>>>
>> Trudging along here...
>>
>> I'm trying to write the udev rule to unbind the device from usb_hid at
>> boot time using Alec's supplied page here:
>>
>> http://unix.stackexchange.com/questions/13964/prevent-claiming-of-novelty-usb-device-by-usbhid-so-i-can-control-it-with-libusb
>>
>> But I am unsure what the variable should be. My rule looks like:
>>
>> SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="20cc",
>> MODE="0660", GROUP="plugdev", RUN="/bin/sh -c 'echo -n $number:1.0 >
>> /sys/bus/usb/drivers/usbhid/unbind'"
>>
>> But 'udevadm control -R' does not unbind usb-hid:
>>
>> $tree /sys/bus/usb/drivers/usbhid/
>> /sys/bus/usb/drivers/usbhid/
>> âââ 1-2:1.0 -> ../../../../devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0
>> âââ bind
>> âââ module -> ../../../../module/usbhid
>> âââ new_id
>> âââ remove_id
>> âââ uevent
>> âââ unbind
>>
> "sudo echo > blah" does not have sudo access to blah..
> try "echo | sudo tee blah"
>
> Or put
> "/bin/sh -c 'echo -n $number:1.0 >
>> /sys/bus/usb/drivers/usbhid/unbind'"
>   into a (executable) script called from udev.
>

Nah, it was more simple than that (that is I'm more of a simpleton...)

First off, the variable is $kernel so the rule looks like:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", ATTRS{idProduct}=="20cc", 
MODE="0660", GROUP="plugdev", RUN="/bin/sh -c 'echo -n $kernel:1.0 > 
/sys/bus/usb/drivers/usbhid/unbind'"

Second, the rule fires off when I unplug and plug the device. 'udevadm 
control -R' just makes the subsystem aware of the rule.

After unplugging and plugging:

$tree /sys/bus/usb/drivers/usbhid/
/sys/bus/usb/drivers/usbhid/
âââ bind
âââ module -> ../../../../module/usbhid
âââ new_id
âââ remove_id
âââ uevent





More information about the mythtv-users mailing list