Serial.available() function appears to only poll uart every 50ms #392
Unanswered
lachlan133
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am using Pi4J to send serial data to a secondary device, then await a reply before sending the next packet. I need to send many packets, so speed is critical. However, I realised that even when short circuiting the rx and tx pins to each other, and removing all code except the serial write and reads, the time between the write and the read is always slightly greater than 50ms, only ever differing by about a ms. I suspect there may be some system of underlying uart polling than only checks every 50ms, although this is just speculation based on what I have observed.
I am writing to ask if my diagnosis of the problem seems accurate, and if there is something that can be done to reduce this delay. The Kotlin code I was using to see this issue is below. Many thanks for any replies.
I was having trouble installing the latest version of Pi4J, so am using core version 1.4, device version 1.3, and gpio-extension version 1.3.
Beta Was this translation helpful? Give feedback.
All reactions