Tag: rfid

Announcing PydgetRFID

I just released version 0.1 of PydgetRFID, the Python interface to the Phidgets Inc. RFID kit I blogged about earlier. It’s free software (licensed under the GPL). It wraps libphidgets with ctypes to talk to the hardware.

The software is now more polished and additionally provides a D-Bus service that allows other applications (written in any language with D-Bus bindings) to use the hardware. Currently this means you can connect to the hardware from Python, Ruby, .NET, C, C++, Perl and Pascal!

This DBUS service allows to start and stop reading, and emits a signal whenever a different tag (including the nil value) is read. I modified the original PyGTK GUI to use this daemon for communicating with the hardware. Furthermore, I improved the HAL support so that plugging the device in and out is detected. Unfortunately, the daemon cannot yet handle this though. That’s for a next release

Here is the GUI (which you probably remember from the last post). Nil values are now colored red:

PydgetRFID: GUI

And this a screenshot showing the communication between the daemon and the GUI logged with dbus-monitor:

PydgetRFID: using the the daemon and GUI

More information can be found at the PydgetRFID homepage.

PyGTK GUI for the PhidgetRFID reader

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:

PyGTK GUI for RFID reader

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"

to:

# 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).