I received an FM-503 with UHF Ant. I am able to connect through pyserial. I am attempting to send a command to the reader, at first I just want to do something basic so I can better understand communication in python. I am building an RFID reader that can be strapped to a golf cart on our RV lot.

Using a Windows PC with Python3, editing in Sublime.

I am not an advanced programmer but I am determined to learn. I tried to pass a command to get the Firmware version. According to the reader documentation, It uses ASCII format. The command should be V.

Here is what I have so far.

'''#First attempt to connect to FM350 through pythonimport serialimport time#configure portser = serial.Serial(port ='COM12', baudrate = 38400,timeout = 1,parity = serial.PARITY_NONE,stopbits = serial.STOPBITS_ONE,bytesize = serial.EIGHTBITS)while 1:y = ser.read(ser.inWaiting())time.sleep(0.01)print(y)ser.write(b'<LF>V<CR>')'''

Here is what python3 spits out

--snip--b''b'\nX\r\n'b''b''b''b''--snip--

According to the documentation 'X' = none command match, please see pic below:

FM-503 Command Format

What I think is wrong:

I'm not encoding properly, to send the reader the correct command.

Any advice or places to research is greatly appreciated.

3

Best Answer


The correct bytes are just 0x56 0x0D and it will return the firmware version e.g. 0x0A 0x58 0x0D 0x0A

The line ser.write(b'<LF>V<CR>') should be modified into

ser.write(serial.to_bytes([0x0A 0x56 0x0D])').

did you get you code working? I use a FM-503 for a couple of projects I am working on and ended up here at stack looking for info on RSSI reading.

Anyway, I have a python code on my git that runs fine, reads a tag and records EPC and timestamp to a csv with a few setup options if I'm allowed to link let me know.

Otherwise you are correct that the encoding is offser.write(b'<LF>V<CR>') should be ser.write(b'\nV\r')

So if your command looked like this ser.write(b'\nR2,0,6\r') the return would be the TID of your RFID tag, if you put the TID into the TID decoder at gs1.org you can get your manufacturer name and then you can search the datasheet of the tag so you know what size the user memory is (if it exists).