esp8266/help: Add cheatsheet for basic WiFi configuration.
This commit is contained in:
parent
b639ce27c7
commit
22050a3ed0
@ -34,6 +34,20 @@ STATIC const char *help_text =
|
|||||||
"For online docs please visit http://docs.micropython.org/en/latest/esp8266/ .\n"
|
"For online docs please visit http://docs.micropython.org/en/latest/esp8266/ .\n"
|
||||||
"To get diagnostic information to include in bug reports, execute 'import port_diag'.\n"
|
"To get diagnostic information to include in bug reports, execute 'import port_diag'.\n"
|
||||||
"\n"
|
"\n"
|
||||||
|
"Basic WiFi configuration:\n"
|
||||||
|
"\n"
|
||||||
|
"import network\n"
|
||||||
|
"sta_if = network.WLAN(network.STA_IF)\n"
|
||||||
|
"# Scan for available access points:\n"
|
||||||
|
"sta_if.scan()\n"
|
||||||
|
"# Connect to an AP\n"
|
||||||
|
"sta_if.connect(\"<AP_name>\", \"<password>\")\n"
|
||||||
|
"# Check for successful connection:\n"
|
||||||
|
"sta_if.isconnected()\n"
|
||||||
|
"# Change name/password of ESP8266's AP:\n"
|
||||||
|
"ap_if = network.WLAN(network.AP_IF)\n"
|
||||||
|
"ap_if.config(essid=\"<AP_NAME>\", authmode=network.AUTH_WPA_WPA2_PSK, password=\"<password>\")\n"
|
||||||
|
"\n"
|
||||||
"Control commands:\n"
|
"Control commands:\n"
|
||||||
" CTRL-A -- on a blank line, enter raw REPL mode\n"
|
" CTRL-A -- on a blank line, enter raw REPL mode\n"
|
||||||
" CTRL-B -- on a blank line, enter normal REPL mode\n"
|
" CTRL-B -- on a blank line, enter normal REPL mode\n"
|
||||||
|
Loading…
Reference in New Issue
Block a user