summaryrefslogtreecommitdiffstatshomepage
path: root/esp8266/help.c
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-29 00:34:08 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-04-29 00:34:08 +0300
commit22050a3ed0d65956a94469d79a9dc853f384fe1e (patch)
treeea0de9150e830e784bc2580c23eaab02f5d0d028 /esp8266/help.c
parentb639ce27c748703ca3cd2a353fd7cf44e325e57e (diff)
downloadmicropython-22050a3ed0d65956a94469d79a9dc853f384fe1e.tar.gz
micropython-22050a3ed0d65956a94469d79a9dc853f384fe1e.zip
esp8266/help: Add cheatsheet for basic WiFi configuration.
Diffstat (limited to 'esp8266/help.c')
-rw-r--r--esp8266/help.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/esp8266/help.c b/esp8266/help.c
index b98894ec58..89508308fb 100644
--- a/esp8266/help.c
+++ b/esp8266/help.c
@@ -34,6 +34,20 @@ STATIC const char *help_text =
"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"
"\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"
" CTRL-A -- on a blank line, enter raw REPL mode\n"
" CTRL-B -- on a blank line, enter normal REPL mode\n"