January 30, 2024, 18:03
Connecting to blynk.cloud:443... Connecting to blynk.cloud:443... Traceback (most recent call last): File "<stdin>", line 77, in <module> File "BlynkLib.py", line 259, in run AttributeError: 'module' object has no attribute 'timeout'
def _cleanup(self): self.wifi_ap.disconnect() self.wifi_ap.active(False) while self.wifi_ap.isconnected(): log('AP disconnecting...') time.sleep(1) pass log('wifi ap status: ', self.wifi_ap.status())
connecting... connecting... connecting... Wifi AP Status: - Wifi ifconfig: ('0.0.0.0', '255.255.255.0', '192.168.0.1', '192.168.1.1') - No connection and no activity Wifi Client Status: - Wifi ifconfig: ('192.168.1.254', '255.255.255.0', '192.168.1.1', '192.168.1.1') - Connected! Testing connection to google.com... ('142.250.65.206', 80) Traceback (most recent call last): File "<stdin>", line 30, in <module> File "BlynkEdgentPico.py", line 237, in provision OSError: [Errno 113] EHOSTUNREACHso I do get the DNS response to obtain the IP of 'google.com', which confirms my connection to my real router, 192.168.1.1, is working. but then the actual host outside of the network is unreachable. The AP object is disconnected and deactivated. I added some more code to reset the AP object's ifconfig, so it didn't retain the old IP info.
wifi_ap = network.WLAN(network.AP_IF) wifi_client = network.WLAN(network.STA_IF) wifi_ap.active(True) wifi_client.active(True) # scan() only works on STA (client) interface # also, must be active(True) to scan scan() deactivate_all_wifi() create_ap() do_provisioning_things() deactivate_all_wifi() connect_as_wifi_client() test_connection_to_internet()