From 22050a3ed0d65956a94469d79a9dc853f384fe1e Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Fri, 29 Apr 2016 00:34:08 +0300 Subject: [PATCH] esp8266/help: Add cheatsheet for basic WiFi configuration. --- esp8266/help.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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(\"\", \"\")\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=\"\", authmode=network.AUTH_WPA_WPA2_PSK, 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"