From c156e89379b8e50f5237f55fec7be1dbad57abc3 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 7 May 2016 23:24:24 -0700 Subject: Fix ESP8266 Network tutorial The socket should either connect to `addr` or `addr_info[0][-1]`. Not to `addr[0][-1]`. --- docs/esp8266/tutorial/network_tcp.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/esp8266') diff --git a/docs/esp8266/tutorial/network_tcp.rst b/docs/esp8266/tutorial/network_tcp.rst index 0a1cca445..80a494721 100644 --- a/docs/esp8266/tutorial/network_tcp.rst +++ b/docs/esp8266/tutorial/network_tcp.rst @@ -36,7 +36,7 @@ information they hold. Using the IP address we can make a socket and connect to the server:: >>> s = socket.socket() - >>> s.connect(addr[0][-1]) + >>> s.connect(addr) Now that we are connected we can download and display the data:: -- cgit v1.2.3 From e89413e9b081bfa48dcafac7fa22a544172c8d2f Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Tue, 10 May 2016 00:31:57 +0200 Subject: docs/esp8266/quickref: New way to get MAC address --- docs/esp8266/quickref.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/esp8266') diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst index bfded9bea..87f57c584 100644 --- a/docs/esp8266/quickref.rst +++ b/docs/esp8266/quickref.rst @@ -43,7 +43,7 @@ The ``network`` module:: wlan.scan() # scan for access points wlan.isconnected() # check if the station is connected to an AP wlan.connect('essid', 'password') # connect to an AP - wlan.mac() # get the interface's MAC adddress + wlan.config('mac') # get the interface's MAC adddress wlan.ifconfig() # get the interface's IP/netmask/gw/DNS addresses ap = network.WLAN(network.AP_IF) # create access-point interface -- cgit v1.2.3 From 9b4502b7e8cc2a4f69fdd03beb73a1971d0c7ce1 Mon Sep 17 00:00:00 2001 From: Damien George Date: Wed, 11 May 2016 13:40:28 +0100 Subject: docs/esp8266/tutorial: Fix typo in do_connect() network example. Fixes issue #2065. --- docs/esp8266/tutorial/network_basics.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/esp8266') diff --git a/docs/esp8266/tutorial/network_basics.rst b/docs/esp8266/tutorial/network_basics.rst index 02a705485..42aed5664 100644 --- a/docs/esp8266/tutorial/network_basics.rst +++ b/docs/esp8266/tutorial/network_basics.rst @@ -62,7 +62,7 @@ connect to your WiFi network:: print('connecting to network...') sta_if.active(True) sta_if.connect('', '') - while not network.isconnected(): + while not sta_if.isconnected(): pass print('network config:', sta_if.ifconfig()) -- cgit v1.2.3 From ccb00b77240e7ff7b52ee6df2a338a07387dedbd Mon Sep 17 00:00:00 2001 From: Radomir Dopieralski Date: Sat, 14 May 2016 00:02:02 +0200 Subject: docs/esp8266/quickstart: remove i2c examples with stop=False Since the ``stop`` parameter has been dropped. --- docs/esp8266/quickref.rst | 3 --- 1 file changed, 3 deletions(-) (limited to 'docs/esp8266') diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst index 87f57c584..d2d677dc7 100644 --- a/docs/esp8266/quickref.rst +++ b/docs/esp8266/quickref.rst @@ -199,9 +199,6 @@ The I2C driver is implemented in software and works on all pins:: buf = bytearray(10) # create a buffer with 10 bytes i2c.writeto(0x3a, buf) # write the given buffer to the slave - i2c.readfrom(0x3a, 4, stop=False) # don't send a stop bit after reading - i2c.writeto(0x3a, buf, stop=False) # don't send a stop bit after writing - Deep-sleep mode --------------- -- cgit v1.2.3 From a0a08b4be1583aa7a4ef33d3b1b0aa6553732eca Mon Sep 17 00:00:00 2001 From: misterdanb Date: Mon, 28 Mar 2016 01:58:14 +0200 Subject: esp8266: Add APA102 serial individually controllable LEDs support. APA102 is a new "smart LED", similar to WS2812 aka "Neopixel". --- docs/esp8266/quickref.rst | 20 +++++++++ esp8266/Makefile | 1 + esp8266/espapa102.c | 110 ++++++++++++++++++++++++++++++++++++++++++++++ esp8266/espapa102.h | 27 ++++++++++++ esp8266/modesp.c | 12 +++++ esp8266/scripts/apa102.py | 28 ++++++++++++ 6 files changed, 198 insertions(+) create mode 100644 esp8266/espapa102.c create mode 100644 esp8266/espapa102.h create mode 100644 esp8266/scripts/apa102.py (limited to 'docs/esp8266') diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst index d2d677dc7..7b246a65e 100644 --- a/docs/esp8266/quickref.rst +++ b/docs/esp8266/quickref.rst @@ -271,6 +271,26 @@ For low-level driving of a NeoPixel:: import esp esp.neopixel_write(pin, grb_buf, is800khz) +APA102 driver +------------- + +Use the ``apa102`` module:: + + from machine import Pin + from apa102 import APA102 + + clock = Pin(14, Pin.OUT) # set GPIO14 to output to drive the clock + data = Pin(13, Pin.OUT) # set GPIO13 to output to drive the data + apa = APA102(clock, data, 8) # create APA102 driver on the clock and the data pin for 8 pixels + apa[0] = (255, 255, 255, 31) # set the first pixel to white with a maximum brightness of 31 + apa.write() # write data to all pixels + r, g, b, brightness = apa[0] # get first pixel colour + +For low-level driving of an APA102:: + + import esp + esp.apa102_write(clock_pin, data_pin, rgbi_buf) + WebREPL (web browser interactive prompt) ---------------------------------------- diff --git a/esp8266/Makefile b/esp8266/Makefile index d8786301a..2d65b4bd6 100644 --- a/esp8266/Makefile +++ b/esp8266/Makefile @@ -65,6 +65,7 @@ SRC_C = \ esppwm.c \ esponewire.c \ espneopixel.c \ + espapa102.c \ intr.c \ modpyb.c \ modpybpin.c \ diff --git a/esp8266/espapa102.c b/esp8266/espapa102.c new file mode 100644 index 000000000..e5f3024b1 --- /dev/null +++ b/esp8266/espapa102.c @@ -0,0 +1,110 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Robert Foss, Daniel Busch + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +#include +#include "c_types.h" +#include "eagle_soc.h" +#include "user_interface.h" +#include "espapa102.h" + +#define NOP asm volatile(" nop \n\t") + +static inline void _esp_apa102_send_byte(uint32_t clockPinMask, uint32_t dataPinMask, uint8_t byte) { + for (uint32_t i = 0; i < 8; i++) { + if (byte & 0x80) { + // set data pin high + GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, dataPinMask); + } else { + // set data pin low + GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, dataPinMask); + } + + // set clock pin high + GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, clockPinMask); + byte <<= 1; + NOP; + NOP; + + // set clock pin low + GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, clockPinMask); + NOP; + NOP; + } +} + +static inline void _esp_apa102_send_colors(uint32_t clockPinMask, uint32_t dataPinMask, uint8_t *pixels, uint32_t numBytes) { + for (uint32_t i = 0; i < numBytes / 4; i++) { + _esp_apa102_send_byte(clockPinMask, dataPinMask, pixels[i * 4 + 3] | 0xE0); + _esp_apa102_send_byte(clockPinMask, dataPinMask, pixels[i * 4 + 2]); + _esp_apa102_send_byte(clockPinMask, dataPinMask, pixels[i * 4 + 1]); + _esp_apa102_send_byte(clockPinMask, dataPinMask, pixels[i * 4]); + } +} + +static inline void _esp_apa102_start_frame(uint32_t clockPinMask, uint32_t dataPinMask) { + for (uint32_t i = 0; i < 4; i++) { + _esp_apa102_send_byte(clockPinMask, dataPinMask, 0x00); + } +} + +static inline void _esp_apa102_append_additionial_cycles(uint32_t clockPinMask, uint32_t dataPinMask, uint32_t numBytes) { + GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, dataPinMask); + + // we need to write some more clock cycles, because each led + // delays the data by one edge after inverting the clock + for (uint32_t i = 0; i < numBytes / 8 + ((numBytes / 4) % 2); i++) { + GPIO_REG_WRITE(GPIO_OUT_W1TS_ADDRESS, clockPinMask); + NOP; + NOP; + + GPIO_REG_WRITE(GPIO_OUT_W1TC_ADDRESS, clockPinMask); + NOP; + NOP; + } +} + +static inline void _esp_apa102_end_frame(uint32_t clockPinMask, uint32_t dataPinMask) { + for (uint32_t i = 0; i < 4; i++) { + _esp_apa102_send_byte(clockPinMask, dataPinMask, 0xFF); + } +} + +void esp_apa102_write(uint8_t clockPin, uint8_t dataPin, uint8_t *pixels, uint32_t numBytes) { + uint32_t clockPinMask, dataPinMask; + + clockPinMask = 1 << clockPin; + dataPinMask = 1 << dataPin; + + // start the frame + _esp_apa102_start_frame(clockPinMask, dataPinMask); + + // write pixels + _esp_apa102_send_colors(clockPinMask, dataPinMask, pixels, numBytes); + + // end the frame + _esp_apa102_append_additionial_cycles(clockPinMask, dataPinMask, numBytes); + _esp_apa102_end_frame(clockPinMask, dataPinMask); +} diff --git a/esp8266/espapa102.h b/esp8266/espapa102.h new file mode 100644 index 000000000..82c92025d --- /dev/null +++ b/esp8266/espapa102.h @@ -0,0 +1,27 @@ +/* + * This file is part of the MicroPython project, http://micropython.org/ + * + * The MIT License (MIT) + * + * Copyright (c) 2016 Robert Foss, Daniel Busch + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + */ + +void esp_apa102_write(uint8_t clockPin, uint8_t dataPin, uint8_t *pixels, uint32_t numBytes); diff --git a/esp8266/modesp.c b/esp8266/modesp.c index 885e7ae95..4b0c0e466 100644 --- a/esp8266/modesp.c +++ b/esp8266/modesp.c @@ -43,6 +43,7 @@ #include "spi_flash.h" #include "mem.h" #include "espneopixel.h" +#include "espapa102.h" #include "modpyb.h" #define MODESP_ESPCONN (0) @@ -636,6 +637,16 @@ STATIC mp_obj_t esp_neopixel_write_(mp_obj_t pin, mp_obj_t buf, mp_obj_t is800k) } STATIC MP_DEFINE_CONST_FUN_OBJ_3(esp_neopixel_write_obj, esp_neopixel_write_); +STATIC mp_obj_t esp_apa102_write_(mp_obj_t clockPin, mp_obj_t dataPin, mp_obj_t buf) { + mp_buffer_info_t bufinfo; + mp_get_buffer_raise(buf, &bufinfo, MP_BUFFER_READ); + esp_apa102_write(mp_obj_get_pin_obj(clockPin)->phys_port, + mp_obj_get_pin_obj(dataPin)->phys_port, + (uint8_t*)bufinfo.buf, bufinfo.len); + return mp_const_none; +} +STATIC MP_DEFINE_CONST_FUN_OBJ_3(esp_apa102_write_obj, esp_apa102_write_); + STATIC mp_obj_t esp_freemem() { return MP_OBJ_NEW_SMALL_INT(system_get_free_heap_size()); } @@ -679,6 +690,7 @@ STATIC const mp_map_elem_t esp_module_globals_table[] = { { MP_OBJ_NEW_QSTR(MP_QSTR_getaddrinfo), (mp_obj_t)&esp_getaddrinfo_obj }, #endif { MP_OBJ_NEW_QSTR(MP_QSTR_neopixel_write), (mp_obj_t)&esp_neopixel_write_obj }, + { MP_OBJ_NEW_QSTR(MP_QSTR_apa102_write), (mp_obj_t)&esp_apa102_write_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_freemem), (mp_obj_t)&esp_freemem_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_meminfo), (mp_obj_t)&esp_meminfo_obj }, { MP_OBJ_NEW_QSTR(MP_QSTR_info), (mp_obj_t)&pyb_info_obj }, // TODO delete/rename/move elsewhere diff --git a/esp8266/scripts/apa102.py b/esp8266/scripts/apa102.py new file mode 100644 index 000000000..126448cc2 --- /dev/null +++ b/esp8266/scripts/apa102.py @@ -0,0 +1,28 @@ +# APA102 driver for MicroPython on ESP8266 +# MIT license; Copyright (c) 2016 Robert Foss, Daniel Busch + +from esp import apa102_write + +class APA102: + def __init__(self, clock_pin, data_pin, n): + self.clock_pin = clock_pin + self.data_pin = data_pin + self.n = n + self.buf = bytearray(n * 4) + + self.clock_pin.init(clock_pin.OUT) + self.data_pin.init(data_pin.OUT) + + def __setitem__(self, index, val): + r, g, b, brightness = val + self.buf[index * 4] = r + self.buf[index * 4 + 1] = g + self.buf[index * 4 + 2] = b + self.buf[index * 4 + 3] = brightness + + def __getitem__(self, index): + i = index * 4 + return self.buf[i], self.buf[i + 1], self.buf[i + 2], self.buf[i + 3] + + def write(self): + apa102_write(self.clock_pin, self.data_pin, self.buf) -- cgit v1.2.3 From eaecc4c02e6aac40d8c24d004f5b8fdee23d4934 Mon Sep 17 00:00:00 2001 From: mad474 Date: Wed, 4 May 2016 12:26:16 +0200 Subject: docs/esp8266/general: Grammar fixes. --- docs/esp8266/general.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'docs/esp8266') diff --git a/docs/esp8266/general.rst b/docs/esp8266/general.rst index f996068d0..3068e0eb0 100644 --- a/docs/esp8266/general.rst +++ b/docs/esp8266/general.rst @@ -6,8 +6,8 @@ ESP8266 is a popular WiFi-enabled System-on-Chip (SoC) by Espressif Systems. Multitude of boards ------------------- -There are multitude of modules and boards from different sources which carry -ESP8266 chip. MicroPython tries to provide a generic port which would run on +There are a multitude of modules and boards from different sources which carry +the ESP8266 chip. MicroPython tries to provide a generic port which would run on as many boards/modules as possible, but there may be limitations. Adafruit Feather HUZZAH board is taken as a reference board for the port (for example, testing is performed on it). If you have another board, please make sure you @@ -18,8 +18,8 @@ To make a generic ESP8266 port and support as many boards as possible, following design and implementation decision were made: * GPIO pin numbering is based on ESP8266 chip numbering, not some "logical" - numbering of a particular board. Please have manual/pin diagram of your board - handy to find correspondce between your board pins and actual ESP8266 pins. + numbering of a particular board. Please have the manual/pin diagram of your board + at hand to find correspondence between your board pins and actual ESP8266 pins. We also encourage users of various boards to share this mapping via MicroPython forum, with the idea to collect community-maintained reference materials eventually. @@ -37,10 +37,10 @@ Technical specifications and SoC datasheets The datasheets and other reference material for ESP8266 chip are available from the vendor site: http://bbs.espressif.com/viewtopic.php?f=67&t=225 . -The are primary reference for the chip technical specifications, capabilities, +They are the primary reference for the chip technical specifications, capabilities, operating modes, internal functioning, etc. -For your convinience, some of technical specifications are provided below: +For your convenience, some of technical specifications are provided below: * Architecture: Xtensa lx106 * CPU frequency: 80MHz overclockable to 160MHz @@ -64,13 +64,13 @@ Boot process On boot, MicroPython EPS8266 port executes ``_boot.py`` script from internal frozen modules. It mounts filesystem in FlashROM, or if it's not available, performs first-time setup of the module and creates the filesystem. This -part of boot process is considered fixed, and not available for customization +part of the boot process is considered fixed, and not available for customization for end users (even if you build from source, please refrain from changes to it; customization of early boot process is available only to advanced users and developers, who can diagnose themselves any issues arising from modifying the standard process). -Once filesystem is mounted, ``boot.py`` is executed from it. The standard +Once the filesystem is mounted, ``boot.py`` is executed from it. The standard version of this file is created during first-time module set up and by defaults starts up a WebREPL daemon to handle incoming connections. This file is customizable by end users (for example, you may want to disable @@ -89,5 +89,5 @@ the following in ``main.py``:: import my_app my_app.main() -This will allow to keep structure of your application clear, as well as +This will allow to keep the structure of your application clear, as well as allow to install multiple applications on a board, and switch among them. -- cgit v1.2.3 From 7d4fd8b6db5ce81ea239efa53118e126a2b8dd54 Mon Sep 17 00:00:00 2001 From: Tomas R Date: Sat, 28 May 2016 20:35:00 +0100 Subject: docs/esp8266/general: Remove duplicate phrase. --- docs/esp8266/general.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/esp8266') diff --git a/docs/esp8266/general.rst b/docs/esp8266/general.rst index 3068e0eb0..3ddcee218 100644 --- a/docs/esp8266/general.rst +++ b/docs/esp8266/general.rst @@ -24,7 +24,7 @@ following design and implementation decision were made: forum, with the idea to collect community-maintained reference materials eventually. * All pins which make sense to support, are supported by MicroPython - (for example, we don't expose pins which are used to connect SPI flash + (for example, pins which are used to connect SPI flash are not exposed, as they're unlikely useful for anything else, and operating on them will lead to board lock-up). However, any particular board may expose only subset of pins. Consult your board reference manual. -- cgit v1.2.3 From fdf45a718bcce840d4f824736401e7fe04f2448d Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 1 Jun 2016 23:11:49 +0300 Subject: esp8266/quickref: Use local image of Adafruit Huzzah board. Using remote image causes problems with tools (partly because the image is semi-firewalled and can't be accessed by arbitrary tools). --- docs/esp8266/img/adafruit_products_pinoutstop.jpg | Bin 0 -> 79455 bytes docs/esp8266/quickref.rst | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) create mode 100644 docs/esp8266/img/adafruit_products_pinoutstop.jpg (limited to 'docs/esp8266') diff --git a/docs/esp8266/img/adafruit_products_pinoutstop.jpg b/docs/esp8266/img/adafruit_products_pinoutstop.jpg new file mode 100644 index 000000000..655e27aee Binary files /dev/null and b/docs/esp8266/img/adafruit_products_pinoutstop.jpg differ diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst index 7b246a65e..3dbc44c56 100644 --- a/docs/esp8266/quickref.rst +++ b/docs/esp8266/quickref.rst @@ -3,7 +3,7 @@ Quick reference for the ESP8266 =============================== -.. image:: https://learn.adafruit.com/system/assets/assets/000/028/689/medium640/adafruit_products_pinoutstop.jpg +.. image:: img/adafruit_products_pinoutstop.jpg :alt: Adafruit Feather HUZZAH board :width: 640px -- cgit v1.2.3 From 9a1a49ceec3c8f86d0383149eca3387fe942dd56 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Wed, 1 Jun 2016 23:16:17 +0300 Subject: esp8266/general: Typo/grammar fixes. --- docs/esp8266/general.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'docs/esp8266') diff --git a/docs/esp8266/general.rst b/docs/esp8266/general.rst index 3ddcee218..d6ad83b2a 100644 --- a/docs/esp8266/general.rst +++ b/docs/esp8266/general.rst @@ -72,10 +72,10 @@ modifying the standard process). Once the filesystem is mounted, ``boot.py`` is executed from it. The standard version of this file is created during first-time module set up and by -defaults starts up a WebREPL daemon to handle incoming connections. This +default starts up a WebREPL daemon to handle incoming connections. This file is customizable by end users (for example, you may want to disable WebREPL for extra security, or add other services which should be run on -module start-up). But keep in mind that incorrect modifications to boot.py +a module start-up). But keep in mind that incorrect modifications to boot.py may still lead to boot loops or lock ups, requiring to reflash a module from scratch. -- cgit v1.2.3 From d8cc51ea2b3625ab35d052a3bc0761996a510ab0 Mon Sep 17 00:00:00 2001 From: Paul Sokolovsky Date: Thu, 2 Jun 2016 20:11:40 +0300 Subject: docs/esp8266/quickref: Update WebREPL section for 1.8.1 release. WebREPL is much more stable now. --- docs/esp8266/quickref.rst | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'docs/esp8266') diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst index 3dbc44c56..779248369 100644 --- a/docs/esp8266/quickref.rst +++ b/docs/esp8266/quickref.rst @@ -296,26 +296,30 @@ WebREPL (web browser interactive prompt) WebREPL (REPL over WebSockets, accessible via a web browser) is an experimental feature available in ESP8266 port. Download web client -from https://github.com/micropython/webrepl , and start daemon using:: +from https://github.com/micropython/webrepl (hosted version available +at http://micropython.org/webrepl), and start the daemon on a device +using:: import webrepl webrepl.start() -(Release version will have it started on boot by default.) +(Release versions have it started on boot by default.) On a first connection, you will be prompted to set password for future sessions to use. The supported way to use WebREPL is by connecting to ESP8266 access point, but the daemon is also started on STA interface if it is active, so if your -routers is set up and works correctly, you may also use it while connecting -to your normal Internet access point (use ESP8266 AP connection method if -face any issues). +router is set up and works correctly, you may also use WebREPL while connected +to your normal Internet access point (use the ESP8266 AP connection method +if you face any issues). WebREPL is an experimental feature and a work in progress, and has known -issues. There's also provision to transfer (both upload and download) -files over WebREPL connection, but it has unstable status (be ready to -reboot a module in case of issues). It still may be a practical way to +issues. + +There's also provision to transfer (both upload and download) +files over WebREPL connection, but it has even more experimental status +than the WebREPL terminal mode. It is still a practical way to get script files onto ESP8266, so give it a try using ``webrepl_cli.py`` -from the repository above. See forum for other community-supported -alternatives to transfer files to ESP8266. +from the repository above. See the MicroPython forum for other +community-supported alternatives to transfer files to ESP8266. -- cgit v1.2.3 From 3f6ca4b22ced848a4b849610a8bce0410c2091cc Mon Sep 17 00:00:00 2001 From: puuu Date: Tue, 31 May 2016 22:38:07 +0900 Subject: docs/esp8266/general: Add note about RTC overflow. --- docs/esp8266/general.rst | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'docs/esp8266') diff --git a/docs/esp8266/general.rst b/docs/esp8266/general.rst index d6ad83b2a..313e6074c 100644 --- a/docs/esp8266/general.rst +++ b/docs/esp8266/general.rst @@ -91,3 +91,12 @@ the following in ``main.py``:: This will allow to keep the structure of your application clear, as well as allow to install multiple applications on a board, and switch among them. + + +Real-time clock +--------------- + +Due to limitations of the ESP8266 chip the internal real-time clock (RTC) +will overflow every 7:45h. If a long-term working RTC time is required then +``time()`` or ``localtime()`` must be called at least once within 7 hours. +MicroPython will then handle the overflow. -- cgit v1.2.3