gotthardp / python-mercuryapi

Python wrapper for the ThingMagic Mercury API
MIT License
122 stars 63 forks source link

read TID tag using python #102

Open ramzimosalam opened 4 years ago

ramzimosalam commented 4 years ago

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

gotthardp commented 4 years ago

Which python-mercuryapi version do you use?

markwaynelea commented 3 years ago

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.)