Pico W Wifi #15391
Replies: 2 comments 2 replies
-
Maintaining a connection requires asynchronous coding. An example is mqtt_as, a "resilient" MQTT client which detects outages and reconnects. In general outages can be either the WiFi connection or the remote resource to which you are connecting. You need to run a task which periodically polls the resource and detects an outage - if one occurs, the task makes repeated attempts to reconnect until it succeeds. The polling task tells the main communication task whether connectivity is currently available. You might like to read my notes on writing resilient apps. The best way to write such code is to use |
Beta Was this translation helpful? Give feedback.
-
Here is a block of code from a fairly high-reliability network device I built. Note the
|
Beta Was this translation helpful? Give feedback.
-
Hello
Very new to the Pico/Micropython coding but I am running into an issue.
I have tried searching on here and other forums to no avail, but I don't believe I am the only one having this issue.
I am using the code below from the Raspberry pi website on my picoW and it works perfectly.
The issue I have is when wifi is lost the PicoW doesn't reconnect unless I physically power off and on the device.
Is there another piece of code to allow it to reconnect should the wifi disconnect?
Beta Was this translation helpful? Give feedback.
All reactions