From 1c306e031bcb5567d48f9e9b792306781550bd1f Mon Sep 17 00:00:00 2001 From: Alexey Zholtikov Date: Sun, 22 Jan 2023 12:46:58 +0300 Subject: [PATCH] Version 1.24 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 5d09c85..c629fa7 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Gateway for data exchange between ESP-NOW devices and MQTT broker via WiFi. ## Features -1. Creates an access point named "ESP-NOW Gateway XXXXXXXXXXXX" with password "12345678" (IP 192.168.4.1). +1. Creates an access point named "ESP-NOW gateway XXXXXXXXXXXX" with password "12345678" (IP 192.168.4.1). 2. Possibility a device search through the Windows Network Environment via SSDP. 3. Periodically transmission of system information to the MQTT broker (every 60 seconds) and availability status to the ESP-NOW network and to the MQTT broker (every 10 seconds). 4. Automatically adds gateway configuration to Home Assistan via MQTT discovery as a binary_sensor. @@ -21,8 +21,9 @@ Gateway for data exchange between ESP-NOW devices and MQTT broker via WiFi. ## Attention 1. ESP-NOW network name must be set same of all another ESP-NOW devices in network. -2. Upload the "data" folder (with web interface) into the filesystem before flashing. -3. WiFi router must be set on channel 1. +2. If encryption is used, the key 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. WiFi router must be set on channel 1. ## Tested on diff --git a/src/main.cpp b/src/main.cpp index 0ad9a8b..420a42f 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -34,7 +34,7 @@ void setupWebServer(void); void connectToMqtt(void); -const String firmware{"1.23"}; +const String firmware{"1.24"}; String espnowNetName{"DEFAULT"}; @@ -90,6 +90,7 @@ void setup() WiFi.setAutoReconnect(true); myNet.begin(espnowNetName.c_str(), true); + // 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(onEspnowMessage); myNet.setOnUnicastReceivingCallback(onEspnowMessage);