Comments (4)
The error appears to be thrown at (re)instantiation of the reader, not at reader.stop(). Could it be a bug in your code?
from python-mercuryapi.
Hey,
yeah you're right. It does not happen on reader.stop_reading(). The Timeout exception is thrown at
reader = mercury.Reader(XYZ) if a read process is ongoing.
Do you have a clever on how to stop a ongoing reading process?
from python-mercuryapi.
the read() function has a timeout. it cannot be interrupted
from python-mercuryapi.
For everyone that has similar issues, here is what the problem ist/how to solve it:
It is not possible to define reader = mercury.Reader("tmr:///dev/ttyUSB0")
if a read is ongoing. The channel is being used and therefore blocks the new connection.
The read has to be stopped correctly before reconnection with reader.stop_reading()
.
However sometimes it takes some time until the read is stopped. In my case, the read function is a very complex one. So i wrapped my entire read process inside a thread and gave it an attribute. If this attribute is set to False, the read will be stopped with reader.stop_reading()
and just to be sure it is really stopped, the entire Thread is stopped. But this is a custom solution I guess.
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.