-
Notifications
You must be signed in to change notification settings - Fork 45
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
Closing and reopening the serial port during runtime #45
Comments
You can raise an exception, which will cause the code to re-initialize the connection to the CLF after some delay. In the meanwhile, you can grab access to that port in exclusive fashion from your other app, which should prevent this one from getting it back until you release it there. |
Okay. But how can I trigger such an exception that the comport is released again? Do I simply kill the HomeKey script? Just for your information, I run the whole thing under Windows 11. |
Just do |
Sorry, but I'm not really deeply versed in python. What is a |
Instead of raising an exception, you can also do something like this (right in the same part of the code you've suggested adding that logic to begin with):
For HTTP call, you can use |
Before HomeKey, I used my own system (read tag with security feature). I would like to continue using this system in parallel to HomeKey and would therefore like to switch the comport to my software when one of these tags is recognized. To do this, however, I would need to close the comport in HomeKey during runtime and open it again after my software has been processed.
Example in the service.py:
What would the syntax have to be to accomplish this?
Thank you very much for your support!
Greetings
Patcher
The text was updated successfully, but these errors were encountered: