Comments (11)
Hello. The python wrapper currently implements only a very small portion of the mercuryAPI because I didn't want to implement functions that nobody needs. There is currently no way to set the device's power and read mode, but I can easily implement those for you.
Could you please describe a bit more what exactly you need?
- You want to set
/reader/radio/readPower
or/reader/powerMode
? - You want to set pseudo-acynchronous or continuous reading, or you meant something different?
from python-mercuryapi.
Hi @gotthardp - Thanks for the reply. To answer your questions.
- We're looking to set the
/radio/read/power
. - Correct. We're looking to set the pseudo-async, continuous reading
from python-mercuryapi.
Hi @eheaton, few more questions please:
- You mean
/reader/radio/readPower
, right? Will an single integer parameter inset_read_plan
do the job you need? E.g.reader.set_read_plan([1], "GEN2", power=10)
? - Do you have any thoughts on how the async-read should be architected? How shall the main loop look like? What makes the synch read() not suitable for your project?
from python-mercuryapi.
Sorry, yes - I meant /reader/radio/readPower
... the single int would be perfect.
As far as the sync read method, we're looking for a way to keep the reader in a continuous state to always be looking for tags once they get close. We currently have it looping over the read function every X seconds, which isn't bad, but we were under the impression that there's a mode you can put the reader in to do this natively.
from python-mercuryapi.
Hey @gotthardp,
Thanks for adding this functionality! I've been trying to get your updates working, but I'm encountering what I believe to be an error in how the "set_read_plan" method in Python is passing arguments to C. See below:
Traceback (most recent call last):
File "read.py", line 12, in <module>
reader.set_read_plan([1], "GEN2", 1900)
RuntimeError: More keyword list entries (3) than format specifiers (2)
Would you mind taking a look at this? I've tried recompiling after making tweaks to "Reader_set_read_plan" in C but nothing seems to have worked. Thanks again!
from python-mercuryapi.
you should specify the keyword, i.e. do reader.set_read_plan([1], "GEN2", read_power=1900)
from python-mercuryapi.
I'm still getting the same issue after changing it:
Traceback (most recent call last):
File "read.py", line 12, in <module>
reader.set_read_plan([1], "GEN2", read_power=1900)
RuntimeError: More keyword list entries (3) than format specifiers (2)
edit: this is the code causing the issue:
import sys
import time
import mercury
print("starting reader script")
reader = mercury.Reader("tmr:///dev/ttyUSB0", baudrate=115200)
reader.set_region("NA")
reader.set_read_plan([1], "GEN2", read_power=1900)
print(reader.read())
from python-mercuryapi.
My bad, sorry for that! (I don't have the reader today so I was unnable to test it.) Try now again, please.
from python-mercuryapi.
It should work now. Please do git pull
and try it.
from python-mercuryapi.
Hi again. Any success with this issue?
Please note that I did some more updates and reader.read()
now returns a list of objects rather than the list of tuples.
from python-mercuryapi.
I assume everything is OK.
from python-mercuryapi.
Related Issues (20)
- Anyone ported this to Micropython HOT 1
- TypeError: No such file or directory (Raspberry Pi)
- Windows Installer based on Python3.6 (32 bits)
- reader.get_connected_ports() always return nothing
- Timeout error - M6e Nano and Raspberry Pi Zero W HOT 4
- Why can't connect over ip+port ?? HOT 2
- Lock & unlock tag ? HOT 2
- SystemError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats HOT 3
- Installation error due to dead link of Jadak API HOT 6
- make error HOT 2
- Python freezes when reader unavailable HOT 2
- Support for powermode HOT 1
- error: subprocess-exited-with-error HOT 4
- Whether to support the chip of E710? HOT 3
- mercuryapi_osx.patch is out of sync with the SDK
- can't build on macos with make
- Can you please update the 'pip install python-mercuryapi' for the new jadak mercury api? HOT 1
- Help reading the tag data HOT 1
- Using this wrapper on new M7E pico dev kit HOT 2
- Question!! How to increase the tag read range? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-mercuryapi.