-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 4.0 #1128
Comments
|
Sounds good to me! |
|
another useful thing, |
|
i think this ^ is also essentially what #254 is asking for |
|
reset_input_buffer() would also be great, flush input buffer, great for getting clean packets :) |
|
Added a to-do list to initial comment. |
|
The addition of in_waiting has made non-blocking timed reads much easier; however, I think it would be very valuable to have the write_timeout separate from timeout, as is the case in pySerial. It is very common to want to wait on writes but not on reads, so separate timeouts are handy. Also useful is out_waiting, in this case so you can implement your own buffering. I've been trying to do a bunch of asynio type stuff with the UART and those two (along with my 0 timeout fix) would be a very big boon. Of course, having the same units for timeouts would be nice too! At some point cts/rts support might be nice, though they could be added non-breaking later. |
|
i think we're slowly going to try and add all pyserial supported functions, but ya some are more useful than others :) |
|
Will there be a way to get a UART interface "on top of" the console? That is, will we be able to use these IO methods to talk to the USB Serial port (ala input() / print())? If so, I'd like to offer to help test/debug this effort (point me at the right person please). If not, I think I'll add the "usb_bytes_available" module that Scott requested instead of the input() timeout. Bill |
|
@ATMakersBill That's the idea in #231. We'll have UART like interface for the second USB CDC connection. |
|
Hmmmm... second CDC? Will that show up as a second COM port (or tty on Linux)? If so, will there be a way to differentiate the two? |
|
Yes, it would be a second COM or tty port, and distinguishing them is probably going to be a problem. In Windows 10 it would just be another "USB Serial Device", unless we had the user install drivers, but we've been trying to get away from that given that Windows 10 has innate |
|
Ok, a separate PID would work. Also, I believe you can set the "Name" field in the descriptor (it's currently just Both lsusb on linux and PowerShell on Windows can extract that name |
|
That name (in Windows) is set by the (built-in_ driver). I'm not sure giving a name in the USB descriptor will show up on Device Manager. |
|
Interesting - I know that when I plug things and look at them in Arduino they have the device name - I assumed that was sent in in the Name field... perhaps there's a lookup table for the PID? |
|
Here's what Windows (PowerShell) can see easily about a Serial Port... perhaps we can control something in here: |
|
I have started working on finishing this off. |
|
yay! |
|
Changes made. There are bugs discovered in existing UART timeout logic that will be addressed in a new issue. |
|
Hello I am new to Circuitpython I just wanted to ask since strings are not allowed how can I send a Ascii string over Uart and the \n\r (basically ENTER over Uart): My current code looks like this Basically I want to send the command psuState and ENTER to get my values from the other board. |
|
Hi @Cyb3r-N1nja ! Github issues are not a good place to get help with CircuitPython or support for Adafruit products. For community help with CircuitPython, please visit our discord: https://adafru.it/discord and for help with Adafruit products please use the forums at https://forums.adafruit.com/ |
Here are some breaking-change requests to make uart match CPython (pyserial)
timeoutarg to seconds rather than millisecondsUART.in_waitingfrom PySerial. Added by UART enhancements #1186.UART.reset_input_bufferfrom PySerial. Added by UART enhancements #1186.also, any other functions/apis that vary from https://pyserial.readthedocs.io/en/latest/pyserial_api.html would be good to bring in line at the same time.
The text was updated successfully, but these errors were encountered: