Skip to content
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

Add serial port support #211

Open
agronholm opened this issue Feb 24, 2021 · 7 comments
Open

Add serial port support #211

agronholm opened this issue Feb 24, 2021 · 7 comments
Labels
enhancement New feature or request

Comments

@agronholm
Copy link
Owner

We should look at pyserial to figure out what needs to be done to support I/O on serial ports. Hopefully C extensions or CFFI are not needed.

@agronholm agronholm added the enhancement New feature or request label Feb 24, 2021
@agronholm
Copy link
Owner Author

One thing looks clear: Serial port initialization and handling is really tricky. We don't want to duplicate pyserial's efforts, but maybe provide stream classes that work through pyserial.

@smurfix
Copy link
Collaborator

smurfix commented Feb 24, 2021

https://github.com/M-o-a-T/anyio_serial.git does that. Granted that delegating absolutely everything to a worker thread is not an optimal solution by a long shot, but at least it gets the job done.

@agronholm
Copy link
Owner Author

Just a quick observation: your README uses markdown syntax but the file suffix is .rst.

@smurfix
Copy link
Collaborator

smurfix commented Feb 24, 2021

Thanks, that file did need some attention. :-/

@agronholm
Copy link
Owner Author

I have a number of other changes I'd like to make in that repo. Can we talk in the AnyIO Gitter room?

@agronholm
Copy link
Owner Author

Windows + asyncio is the only problematic point here. It might be possible to use the private API of the proactor event loop for doing overlapped I/O on the serial port. On other platforms, all we have to do is add a reader for it. I'll take a stab at this for v3.1 if I manage to getmyself a USB-serial converter.

@agronholm agronholm added this to the 3.1 milestone Apr 7, 2021
@agronholm
Copy link
Owner Author

I found code that can do asynchronous serial I/O on ProactorEventLoop without (user-space) threads: https://github.com/m-labs/asyncserial/blob/master/asyncserial/asyncserial.py

@agronholm agronholm removed this from the 3.1 milestone May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants