Best way to handle Async UART responses?

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
User avatar
SureshVakati
Posts: 42
Joined: Fri Feb 24, 2017 3:52 pm

Best way to handle Async UART responses?

Post by SureshVakati » Thu Oct 19, 2017 4:29 pm

Hello Everyone,
WiFi scan and Bluetooth scan methods are generally asynchronous. I have a Redpines WiFi, Bluetooth, zigbee module. Most of the At command responses are asynchronous. Can anyone suggest me what is the best way to handle these responses in micropython?

Thank you!

User avatar
pythoncoder
Posts: 5956
Joined: Fri Jul 18, 2014 8:01 am
Location: UK
Contact:

Re: Best way to handle Async UART responses?

Post by pythoncoder » Fri Oct 20, 2017 8:09 am

The best way is to use the uasyncio library. There is an unofficial tutorial, including a demo program illustrating the use of UARTs, here https://github.com/peterhinch/micropython-async.git (follow the link to the tutorial).
Peter Hinch
Index to my micropython libraries.

Post Reply