How to read USB Rfid Reader simulating a HID keyboard using Linux and Python3

I use Rfid Reader (a small USB pen) that mimics a HID keyboard on Debian Linux (Squeeze).

less -f / dev / input / event2 gives me a bunch of gibberish on the screen at the time of scanning the rfid tag. Using the evdev Python library ( http://bit.ly/kZkO2b ), I could correctly decode the string correctly.

But I think I'm barking the wrong tree. It seems too complicated. If the rfid reader works like a HID keyboard, should I have access to it using basic functions like sys.stdin, right? So how is this done right?

+5
source share
1 answer

Since the user has not answered here since May 2011, but found a solution to his problem, as indicated in his comment, I thereby free myself from publishing the specified solution and get this question from the "Unanswered" queue.


The problem was solved after the user realized that he entered the embedded device through SSH . He continued to just read /dev/tty0, using io.openfrom the Python 3 standard library .

0
source

All Articles