-
Notifications
You must be signed in to change notification settings - Fork 134
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
UART adaptations for modern Raspbian #56
Conversation
stephanmantler
commented
Sep 26, 2017
- Modernized tty naming ("serial0" / "serial1")
- Added 2400 / 4800 speeds
- Made open() nonblocking (fixes hang on open() call)
- Added 2400 / 4800 speeds - Made open() nonblocking (fixes hang on open() call)
Thanks Stephan for submitting this! Regarding the links, on my Pi3 with Stretch they point to:
Where AMA0 was the serial accessible via P14-15 that was normally returned by UARTs(for:). |
The names of these device files can vary wildly. I would suggest searching a list of possible serial device names. Examples include: |
AFAIK /dev/serial0 etc. are automatically symlinked to the ‘logical’ choice on Raspberry Pi’s (ttyAMA0 on Pi/Pi2; ttyS0 on Pi3) so that should work as intended (I hope). One nice consequence is that the constructor can be used to instantiate any references to /dev/* directly (and not just /dev/tty*) in case the predefined lists are inaccurate or insufficient (eg. with USB ports). I’ll revert the change for the CHIP. |
Yeah, I could verify it only on the Pi1 but I'm pretty confident that's correct, after reading this (tl;dr: the fast ttyAMA0 is ootb used for the bluetooth chip on Pi3).
Yep, this would definitely be an improvement, making the whole thing less static. I'm opening a separate issue for this (#57) since it requires additional considerations. |
- refactored SysFSUART init() to take a list of devices to try in order of prefrerence (first successful wins)
Turns out the non blocking flag requires some additional changes. I’ll submit another pull request soon that reverts non blocking opening (which should really have been a separate patch) and implements the prioritized list approach more or less as discussed. |
Perfect, thanks! |