summaryrefslogtreecommitdiffstatshomepage
path: root/docs/esp8266
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/esp8266
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/esp8266')
-rw-r--r--docs/esp8266/quickref.rst4
-rw-r--r--docs/esp8266/tutorial/network_basics.rst12
2 files changed, 8 insertions, 8 deletions
diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst
index ed21997370..b130ce65db 100644
--- a/docs/esp8266/quickref.rst
+++ b/docs/esp8266/quickref.rst
@@ -59,7 +59,7 @@ The :mod:`network` module::
wlan.isconnected() # check if the station is connected to an AP
wlan.connect('ssid', 'key') # connect to an AP
wlan.config('mac') # get the interface's MAC address
- wlan.ifconfig() # get the interface's IP/netmask/gw/DNS addresses
+ wlan.ipconfig('addr4') # get the interface's IPv4 addresses
ap = network.WLAN(network.AP_IF) # create access-point interface
ap.active(True) # activate the interface
@@ -76,7 +76,7 @@ A useful function for connecting to your local WiFi network is::
wlan.connect('ssid', 'key')
while not wlan.isconnected():
pass
- print('network config:', wlan.ifconfig())
+ print('network config:', wlan.ipconfig('addr4'))
Once the network is established the :mod:`socket <socket>` module can be used
to create and use TCP/UDP sockets as usual.
diff --git a/docs/esp8266/tutorial/network_basics.rst b/docs/esp8266/tutorial/network_basics.rst
index dc3cd3dd5e..9d74a6283a 100644
--- a/docs/esp8266/tutorial/network_basics.rst
+++ b/docs/esp8266/tutorial/network_basics.rst
@@ -19,10 +19,10 @@ You can check if the interfaces are active by::
You can also check the network settings of the interface by::
- >>> ap_if.ifconfig()
- ('192.168.4.1', '255.255.255.0', '192.168.4.1', '8.8.8.8')
+ >>> ap_if.ipconfig('addr4')
+ ('192.168.4.1', '255.255.255.0')
-The returned values are: IP address, netmask, gateway, DNS.
+The returned values are: IP address and netmask.
Configuration of the WiFi
-------------------------
@@ -45,8 +45,8 @@ To check if the connection is established use::
Once established you can check the IP address::
- >>> sta_if.ifconfig()
- ('192.168.0.2', '255.255.255.0', '192.168.0.1', '8.8.8.8')
+ >>> sta_if.ipconfig('addr4')
+ ('192.168.0.2', '255.255.255.0')
You can then disable the access-point interface if you no longer need it::
@@ -64,7 +64,7 @@ connect to your WiFi network::
sta_if.connect('<ssid>', '<key>')
while not sta_if.isconnected():
pass
- print('network config:', sta_if.ifconfig())
+ print('network config:', sta_if.ipconfig('addr4'))
Sockets
-------