For a home automation project i had to connect a rdif reader (this one) to a Raspberry Pi 3 and then have the system execute a program each time a token is read by the reader:RFIDer is the tool i developed to do this job.
RFIDer sources (GPLv3 license) are available, but you can also find precompiled binaries for some platform.
Once compiled and installed on your linux box RIFDer will allow you to read digits from an input device and send everything read to the standard input of a program launched each time the read process is completed; a single “read procress” ends when the rfid-reader send a message equivalent to an “ENTER” keypress.
RFIDer can be launched in several ways:
- rfider -h : display the help page
- rdifer -k : send a kill signal to any RFIDer instace running on the machine
- rfider /dev/input/event8 /usr/local/bin/your_exec : execute RFIDer telling it to listen on the specified device (first parameter), gaining exclusive access on it, and to execute /usr/local/bin/your_exec each time a read process is completed, passing to this new program’s standard input the buffer content
- rfider -d /dev/input/event8 /usr/local/bin/your_exec : as the previous case but tell RFIDer to work as a daemon, detaching itself from the current shell