We are trying to read RFID tags using raspberry pi b+. We used following script in the python .
import serial import time serial=serial.Serial("/dev/ttyUSB0", baudrate=2400) while True: if serial.inWaiting()>0: read_result=serial.read(12) print("Read card {0}",format(read_result.decode("utf-8","replace"))) print("Sleeping 2 sec") time.sleep(2) serial.flushInput() On reading the tag it gives the error as:
File "/home/pi/rfidtry/try.py",line 7, in <module> print("Read card {0}",format(read_result.decode("utf-8","replace"))) UnicodeEncodeError: 'ascii' codac can't encode character u'\uffd' in position 2 :ordinal not in range(128)
replaceand show the output? (It should give you a slightly different error message)