3

I just purchased the RFIDRW-E-USB RFID reader from Priority 1 Design (see this page, datasheet available in PDF form.)

I have tried to make it work on my computer (Ubuntu), before plugging it to my Raspberry Pi, but I had not luck so far and I am running out of ideas on how to make it work.

I connected the provided antenna to the A+ and A- nodes on the board but did not solder it in place, as I plan on installing another antenna later and I'm not really good at welding. (I made sure the stripped part of the wire was touching a metal part on the board, and taped them in place.)

Then, I plugged the whole thing in my computer, and I can see the board as /dev/ttyUSB0.

Then, inspired by the code for a Parallax RFID reader (from here), I tried the following in Python (with super user privilege):

import serial

device = serial.Serial("/dev/ttyUSB0", 2400, timeout=5)
while True:
    tag = device.read(12)  # Tries to read the ISO tag format made of 12 digits
    if len(tag) != 0:  # If something has been read, print it then break out of the loop
        print tag
        break

When I approach a tag, nothing happens.

Is there a flaw in my method? What is the most likely cause of error in these steps?

EDIT: After contacting their customer support, I have been told to use a virtual com port driver to communicate with the FTDI chip, from here. Since I want to code in python, I will try various python modules for FTDI chips.

EDIT2: So now I can communicate with my device, but only in interactive mode. I can use screen to connect: sudo screen /dev/ttyUSB0. Then, I can use the various commands shown in the datasheet. If I enter ver (followed by a carriage return), I receive the expected output ?09. Now I just need to do the same in Python...

EDIT3: The FTDI chip is FT232RL. Google shows me a lot of people successfully using this chip with Python (in bitbang mode). There must be something simple I'm missing...

SlySven
  • 3,631
  • 1
  • 20
  • 46
PhilMacKay
  • 131
  • 1
  • 1
  • 3

1 Answers1

2

One of the good points about Python is that you can use it interactively.

From a command prompt type python.

Then try out the commands.

import serial
import time

device = serial.Serial("/dev/ttyUSB0", 2400)

while True:

   print(device.read(12)) # important to indent this line
   time.sleep(1)  # important to indent this line

# press return here to execute the while loop
# control C to abort while loop

device.write("ver")
device.read(12)

Anything you can get working interactively will work in a script.

joan
  • 71,852
  • 5
  • 76
  • 108