GithubHelp home page GithubHelp logo

Comments (11)

gotthardp avatar gotthardp commented on May 31, 2024

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.

eheaton avatar eheaton commented on May 31, 2024

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.

gotthardp avatar gotthardp commented on May 31, 2024

Hi @eheaton, few more questions please:

  • You mean /reader/radio/readPower, right? Will an single integer parameter in set_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.

eheaton avatar eheaton commented on May 31, 2024

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.

ENAML avatar ENAML commented on May 31, 2024

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.

gotthardp avatar gotthardp commented on May 31, 2024

you should specify the keyword, i.e. do reader.set_read_plan([1], "GEN2", read_power=1900)

from python-mercuryapi.

ENAML avatar ENAML commented on May 31, 2024

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.

gotthardp avatar gotthardp commented on May 31, 2024

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.

gotthardp avatar gotthardp commented on May 31, 2024

It should work now. Please do git pull and try it.

from python-mercuryapi.

gotthardp avatar gotthardp commented on May 31, 2024

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.

gotthardp avatar gotthardp commented on May 31, 2024

I assume everything is OK.

from python-mercuryapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.