mirror of
https://github.com/micropython/micropython.git
synced 2026-01-08 13:10:21 +01:00
docs: Update docs to replace ifconfig with ipconfig.
Follow up to 1c6012b0b5
Signed-off-by: Felix Dörre <felix@dogcraft.de>
This commit is contained in:
committed by
Damien George
parent
0b58d02f70
commit
4d16a9cced
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user