File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -184,16 +184,16 @@ See :ref:`network.WLAN <network.WLAN>` and :mod:`machine`. ::
184184 from network import WLAN
185185
186186 # configure the WLAN subsystem in station mode (the default is AP)
187- wifi = WLAN(mode=WLAN.STA)
187+ wlan = WLAN(mode=WLAN.STA)
188188 # go for fixed IP settings
189- wifi .ifconfig(config=('192.168.0.107', '255.255.255.0', '192.168.0.1', '8.8.8.8'))
190- wifi .scan() # scan for available networks
191- wifi .connect(ssid='mynetwork', auth=(WLAN.WPA2, 'mynetworkkey'))
192- while not wifi .isconnected():
189+ wlan .ifconfig(config=('192.168.0.107', '255.255.255.0', '192.168.0.1', '8.8.8.8'))
190+ wlan .scan() # scan for available networks
191+ wlan .connect(ssid='mynetwork', auth=(WLAN.WPA2, 'mynetworkkey'))
192+ while not wlan .isconnected():
193193 pass
194- print(wifi .ifconfig())
194+ print(wlan .ifconfig())
195195 # enable wake on WLAN
196- wifi .irq(trigger=WLAN.ANY_EVENT, wake=machine.SLEEP)
196+ wlan .irq(trigger=WLAN.ANY_EVENT, wake=machine.SLEEP)
197197 # go to sleep
198198 machine.sleep()
199199 # now, connect to the FTP or the Telnet server and the WiPy will wake-up
You can’t perform that action at this time.
0 commit comments