diff --git a/micropython/examples/automation2040w/web_io_interface/main.py b/micropython/examples/automation2040w/web_io_interface/main.py index 7a8c668d..dd5b70f9 100644 --- a/micropython/examples/automation2040w/web_io_interface/main.py +++ b/micropython/examples/automation2040w/web_io_interface/main.py @@ -40,7 +40,7 @@ try: except ImportError: # WIFI settings - WIFI_COUNTRY = "GB" # Changeme! + WIFI_COUNTRY = "GB" # Change to your local two-letter ISO 3166-1 country code network_manager = NetworkManager(WIFI_COUNTRY, status_handler=status_handler) uasyncio.get_event_loop().run_until_complete(network_manager.client(WIFI_CONFIG.SSID, WIFI_CONFIG.PSK)) # Install missing module @@ -60,7 +60,7 @@ else: html_file = open('index.html', 'r') # WIFI settings -WIFI_COUNTRY = "GB" # Changeme! +WIFI_COUNTRY = "GB" # Change to your local two-letter ISO 3166-1 country code class LEDs: diff --git a/micropython/examples/badger2040w/WIFI_CONFIG.py b/micropython/examples/badger2040w/WIFI_CONFIG.py index 76d4a887..ed8ec292 100644 --- a/micropython/examples/badger2040w/WIFI_CONFIG.py +++ b/micropython/examples/badger2040w/WIFI_CONFIG.py @@ -1,3 +1,3 @@ SSID = "" PSK = "" -COUNTRY = "" +COUNTRY = "" # Change to your local two-letter ISO 3166-1 country code diff --git a/micropython/examples/badger2040w/lib/network_manager.py b/micropython/examples/badger2040w/lib/network_manager.py index 78b53f56..fb21c2c4 100644 --- a/micropython/examples/badger2040w/lib/network_manager.py +++ b/micropython/examples/badger2040w/lib/network_manager.py @@ -7,7 +7,7 @@ import uasyncio class NetworkManager: _ifname = ("Client", "Access Point") - def __init__(self, country="GB", client_timeout=30, access_point_timeout=5, status_handler=None, error_handler=None): + def __init__(self, country="GB", client_timeout=60, access_point_timeout=5, status_handler=None, error_handler=None): rp2.country(country) self._ap_if = network.WLAN(network.AP_IF) self._sta_if = network.WLAN(network.STA_IF) @@ -74,8 +74,8 @@ class NetworkManager: self._ap_if.active(False) self._sta_if.active(True) - self._sta_if.connect(ssid, psk) self._sta_if.config(pm=0xa11140) + self._sta_if.connect(ssid, psk) try: await uasyncio.wait_for(self.wait(network.STA_IF), self._client_timeout) diff --git a/micropython/examples/common/WIFI_CONFIG.py b/micropython/examples/common/WIFI_CONFIG.py index b1356062..a9888ecc 100644 --- a/micropython/examples/common/WIFI_CONFIG.py +++ b/micropython/examples/common/WIFI_CONFIG.py @@ -1,3 +1,3 @@ SSID = "YOUR_WIFI_SSID" PSK = "YOUR_WIFI_PASSWORD" -COUNTRY = "YOUR_COUNTRY_CODE" +COUNTRY = "YOUR_COUNTRY_CODE" # Change to your local two-letter ISO 3166-1 country code diff --git a/micropython/examples/common/network_manager.py b/micropython/examples/common/network_manager.py index d4d59230..fb21c2c4 100644 --- a/micropython/examples/common/network_manager.py +++ b/micropython/examples/common/network_manager.py @@ -7,7 +7,7 @@ import uasyncio class NetworkManager: _ifname = ("Client", "Access Point") - def __init__(self, country="GB", client_timeout=30, access_point_timeout=5, status_handler=None, error_handler=None): + def __init__(self, country="GB", client_timeout=60, access_point_timeout=5, status_handler=None, error_handler=None): rp2.country(country) self._ap_if = network.WLAN(network.AP_IF) self._sta_if = network.WLAN(network.STA_IF) @@ -74,6 +74,7 @@ class NetworkManager: self._ap_if.active(False) self._sta_if.active(True) + self._sta_if.config(pm=0xa11140) self._sta_if.connect(ssid, psk) try: diff --git a/micropython/examples/cosmic_unicorn/http_text/html_text.py b/micropython/examples/cosmic_unicorn/http_text/html_text.py index 8ba4003f..a8845763 100644 --- a/micropython/examples/cosmic_unicorn/http_text/html_text.py +++ b/micropython/examples/cosmic_unicorn/http_text/html_text.py @@ -67,7 +67,7 @@ app = webserver() html_file = open('index.html', 'r') # WIFI settings -WIFI_COUNTRY = "GB" # Changeme! +WIFI_COUNTRY = "GB" # Change to your local two-letter ISO 3166-1 country code # Index page diff --git a/micropython/examples/cosmic_unicorn/launch/today.py b/micropython/examples/cosmic_unicorn/launch/today.py index 28e797a9..d54a5681 100644 --- a/micropython/examples/cosmic_unicorn/launch/today.py +++ b/micropython/examples/cosmic_unicorn/launch/today.py @@ -36,6 +36,7 @@ def network_connect(SSID, PSK): # Sets the Wireless LED pulsing and attempts to connect to your local network. print("connecting...") + wlan.config(pm=0xa11140) # Turn WiFi power saving off for some slow APs wlan.connect(SSID, PSK) while max_wait > 0: diff --git a/micropython/examples/cosmic_unicorn/today.py b/micropython/examples/cosmic_unicorn/today.py index 15f7694d..974ee583 100644 --- a/micropython/examples/cosmic_unicorn/today.py +++ b/micropython/examples/cosmic_unicorn/today.py @@ -44,6 +44,7 @@ def network_connect(SSID, PSK): # Sets the Wireless LED pulsing and attempts to connect to your local network. print("connecting...") + wlan.config(pm=0xa11140) # Turn WiFi power saving off for some slow APs wlan.connect(SSID, PSK) while max_wait > 0: diff --git a/micropython/examples/galactic_unicorn/clock.py b/micropython/examples/galactic_unicorn/clock.py index 8e23be52..3dccd02f 100644 --- a/micropython/examples/galactic_unicorn/clock.py +++ b/micropython/examples/galactic_unicorn/clock.py @@ -119,6 +119,7 @@ def sync_time(): # Start connection wlan = network.WLAN(network.STA_IF) wlan.active(True) + wlan.config(pm=0xa11140) # Turn WiFi power saving off for some slow APs wlan.connect(WIFI_SSID, WIFI_PASSWORD) # Wait for connect success or failure diff --git a/micropython/examples/inky_frame/inkylauncher/inky_helper.py b/micropython/examples/inky_frame/inkylauncher/inky_helper.py index 411506da..2d680aee 100644 --- a/micropython/examples/inky_frame/inkylauncher/inky_helper.py +++ b/micropython/examples/inky_frame/inkylauncher/inky_helper.py @@ -93,6 +93,7 @@ def network_connect(SSID, PSK): # Sets the Wireless LED pulsing and attempts to connect to your local network. pulse_network_led() + wlan.config(pm=0xa11140) # Turn WiFi power saving off for some slow APs wlan.connect(SSID, PSK) while max_wait > 0: diff --git a/micropython/examples/interstate75/75W/clock.py b/micropython/examples/interstate75/75W/clock.py index d3b5fd47..c227393a 100644 --- a/micropython/examples/interstate75/75W/clock.py +++ b/micropython/examples/interstate75/75W/clock.py @@ -115,6 +115,7 @@ def sync_time(): # Start connection wlan = network.WLAN(network.STA_IF) wlan.active(True) + wlan.config(pm=0xa11140) # Turn WiFi power saving off for some slow APs wlan.connect(WIFI_SSID, WIFI_PASSWORD) # Wait for connect success or failure