UART buffer flush
-
Hello,
l am using below code to wait for the UART data and take action accordingly. It works for the first time but once I receive some data uart.any() is always true after that. The uart buffer doesn't get clear it seems. Please check.
while(1):
if uart.any():
data = uart.readall()
print("data received over UART:"+str(data))
s.setblocking(True)
print(s.send(data))
time.sleep(0.5)
del dataObjective is to send data only when there is a new data available over uart.
Regards,
Sameer -
@sameerchouksey It could be related to this issue:
https://forum.pycom.io/topic/2595/uart-rx-buffer-issue-after-buffer-overflow
That is about to be fixed soon. -
Hi,
Yes, it seems to be the same issue. When can I expect a fix for this?
Any work around? any other api to check new data arrival at UART?
Regards
Sameer -
This post is deleted!
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login