-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
reader.start_reading #39
Comments
Yeah. The bank retrieval is not supported for the continuous reading. This is how the MercuryAPI works. They assume the user first reads all tags (e.g. by the continuous reading) and then makes a targeted request to read the bank data. I think this is because the operation is quite time&energy consuming. |
I see, so what function should I use if I want to keep track of whats near the antenna every minute, should I use the reader.read() function or reader.start reading and run it for a quick second? What is their difference in terms of printout. |
The read() is synchronous and can read the bank data. The start_read() is asynchronous, so your python program can continue and do other tasks while scanning. If you don't need the asynchronicity, then the start_read() is of no use for you. |
@gotthardp Can you post a sample code on how to read user data with the bank parameter?
|
The following works for me #!/usr/bin/env python3
from __future__ import print_function
import mercury
reader = mercury.Reader("tmr://dev/ttyUSB0", baudrate=115200)
reader.set_region("EU3")
reader.set_read_plan(reader.get_antennas(), "GEN2", "user")
for tag in reader.read(timeout=450):
print("EPC", tag.epc)
print("Antenna", tag.antenna)
print("Count", tag.read_count)
print("RSSI", tag.rssi)
print("user", tag.user_mem_data) |
Hey @gotthardp
As you can see, the second tag does not return user data. That is, if two tags are read at the same time. Both show the correct user data if read seperately. |
Hi can you post a sample code for the start_reading and what response are you getting? Thanks! |
The https://github.com/gotthardp/python-mercuryapi/blob/master/test.py contains a sample start_reading code. Do you need something more? |
Yeah sorry, let me rephrase my question. Basically what I need is a fast continuous read from the m6e that returns tags and its rssi. Can you help me with that? Thanks! |
When I ran the test.py, I'm getting tag reads however it seems to be inconsistent and doesn't read all of the tags I placed on top of the antenna. |
You may need more antennas or multiple read attempts if there are many tags. But this is beyond this library. |
There was a bug fixed in the code, so the original issue has been addressed. |
Im having issue running the reader.start_reading call function when setting the read plan to include for the bank arguments. For example when I set: reader.set_readplan([1], "GEN2", bank=["epc", "reserved"], read_power=1400), the reader.start_reading call returns nothing. When I get rid of the bank argument it starts to work however the bank arguments will print as "None" such as the reserved, tid etc.
The text was updated successfully, but these errors were encountered: