micropython/ports/esp32/boards
Glenn Moloney 7fa322afb8 esp32,esp8266: Add support for the Espressif ESP-NOW protocol.
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-05-01 16:47:21 +10:00
..
ESP32_S2_WROVER esp32: Allow overriding cmake frozen manifest from the command line. 2022-04-04 23:49:10 +10:00
GENERIC esp32: Allow overriding cmake frozen manifest from the command line. 2022-04-04 23:49:10 +10:00
GENERIC_C3 esp32: Allow overriding cmake frozen manifest from the command line. 2022-04-04 23:49:10 +10:00
GENERIC_C3_USB esp32: Allow overriding cmake frozen manifest from the command line. 2022-04-04 23:49:10 +10:00
GENERIC_D2WD esp32: Allow overriding cmake frozen manifest from the command line. 2022-04-04 23:49:10 +10:00
GENERIC_OTA esp32: Allow overriding cmake frozen manifest from the command line. 2022-04-04 23:49:10 +10:00
GENERIC_S2 esp32: Add MICROPY_HW_ENABLE_UART_REPL and enable on generic S2/S3. 2022-04-14 14:39:20 +10:00
GENERIC_S3 esp32: Add MICROPY_HW_ENABLE_UART_REPL and enable on generic S2/S3. 2022-04-14 14:39:20 +10:00
GENERIC_S3_SPIRAM esp32/boards/GENERIC_S3_SPIRAM: Enable BLE. 2022-11-23 09:42:54 +11:00
GENERIC_S3_SPIRAM_OCT esp32/boards/GENERIC_S3_SPIRAM_OCT: Add ESP32S3 board with Octal SPIRAM. 2022-12-19 13:29:33 +11:00
GENERIC_SPIRAM esp32/boards: Compile GENERIC_SPIRAM and UM_TINYPICO with -Os. 2022-04-14 16:06:41 +10:00
GENERIC_UNICORE esp32/boards/GENERIC_UNICORE: Add board definition for unicore chips. 2023-01-19 22:38:02 +11:00
LILYGO_TTGO_LORA32 esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
LOLIN_C3_MINI esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
LOLIN_S2_MINI esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
LOLIN_S2_PICO esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
M5STACK_ATOM esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
OLIMEX_ESP32_POE esp32/boards/OLIMEX_ESP32_POE: Remove id from and update board.json. 2023-01-28 15:29:01 +11:00
SIL_WESP32 esp32: Allow overriding cmake frozen manifest from the command line. 2022-04-04 23:49:10 +10:00
UM_FEATHERS2 esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
UM_FEATHERS2NEO esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
UM_FEATHERS3 esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
UM_PROS3 esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
UM_TINYPICO esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
UM_TINYS2 esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
UM_TINYS3 esp32: Use extmod/modnetwork.c instead of port-specific version. 2023-03-01 01:26:54 +11:00
deploy_c3.md esp32/boards: Provide custom deploy_c3.md for ESP32-C3 boards. 2022-01-22 11:18:50 +11:00
deploy_s2.md esp32: Add specific deploy_s2.md instructions for esp32-s2. 2021-10-28 09:47:47 +11:00
deploy_s3.md esp32/boards: Add specific deploy instructions for S3 variant. 2022-02-25 16:52:58 +11:00
deploy.md esp32: Add specific deploy_s2.md instructions for esp32-s2. 2021-10-28 09:47:47 +11:00
manifest_test.py esp32/boards: Add test manifest to test freezing during build. 2022-04-14 14:06:38 +10:00
manifest.py esp32,esp8266: Add support for the Espressif ESP-NOW protocol. 2023-05-01 16:47:21 +10:00
sdkconfig.240mhz esp32: Add missing and necessary newline at EOF for sdkconfig.240mhz. 2019-10-21 23:54:59 +11:00
sdkconfig.base esp32/boards: Increase 512 bytes limit on ULP programs to 2040. 2022-06-23 17:24:59 +10:00
sdkconfig.ble esp32: Pin MicroPython to core 1 again. 2022-01-22 00:10:16 +11:00
sdkconfig.nimble_core0 esp32: Pin MicroPython to core 1 again. 2022-01-22 00:10:16 +11:00
sdkconfig.nimble_core1 esp32: Pin MicroPython to core 1 again. 2022-01-22 00:10:16 +11:00
sdkconfig.spiram esp32/boards: Remove old IDF v3 sdkconfig values. 2021-02-15 16:40:03 +11:00
sdkconfig.spiram_oct esp32/boards/GENERIC_S3_SPIRAM_OCT: Add ESP32S3 board with Octal SPIRAM. 2022-12-19 13:29:33 +11:00
sdkconfig.spiram_sx esp32: Add SDCard support for S3, and a GENERIC_S3_SPIRAM board. 2021-11-19 14:05:55 +11:00
sdkconfig.usb esp32: Add support for USB with CDC ACM. 2021-04-15 10:31:06 +10:00