PydgetRFID
A front-end for the Phidgets Inc. RFID kit
PydgetRFID is a Python front-end to the Phidgets Inc. RFID kit. It wraps libphidgets with ctypes to communicate with the hardware.
PydgetRFID consists of a D-Bus service that allows other applications (written in any language with D-Bus bindings) to use the hardware. It allows to start and stop reading, and emits a signal whenever a new tag is read. A simple graphical user interface (built with PyGTK) which uses this daemon is also provided.
PydgetRFID is free software: it is licensed under the GNU GPL.
Contact
If you use PydgetRFID, I would appreciate it if you let me know. PydgetRFID has a Launchpad page where you can report bugs or ask questions. If you have any problems using the software, I would be glad to help you out.
Requirements
Dependencies
- GNU/Linux
- libphidgets
- Python
- ctypes (included in Python since 2.5)
- D-Bus
- dbus-python
- HAL
- PyGTK (for the GUI)
D-Bus, HAL and Python are probably already installed on your GNU/Linux machine.
Permissions
You have to set up permissions to be able to communicate with the hardware. To do so, edit /etc/udev/rules.d/permissions.rules (on my system the file was called 40-permissions.rules) and change this line:
SUBSYSTEM=="usb_device", MODE="0664"
into:
SUBSYSTEM=="usb_device", GROUP="plugdev", MODE="0664"
Documentation
Usage
First, you have to start the D-Bus daemon. Before doing so, make sure the reader's USB cable is plugged into an available USB port on your machine. If you just want to see which tags are read, you can start the GUI.
To run the D-Bus daemon:
$ ./daemon.py
To run the GUI:
$ ./pydget_rfid.py
If you are connecting your own application to the daemon, you have to first call the start_reading method. It starts a loop which keeps reading RFID tags, until stop_reading is called. To do something when a new tag is read, connect your own callback function to the signal tag_changed_signal.
A Python example of using the daemon to do just this is available in examples/client.py. Note that to use signals and callbacks, you need a main loop (e.g. the one provided by GLib).
Code documentation
Currently there are doc strings for the exported methods in the D-Bus daemon. More documentation will follow in a next release.
Download
Stable version
The current stable version is 0.1.1.
- [ tar.gz ]
Development version
The latest bleeding edge version is available in a Bazaar repository.
To get the code, use:
$ bzr get http://code.jozilla.net/PydgetRFID
While inside the project directory, new updates can be retrieved with the command:
$ bzr pull
If you want to make your own changes, the best way to do so is branch from the main code you have just downloaded:
$ bzr branch PydgetRFID PydgetRFID-improvements
This way you can use that repository to get updates, and use the new branch to do your own work. After pulling updates in the main repository, you can merge them in the new branch using:
$ bzr merge
For more information on how to use Bazaar, have a look at the documentation.
