Hello, when quickly sending to uart .write (several at a time) some data is lost, how can I prevent this?
baudrate: 115200, rxbuf = 250, txbuf = 250
If it keeps 0.15ms interval it is OK. Reducing the baudrate to 9600 does not solve the problem.
micropython: 1.14 (esp32)
Thanks for help.
Data loss when sending to UART.
Data loss when sending to UART.
Last edited by prem111 on Sat Apr 30, 2022 4:07 pm, edited 2 times in total.
Re: Data loss when sending to UART.
You can get some solutions from this old thread: viewtopic.php?t=6244
Re: Data loss when sending to UART.
Changing the rxbuf does not help.tepalia02 wrote: ↑Sat Apr 30, 2022 1:34 pmYou can get some solutions from this old thread: viewtopic.php?t=6244
Re: Data loss when sending to UART.
Have you tried any other baud rate? For example, 9600?
Re: Data loss when sending to UART.
It doesn't help, and it even gets worse. I actually located the problem, unfortunately I do not know the solution. The problem with reading from UART is when I use uart.write at the same time (another task in uasyncio - I'm using StreamWriter and StremReader). The solution would be to block .write for .read time, but I don't know how to do that ...
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Data loss when sending to UART.
It would help if you showed us a code sample that exhibits the problem, and also tell us what hardware you're using. I've used StreamWriter and StreamReader quite extensively, including concurrent reading and writing, and not seen this effect. If it can be demonstrated it's a bug that we should report.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: Data loss when sending to UART.
Sorry, it was my mistake, uart async is ok.pythoncoder wrote: ↑Sun May 01, 2022 9:58 amIt would help if you showed us a code sample that exhibits the problem, and also tell us what hardware you're using. I've used StreamWriter and StreamReader quite extensively, including concurrent reading and writing, and not seen this effect. If it can be demonstrated it's a bug that we should report.