Skip to content

Commit 22050a3

Browse files
committed
esp8266/help: Add cheatsheet for basic WiFi configuration.
1 parent b639ce2 commit 22050a3

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

esp8266/help.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ STATIC const char *help_text =
3434
"For online docs please visit http://docs.micropython.org/en/latest/esp8266/ .\n"
3535
"To get diagnostic information to include in bug reports, execute 'import port_diag'.\n"
3636
"\n"
37+
"Basic WiFi configuration:\n"
38+
"\n"
39+
"import network\n"
40+
"sta_if = network.WLAN(network.STA_IF)\n"
41+
"# Scan for available access points:\n"
42+
"sta_if.scan()\n"
43+
"# Connect to an AP\n"
44+
"sta_if.connect(\"<AP_name>\", \"<password>\")\n"
45+
"# Check for successful connection:\n"
46+
"sta_if.isconnected()\n"
47+
"# Change name/password of ESP8266's AP:\n"
48+
"ap_if = network.WLAN(network.AP_IF)\n"
49+
"ap_if.config(essid=\"<AP_NAME>\", authmode=network.AUTH_WPA_WPA2_PSK, password=\"<password>\")\n"
50+
"\n"
3751
"Control commands:\n"
3852
" CTRL-A -- on a blank line, enter raw REPL mode\n"
3953
" CTRL-B -- on a blank line, enter normal REPL mode\n"

0 commit comments

Comments
 (0)