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

Question : Targetting several tags

Open PierreAuriau opened this issue 4 years ago • 13 comments

Hello,

Is it possible to target more than one tag with the function set_read_plan ?

Thank you,

Pierre

PierreAuriau avatar Aug 26 '19 16:08 PierreAuriau

Hello. It is not possible at this moment, unfortunately.

gotthardp avatar Aug 26 '19 17:08 gotthardp

Ok, thank you very much !

PierreAuriau avatar Aug 27 '19 08:08 PierreAuriau

I will keep this issue open until it is fixed. (No date promised.)

gotthardp avatar Aug 27 '19 09:08 gotthardp

Question: Does somebody need this, or it it just a nice to have feature?

gotthardp avatar Aug 28 '19 15:08 gotthardp

It could be nice to have the feature because targetting a tag is much more efficient and faster than reading all tags and searching for the good ones !

PierreAuriau avatar Aug 29 '19 10:08 PierreAuriau

Hello again. I finally understood and implemented the multi-filters, but it's a bit complicated, so I am not sure if I got the API right. Have a look and let me know what you think.

gotthardp avatar Aug 30 '19 18:08 gotthardp

Thank you very much for your work and sorry to answer lately. I achieved to create a filter and to apply it with the function set_read_plan() but after that, the function reader.read() does not work anymore (with the error "Unsupported operation"). Do you know where this error comes from ? Shall I use asynchronous reading ?

PierreAuriau avatar Sep 02 '19 11:09 PierreAuriau

Hello. This used to be a problem of one of the previous commits. Please get the very latest code (comited few secs ago), build it and don't forget to install it. The error shall disappear.

gotthardp avatar Sep 02 '19 11:09 gotthardp

Re, I reinstall twice the wrapper but I still have the same issue. I may make a mistake, here my two-lign code :

epc_targets = [{'epc':b'1', 'bit':32}, {'epc':b'2', 'bit':32}]
reader.set_read_plan([1], 'GEN2',epc_targets, bank = ['epc'], read_power = 2900 )
reader.read()

Thank you !

PierreAuriau avatar Sep 02 '19 16:09 PierreAuriau

This b'1' and b'2' is what you really use?

gotthardp avatar Sep 02 '19 16:09 gotthardp

No no it was just an example in order to make my code clearer

PierreAuriau avatar Sep 03 '19 08:09 PierreAuriau

My code is

reader.set_read_plan(reader.get_antennas(), "GEN2", bank=["epc"], epc_target=[{'epc':b'000000000000221612000631'}, {'epc':b'000000000000228510000023'}])

or even

reader.set_read_plan(reader.get_antennas(), "GEN2", bank=["epc"], epc_target=[b'000000000000221612000631',b'000000000000228510000023'])

gotthardp avatar Sep 03 '19 09:09 gotthardp

Hello ! Sorry, I forgot to answer you but thanks a lot, it is now working for me ! But, when I try to select more than 3 tags, I get the same error as before. Here is my code : reader.set_read_plan([1],'GEN2', bank=['epc'], epc_target = [b'201909180000000000000006', b'201909180000000000000008', b'201909180000000000000002', b'201909180000000000000010']) reader.read() And I get the error : RuntimeError : Unsupported operation

Thank you in advance

PierreAuriau avatar Nov 20 '19 14:11 PierreAuriau