Hello
is it possible to set callback when network scan (get RSSI and MAC address of APs) is in process?
This scan takes at least 2 seconds and in this time I want to do another things with i2c and get the scan result when is done.
Thanks Mike
Network scan callback
Re: Network scan callback
Is it possible to do wlan scan faster or to run it with uasincio and pulling data from i2c while wlan scan has running????
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: Network scan callback
The network.scan method is a blocking function and does not return to the caller until it has results. So uasyncio won't help you: it's a cooperative scheduler which requires non-blocking functions to work in a timely fashion. Your only chance is to use _thread which is a pre-emptive scheduler. Alas I have no experience of this on the ESP8266: the hardware is resource constrained and threading is more demanding than uasyncio. Perhaps others can advise.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.