I had some fun writing a Python wrapper around libphidgets for an RFID reader we had lying around here. To do so, I used ctypes (apparantly the Python bindings for libphidgets were broken). To check for a connected RFID reader, I interfaced with hal through dbus. Afterwards I created a simple GUI for the device with PyGTK.
Here is the result:
I experienced some weird permissions problems though. The device could only be opened with root privileges. Takis helped me step through libphidgets to see if there was a bug in it. In the end, we solved it by changing the
/etc/udev/rules.d/permissions.rules file (in my case it was called
40-permissions.rules). I’m not sure if there are any security problems with this though.
I changed these lines:
# USB devices (usbfs replacement) SUBSYSTEM=="usb_device", MODE="0664"
# USB devices (usbfs replacement) SUBSYSTEM=="usb_device", GROUP="plugdev", MODE="0664"
I will probably put the code online when I have some spare time (and after I cleaned it up a bit).