summaryrefslogtreecommitdiff
path: root/ports/esp8266/modules
AgeCommit message (Collapse)Author
2024-11-08esp8266: Use the recommended network.WLAN.IF_[AP|STA] constants.Angus Gratton
Removes the deprecated network.[AP|STA]_IF form from the esp8266 port This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton <angus@redyak.com.au>
2024-02-07ports: Use vfs module instead of os.Damien George
Signed-off-by: Damien George <damien@micropython.org>
2023-06-15esp32,esp8266: Allow Ctrl-C to interrupt the corrupt-fs while loop.Damien George
Commit c046b23ea29e0183c899a8dbe1da3bed3440a255 prevented frozen boot code from being interrupted by Ctrl-C, but that means a corrupt filesystem will forever lock up an esp32/esp8266 board. This commit fixes that by explicitly enabling Ctrl-C before running the forever loop. Signed-off-by: Damien George <damien@micropython.org>
2023-06-08all: Replace all uses of umodule in Python code.Jim Mussared
Applies to drivers/examples/extmod/port-modules/tools. This work was funded through GitHub Sponsors. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2023-05-01esp32,esp8266: Add support for the Espressif ESP-NOW protocol.Glenn Moloney
ESP-NOW is a proprietary wireless communication protocol which supports connectionless communication between ESP32 and ESP8266 devices, using vendor specific WiFi frames. This commit adds support for this protocol through a new `espnow` module. This commit builds on original work done by @nickzoic, @shawwwn and with contributions from @zoland. Features include: - Use of (extended) ring buffers in py/ringbuf.[ch] for robust IO. - Signal strength (RSSI) monitoring. - Core support in `_espnow` C module, extended by `espnow.py` module. - Asyncio support via `aioespnow.py` module (separate to this commit). - Docs provided at `docs/library/espnow.rst`. Methods available in espnow.ESPNow class are: - active(True/False) - config(): set rx buffer size, read timeout and tx rate - recv()/irecv()/recvinto() to read incoming messages from peers - send() to send messages to peer devices - any() to test if a message is ready to read - irq() to set callback for received messages - stats() returns transfer stats: (tx_pkts, tx_pkt_responses, tx_failures, rx_pkts, lost_rx_pkts) - add_peer(mac, ...) registers a peer before sending messages - get_peer(mac) returns peer info: (mac, lmk, channel, ifidx, encrypt) - mod_peer(mac, ...) changes peer info parameters - get_peers() returns all peer info tuples - peers_table supports RSSI signal monitoring for received messages: {peer1: [rssi, time_ms], peer2: [rssi, time_ms], ...} ESP8266 is a pared down version of the ESP32 ESPNow support due to code size restrictions and differences in the low-level API. See docs for details. Also included is a test suite in tests/multi_espnow. This tests basic espnow data transfer, multiple transfers, various message sizes, encrypted messages (pmk and lmk), and asyncio support. Initial work is from https://github.com/micropython/micropython/pull/4115. Initial import of code is from: https://github.com/nickzoic/micropython/tree/espnow-4115.
2023-02-02top: Update Python formatting to black "2023 stable style".Jim Mussared
See https://black.readthedocs.io/en/stable/the_black_code_style/index.html Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2022-08-06extmod/ntptime: Factor out ntptime module from esp8266 port.Ian Davies
The ntptime module was previously only included in the ESP8266 port. This commit factors that module out into the extmod directory, makes it support different epochs, and includes it in the rp2 port.
2022-06-17esp8266/modnetwork: Rename WLAN keyword args to ssid/security/key.iabdalkader
The WLAN.config() method now supports "ssid", "security" and "key" as aliases to the existing "essid", "authmode" and "password", which are now deprecated. The help text and setup helper are also updated. Addresses issue #8083.
2021-08-19drivers/neopixel: Add common machine.bitstream-based neopixel module.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-08-19esp8266: Replace esp.neopixel with machine.bitstream.Jim Mussared
Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-06-22esp32,esp8266: Add __len__ to NeoPixel driver to support iterating.Michael Weiss
Signed-off-by: mishafarms <github@mishafarms.us>
2021-02-09esp8266/modules: Fix fs_corrupted() to use start_sec not START_SEC.Damien George
START_SEC was changed in e0905e85a7ad2961aa9192f6130565860e531ad3. Also, update the error message to mention how to format the partition at the REPL, and make the total message shorter to save a bit of flash. Signed-off-by: Damien George <damien@micropython.org>
2021-01-30esp8266/modules/neopixel.py: Add timing param to NeoPixel constructor.Christopher Tse
This matches the esp32 port.
2020-11-18esp32,esp8266: Remove "FAT" from warning message in inisetup.py.robert
Because FAT is not any more the only filesystem used.
2020-09-18ports: Add utime.gmtime() function.Damien George
To portably get the Epoch. This is simply aliased to localtime() on ports that are not timezone aware. Signed-off-by: Damien George <damien@micropython.org>
2020-04-04esp8266: Change from FAT to littlefs v2 as default filesystem.Damien George
This commit changes the esp8266 boards to use littlefs v2 as the filesystem, rather than FAT. Since the esp8266 doesn't expose the filesystem to the PC over USB there's no strong reason to keep it as FAT. Littlefs is smaller in code size, is more efficient in use of flash to store data, is resilient over power failure, and using it saves about 4k of heap RAM, which can now be used for other things. This is a backwards incompatible change because all existing esp8266 boards will need to update their filesystem after installing new firmware (eg backup old files, install firmware, restore files to new filesystem). As part of this commit the memory layout of the default board (GENERIC) has changed. It now allocates all 1M of memory-mapped flash to the firmware, so the filesystem area starts at the 2M point. This is done to allow more frozen bytecode to be stored in the 1M of memory-mapped flash. This requires an esp8266 module with 2M or more of flash to work, so a new board called GENERIC_1M is added which has the old memory-mapping (but still changed to use littlefs for the filesystem). In summary there are now 3 esp8266 board definitions: - GENERIC_512K: for 512k modules, doesn't have a filesystem. - GENERIC_1M: for 1M modules, 572k for firmware+frozen code, 396k for filesystem (littlefs). - GENERIC: for 2M (or greater) modules, 968k for firmware+frozen code, 1M+ for filesystem (littlefs), FAT driver also included in firmware for use on, eg, external SD cards.
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-01-31esp8266/modules/ntptime.py: Add comment about configuring NTP host.Damien George
The ability to change the host is a frequently requested feature, so explicitly document how it can be achieved using the existing code. See issues #2121, #4385, #4622, #5122, #5536.
2020-01-14esp8266/modules: Fix AttributeError in _boot.py if flash not formatted.JensDiemer
Prior to this commit, if the flash filesystem was not formatted then it would error: "AttributeError: 'FlashBdev' object has no attribute 'mount'". That is due to it not being able to detect the filesystem on the block device and just trying to mount the block device directly. This commit fixes the issue by just catching all exceptions. Also it's not needed to try the mount if `flashbdev.bdev` is None.
2019-12-20extmod/webrepl: Move webrepl scripts to common place and use manifest.Jim Mussared
Move webrepl support code from ports/esp8266/modules into extmod/webrepl (to be alongside extmod/modwebrepl.c), and use frozen manifests to include it in the build on esp8266 and esp32. A small modification is made to webrepl.py to make it work on non-ESP ports, i.e. don't call dupterm_notify if not available.
2019-11-07esp8266/modules/flashbdev.py: Support extended block protocol.Damien George
2019-10-29extmod/vfs: Rename BP_IOCTL_xxx constants to MP_BLOCKDEV_IOCTL_xxx.Damien George
Also rename SEC_COUNT to BLOCK_COUNT and SEC_SIZE to BLOCK_SIZE.
2019-10-15esp8266: Convert to use FROZEN_MANIFEST to specify frozen code.Damien George
Removes symlinks in modules directory, all frozen code is now specified by manifest.py.
2019-10-10esp8266/modules/ntptime.py: Always close socket, and set day-of-week.Damien George
Fixes issue #5189.
2019-02-14extmod/moduwebsocket: Refactor `websocket` to `uwebsocket`.Yonatan Goldschmidt
As mentioned in #4450, `websocket` was experimental with a single intended user, `webrepl`. Therefore, we'll make this change without a weak link `websocket` -> `uwebsocket`.
2019-01-16esp8266/main: Activate UART(0) on dupterm for REPL before boot.py runs.Damien George
So that the user can explicitly deactivate UART(0) if needed. See issue #4314. This introduces some risk to "brick" the device, if the user disables the REPL without providing an alternative REPL (eg WebREPL), or any way to reenable it. In such a case the device needs to be erased and reprogrammed. This seems unavoidable, given the desire to have the option to use the UART for something other than the REPL.
2018-06-05esp8266/modules/ntptime.py: Remove print of newly-set time.Damien George
It should be up to the user if they want to print the new time out or not. Fixes issue #3766.
2018-05-21esp8266: Change UART(0) to attach to REPL via uos.dupterm interface.Damien George
This patch makes it so that UART(0) can by dynamically attached to and detached from the REPL by using the uos.dupterm function. Since WebREPL uses dupterm slot 0 the UART uses dupterm slot 1 (a slot which is newly introduced by this patch). UART(0) must now be attached manually in boot.py (or otherwise) and inisetup.py is changed to provide code to do this. For example, to attach use: import uos, machine uart = machine.UART(0, 115200) uos.dupterm(uart, 1) and to detach use: uos.dupterm(None, 1) When attached, all incoming chars on UART(0) go straight to stdin so uart.read() will always return None. Use sys.stdin.read() if it's needed to read characters from the UART(0) while it's also used for the REPL (or detach, read, then reattach). When detached the UART(0) can be used for other purposes. If there are no objects in any of the dupterm slots when the REPL is started (on hard or soft reset) then UART(0) is automatically attached. Without this, the only way to recover a board without a REPL would be to completely erase and reflash (which would install the default boot.py which attaches the REPL).
2018-01-31esp8266/modules: Move dht.py driver to drivers/dht directory.Damien George
2017-11-30esp8266/modules/webrepl_setup: Fix first-time enable of WebREPL.Damien George
Prior to this fix, enabling WebREPL for the first time via webrepl_setup did not work at all because "boot.py" did not contain any lines with "webrepl" in them that could be uncommented.
2017-10-13extmod/uos_dupterm: Update uos.dupterm() and helper funcs to have index.Damien George
The uos.dupterm() signature and behaviour is updated to reflect the latest enhancements in the docs. It has minor backwards incompatibility in that it no longer accepts zero arguments. The dupterm_rx helper function is moved from esp8266 to extmod and generalised to support multiple dupterm slots. A port can specify multiple slots by defining the MICROPY_PY_OS_DUPTERM config macro to an integer, being the number of slots it wants to have; 0 means to disable the dupterm feature altogether. The unix and esp8266 ports are updated to work with the new interface and are otherwise unchanged with respect to functionality.
2017-10-11esp8266/modules/webrepl_setup: Add info about allowed password length.Vitor Massaru Iha
This patch also makes the code more concise by combining the checks for the password length.
2017-09-06all: Update Makefiles and others to build with new ports/ dir layout.Damien George
Also renames "stmhal" to "stm32" in documentation and everywhere else.
2017-09-06ports: Make new ports/ sub-directory and move all ports there.Damien George
This is to keep the top-level directory clean, to make it clear what is core and what is a port, and to allow the repository to grow with new ports in a sustainable way.