python-mercuryapi icon indicating copy to clipboard operation
python-mercuryapi copied to clipboard

read TID tag using python

Open ramzimosalam opened this issue 4 years ago • 2 comments

i am use this code:

reader = mercury.Reader("tmr:///dev/ttyUSB0", baudrate=115200)

reader.set_region("EU3") reader.set_read_plan([1], "GEN2",bank=["tid"] ,read_power=1900)

reader.start_reading(lambda tag: print(tag.tid, tag.antenna, tag.read_count, tag.rssi)) time.sleep(1) when i execute the code i receive this message: Traceback (most recent call last): File "test.py", line 54, in reader.start_reading(lambda tag: print(tag.tid, tag.antenna, tag.read_count, tag.rssi)) AttributeError: 'mercury.TagReadData' object has no attribute 'tid'

can anyone help me,thank. i am use the same issues using subprocess and java api the tid is printed, but it very slowly

ramzimosalam avatar Feb 06 '20 14:02 ramzimosalam

Which python-mercuryapi version do you use?

gotthardp avatar Feb 07 '20 20:02 gotthardp

replace tag.tid in your print statement with tag.tid_read_data since the TagReadData object has no tid attribute. (Sorry I did not realize how old the question was. Leaving answer in case it helps someone else.)

markwaynelea avatar Nov 20 '20 19:11 markwaynelea