Simplified WiFi class for Pico for intuitive programming
- init(ssid, wifi_psk)
- disconnect()
- connect()
- get_status() -> str
- get_ssid() -> str
- get_ip() -> str
- get_subnet() -> str
- get_gateway() -> str
- get_dns() -> str
- get_info_json() -> str
- get_info() -> str
- __str__() -> str
- __repr__() -> str
Load both this example or the example.py
and the SimplePicoWiFi.py
files on the Raspberry Pico-W to make it work.
import urequests as requests
import time
from SimplePicoWiFi import SimplePicoWiFi
WIFI_SSID = const('example SSID')
WIFI_PASSWORD = const('example WiFi password')
wifi = SimplePicoWiFi(WIFI_SSID, WIFI_PASSWORD)
wifi.connect()
print(wifi.get_info())
print(wifi)
print(wifi.__repr__())
print(wifi.get_info_json())
res = requests.get(url='http://www.google.com/')
print(res.text)