Forum
[PROBLEM] intercepting usb device input - Printable Version

+- Forum (http://forum.xbian.org)
+-- Forum: Hardware (/forum-7.html)
+--- Forum: Peripherals (/forum-27.html)
+--- Thread: [PROBLEM] intercepting usb device input (/thread-1004.html)



intercepting usb device input - Fuzzwah - 13th Jun, 2013 02:47 AM

Question: how can I intercept an input from a USB device at the linux level prior to XBMC picking up the input?

Idea: Am I able to somehow configure XBMC so that it doesn't automatically pickup a certain USB device as being an input?

Background: My goal is to be able to trigger the playback of music in XBMC via an RFID reader.

I have a collection of RFID cards which I've associated with playlists, I currently have the system working on a separate linux machine which fires JSON API calls to XBMC which I have running on a Raspberry Pi (using XBian). On my dev setup, touching a card to the reader simply sends the card's 10 digit code and the return character to the console. I set up bash aliases to take these inputs and send the appropriate JSON call using curl.



You can find a full explanation of my project here: http://fuzzysprojects.wordpress.com/rfid-triggered-music/

I am trying to move the system from my dev machine and have it all running on the RPi. The problem I've run into is that when XBMC is running and a card is read the 10 digits and the return character are picked up in XBMC rather than being sent to the console.

When I SSH into the RPi and try to interact with the RFID reader using evtest I'm informed that "this device is grabbed by another process". So I'm wondering if there is some way that I might be able to stop XBMC from grabbing it?


RE: intercepting usb device input - Markamc - 14th Jun, 2013 02:07 AM

Might help? maybe...

Writing udev rules

Some Nifty udev Rules....


RE: intercepting usb device input - Markamc - 27th Jun, 2013 07:09 PM

I've just managed to create a hot-plug "upstart" for my touchscreen. I can unplug/re-plug usb device and start a python script to grab device instead of xbmc. I use "start on input-device-add" and "stop on input-device-removed".

You can probably use similar, docs are here http://upstart.ubuntu.com/cookbook/#upstart-udev-bridge