diff --git a/examples/tiny_fx_w/examples/wireless/cheerlights.py b/examples/tiny_fx_w/examples/wireless/cheerlights.py index 023f969..46e2c22 100644 --- a/examples/tiny_fx_w/examples/wireless/cheerlights.py +++ b/examples/tiny_fx_w/examples/wireless/cheerlights.py @@ -14,9 +14,10 @@ try: from secrets import WIFI_SSID, WIFI_PASSWORD + if len(WIFI_SSID) == 0: + raise ValueError("no WiFi network set. Open the 'secrets.py' file on your device to add your WiFi credentials") except ImportError: - print("Create secrets.py with your WiFi credentials") - raise + raise ImportError("no module named 'secrets'. Create a 'secrets.py' file on your device with your WiFi credentials") # Constants @@ -33,6 +34,7 @@ try: # Connect to WLAN wlan.active(True) + print(f"Connecting to network '{WIFI_SSID}'") wlan.connect(WIFI_SSID, WIFI_PASSWORD) # Wait until the connection is established diff --git a/examples/tiny_fx_w/examples/wireless/random.py b/examples/tiny_fx_w/examples/wireless/random.py index 09d4809..2d60ff9 100644 --- a/examples/tiny_fx_w/examples/wireless/random.py +++ b/examples/tiny_fx_w/examples/wireless/random.py @@ -13,9 +13,10 @@ try: from secrets import WIFI_SSID, WIFI_PASSWORD + if len(WIFI_SSID) == 0: + raise ValueError("no WiFi network set. Open the 'secrets.py' file on your device to add your WiFi credentials") except ImportError: - print("Create secrets.py with your WiFi credentials") - raise + raise ImportError("no module named 'secrets'. Create a 'secrets.py' file on your device with your WiFi credentials") # Constants @@ -33,6 +34,7 @@ try: # Connect to WLAN wlan.active(True) + print(f"Connecting to network '{WIFI_SSID}'") wlan.connect(WIFI_SSID, WIFI_PASSWORD) # Wait until the connection is established