Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5354

General • Reinitialise the WiFi driver and LwIP ?

$
0
0
Does anyone know how to reinitialise the WiFi driver and LwIP from a Pico SDK program so they can be put in the state they would have been after a power-on or a reboot ?

The issue is that MicroPython remembers what was set if not power-cycled or rebooted and I need a way to change that, need to add a 'network.reboot()' function or similar. The IP Address and the rest here are 'live' not cached.

Code:

# wlan = network.WLAN(network.STA_IF)Pre-active - Before connecting to router  IP Address : 192.168.0.199  Netmask    : 255.255.255.0  Gateway    : 192.168.0.1  DNS        : 192.168.0.1  Country    : XX  Hostname   : PicoW# if wlan.ifconfig()[0] != "0.0.0.0":Checking clean start  Not clean - But tethered so not rebooting, but can disconnect# wlan.disconnect()Disconnecting from router  Waiting 30 : 3 UP# if wlan.status() == 0:Disconnected from router  IP Address : 192.168.0.199  Netmask    : 255.255.255.0  Gateway    : 192.168.0.1  DNS        : 192.168.0.1  Country    : XX  Hostname   : PicoW# wlan.active(False)Forcing deactive  IP Address : 192.168.0.199  Netmask    : 255.255.255.0  Gateway    : 192.168.0.1  DNS        : 192.168.0.1  Country    : XX  Hostname   : PicoW

Statistics: Posted by hippy — Tue Jan 16, 2024 6:03 pm — Replies 0 — Views 40



Viewing all articles
Browse latest Browse all 5354

Latest Images

Trending Articles



Latest Images