From 7dfc57791bd1125af052c3bd82d2a9a4adb45635 Mon Sep 17 00:00:00 2001 From: gijsio <67470426+gijsio@users.noreply.github.com> Date: Mon, 21 Sep 2020 12:01:34 +0200 Subject: [PATCH] added ap on boot information --- content/firmwareapi/pycom/pycom.md | 17 ++++++++++------- content/gettingstarted/programming/ftp.md | 19 ++++++++++++++++++- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/content/firmwareapi/pycom/pycom.md b/content/firmwareapi/pycom/pycom.md index ba929cd..92ed327 100644 --- a/content/firmwareapi/pycom/pycom.md +++ b/content/firmwareapi/pycom/pycom.md @@ -89,11 +89,18 @@ Allows you permanently disable or enable the heartbeat LED. Once this setting is ### pycom.lte_modem_on_boot([boolean]) Get or set the LTE modem on boot flag. When this flag is set to `True`, the LTE modem will be enabled. + ### pycom.wifi_on_boot([boolean]) -Get or set the WiFi on boot flag. When this flag is set to `True`, The WiFi will be enabled according to the other WiFi settings. when `False` the WiFi module will be disabled untill enabled directly via WLAN class. +Get or set the WiFi on boot flag. When this flag is set to `True`, The WiFi will be enabled according to the other WiFi settings. when `False` the WiFi module will be disabled until enabled directly via WLAN class. This setting is stored in the non-volatile memory which preserves it across resets and power cycles. See [FTP & Telnet](/gettingstarted/programming/ftp/) for more information on possible usage. -This setting is stored in non-volatile memory which preserves it across resets and power cycles. +### pycom.wifi_mode_on_boot(mode) + +Set or get the Wifi Mode at startup, valid options are: +* `WLAN.STA` +* `WLAN.AP` +* `WLAN.APSTA` +This setting is stored in non-volatile memory which preserves it across resets and power cycles ### pycom.wifi_ssid_sta([ssid]) @@ -102,7 +109,7 @@ This setting is stored in non-volatile memory which preserves it across resets a ### pycom.wifi_ssid_ap([ssid]) -Get or set the ssid of the Access point that should be started by the device at startup, if not set and startup Wifi mode is AP the default AP name (`Board_Name>-wlan- This method of connection is not recommended for first time users. It is possible to lock yourself out of the device, requiring a USB connection. + There is a small internal file system accessible with each Pycom device, called `/flash`. This is stored within the external serial flash memory. If a microSD card is also connected and mounted, it will be available as well. When the device starts up, it will always boot from the `boot.py` located in the `/flash` file system. The first time(s), your device will create an Access Point (AP) you can connect to using your computer's WiFi. @@ -14,7 +16,22 @@ By default, the device will create a WiFi access point with the following creden * SSID: `xxpy-wlan-####` * Password: `www.pycom.io` ->Note: This method of connection is not recommended for first time users. It is possible to lock yourself out of the device, requiring a USB connection. +> If the WiFi network does not show up by default, use the following: +>```python +> import pycom +> from network import WLAN +> pycom.wifi_on_boot(True) +> pycom.wifi_mode_on_boot(WLAN.AP) +> ``` +> The last 4 characters of the broadcast SSID are equal to the last 4 characters of the `unique_id()`: (Except if the AP SSID was set previously) +> ```python +> import machine +> import ubinascii +> ubinascii.hexlify(machine.unique_id()) +> ``` + + + Once connected to this network you will be able to access the telnet and FTP servers running on the LoPy4.