From 619b3a6cdf2aafd73630f2b65c6cadcff46e5e0d Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov <git@zh.com.ru> Date: Sun, 22 Jan 2023 12:22:34 +0300 Subject: [PATCH] Version 1.14 Added encrypting messages. --- README.md | 7 ++++--- src/main.cpp | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index e174c3c..65c3da5 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ESP-NOW based switch for ESP8266. Alternate firmware for Tuya/SmartLife WiFi swi ## Features -1. After turn on (or after rebooting) creates an access point named "ESP-NOW Switch XXXXXXXXXXXX" with password "12345678" (IP 192.168.4.1). Access point will be shown during 5 minutes. The rest of the time access point is a hidden. +1. After turn on (or after rebooting) creates an access point named "ESP-NOW switch XXXXXXXXXXXX" with password "12345678" (IP 192.168.4.1). Access point will be shown during 5 minutes. The rest of the time access point is a hidden. 2. Periodically transmission of system information (every 60 seconds), availability status (every 10 seconds) and state status (every 300 seconds) to the gateway. 3. Saves the last state when the power is turned off. Goes to the last state when the power is turned on. 4. Automatically adds switch configuration to Home Assistan via MQTT discovery as a switch. @@ -25,5 +25,6 @@ See [here](https://github.com/aZholtikov/ESP-NOW-Switch/tree/main/hardware). 1. A gateway is required. For details see [ESP-NOW Gateway](https://github.com/aZholtikov/ESP-NOW-Gateway). 2. ESP-NOW network name must be set same of all another ESP-NOW devices in network. -3. Upload the "data" folder (with web interface) into the filesystem before flashing. -4. For using this firmware on Tuya/SmartLife WiFi switches, the WiFi module must be replaced with an ESP8266 compatible module (if necessary). +3. If encryption is used, the key must be set same of all another ESP-NOW devices in network. +4. Upload the "data" folder (with web interface) into the filesystem before flashing. +5. For using this firmware on Tuya/SmartLife WiFi switches, the WiFi module must be replaced with an ESP8266 compatible module (if necessary). diff --git a/src/main.cpp b/src/main.cpp index 7ab415d..7acd53d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -29,7 +29,7 @@ typedef struct std::vector<espnow_message_t> espnowMessage; -const String firmware{"1.13"}; +const String firmware{"1.14"}; String espnowNetName{"DEFAULT"}; @@ -99,6 +99,7 @@ void setup() WiFi.setSleepMode(WIFI_NONE_SLEEP); myNet.begin(espnowNetName.c_str()); + // myNet.setCryptKey("VERY_LONG_CRYPT_KEY"); // If encryption is used, the key must be set same of all another ESP-NOW devices in network. myNet.setOnBroadcastReceivingCallback(onBroadcastReceiving); myNet.setOnUnicastReceivingCallback(onUnicastReceiving);