From bcda1c9ea5354d1c3efbedb117a0adf2ebe589a8 Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Sun, 22 Jan 2023 12:38:53 +0300 Subject: [PATCH] Version 1.13 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 b47a759..fa51636 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ ESP-NOW based light/led strip controller for ESP8266. Alternate firmware for Tuy ## Features -1. After turn on (or after rebooting) creates an access point named "ESP-NOW Light 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 light 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 light/led strip configuration to Home Assistan via MQTT discovery as a light. @@ -25,5 +25,6 @@ See [here](https://github.com/aZholtikov/ESP-NOW-Light-Led-Strip/tree/main/hardw 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 light/led strip controllers, 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 light/led strip controllers, the WiFi module must be replaced with an ESP8266 compatible module (if necessary). diff --git a/src/main.cpp b/src/main.cpp index 0f9284d..f31fbc9 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -30,7 +30,7 @@ typedef struct std::vector espnowMessage; -const String firmware{"1.12"}; +const String firmware{"1.13"}; String espnowNetName{"DEFAULT"}; @@ -102,6 +102,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);