GrovePi + Grove - 125KHz RFID Reader + Python

grovepi
rfid

#1

Hi,

I bought a Raspberry Pi in combination with the GrovePi+
Now I’m trying to make the Grove - 125KHz RFID Reader to work in Python.

I’m super new to programming. Many attempts to find a good tutorial/sample code online has lead to nothing.
If I’m correct, the module should be plugged into the RPISER port of the GrovePi+.

I also found this forum topic:


but the provided example seems to be for Arduno. I’m using a Raspberry Pi

I’m using the following:

  • Raspberry Pi 3
  • GrovePi+
  • Grove - 125KHz RFID Reader

#2

Hi @jeroen_schuiten,

We don’t have example programs for the Grove RFID Reader at the moment.

Please give us a day or two to come up with a solution for you.
We will reach back to you.

Does this sound good to you?

Thank you!


#3

Hi @jeroen_schuiten,

As I don’t have a Grove RFID Reader on my hands I can only give you a “rough” estimation of what you should have.
You will need to have the pyserial package installed in order to use the following python script.
In this script, when I message is received on the serial line, it’s gets printed in the console and then the program ends.

import serial
import time

rpiser = serial.Serial('/dev/ttyAMA0', baudrate=9600, timeout=0)
rpiser.flush()

while rpiser.inWaiting() == 0:
    time.sleep(0.005)

serial_data = rpiser.readline()
print(serial_data)

I think this script should work for your needs.

Thank you!