summaryrefslogtreecommitdiffstatshomepage
path: root/docs/wipy
diff options
context:
space:
mode:
authorFelix Dörre <felix@dogcraft.de>2024-03-18 00:57:22 +0000
committerDamien George <damien@micropython.org>2024-07-05 16:06:04 +1000
commit4d16a9cced42ad0a298f1be8b993357abe7398ab (patch)
treeaa331b1eb122d5a5ed3774726eb96be7c6b90313 /docs/wipy
parent0b58d02f70cb883bf19ceec5536be59984f22d90 (diff)
downloadmicropython-4d16a9cced42ad0a298f1be8b993357abe7398ab.tar.gz
micropython-4d16a9cced42ad0a298f1be8b993357abe7398ab.zip
docs: Update docs to replace ifconfig with ipconfig.
Follow up to 1c6012b0b5c62f18130217f30e73ad3ce4c8c9e6 Signed-off-by: Felix Dörre <felix@dogcraft.de>
Diffstat (limited to 'docs/wipy')
-rw-r--r--docs/wipy/quickref.rst6
-rw-r--r--docs/wipy/tutorial/wlan.rst5
2 files changed, 6 insertions, 5 deletions
diff --git a/docs/wipy/quickref.rst b/docs/wipy/quickref.rst
index d6abb8d1c7..9068ee8a37 100644
--- a/docs/wipy/quickref.rst
+++ b/docs/wipy/quickref.rst
@@ -184,18 +184,18 @@ WLAN (WiFi)
See :ref:`network.WLAN <network.WLAN>` and :mod:`machine`. ::
- import machine
+ import machine, network
from network import WLAN
# configure the WLAN subsystem in station mode (the default is AP)
wlan = WLAN(mode=WLAN.STA)
# go for fixed IP settings
- wlan.ifconfig(config=('192.168.0.107', '255.255.255.0', '192.168.0.1', '8.8.8.8'))
+ network.ipconfig(dns='8.8.8.8')
+ wlan.ipconfig(addr4='192.168.0.107/24', gw4='192.168.0.1')
wlan.scan() # scan for available networks
wlan.connect(ssid='mynetwork', auth=(WLAN.WPA2, 'mynetworkkey'))
while not wlan.isconnected():
pass
- print(wlan.ifconfig())
# enable wake on WLAN
wlan.irq(trigger=WLAN.ANY_EVENT, wake=machine.SLEEP)
# go to sleep
diff --git a/docs/wipy/tutorial/wlan.rst b/docs/wipy/tutorial/wlan.rst
index bdfd3e0a54..acc67a4b28 100644
--- a/docs/wipy/tutorial/wlan.rst
+++ b/docs/wipy/tutorial/wlan.rst
@@ -50,14 +50,15 @@ Assigning a static IP address when booting
If you want your WiPy to connect to your home router after boot-up, and with a fixed
IP address so that you can access it via telnet or FTP, use the following script as /flash/boot.py::
- import machine
+ import machine, network
from network import WLAN
wlan = WLAN() # get current object, without changing the mode
if machine.reset_cause() != machine.SOFT_RESET:
wlan.init(WLAN.STA)
# configuration below MUST match your home router settings!!
- wlan.ifconfig(config=('192.168.178.107', '255.255.255.0', '192.168.178.1', '8.8.8.8'))
+ network.ipconfig(dns='8.8.8.8')
+ wlan.ipconfig(addr4='192.168.0.107/24', gw4='192.168.0.1')
if not wlan.isconnected():
# change the line below to match your network ssid, security and password