Fixed one bug
This commit is contained in:
parent
4f14de7763
commit
e310ef6573
@ -1,4 +1,4 @@
|
|||||||
# Tested on
|
# Tested on
|
||||||
|
|
||||||
1. Model D06 Type 1. Built on Tuya WiFi module TYWE3S (ESP8266 chip). Analogue of ESP-01. Does not require replacement. Total triggering time about 1.5 sec. [Photo](https://github.com/aZholtikov/ESP-NOW-Window-Door-Sensor/tree/main/hardware/Model_D06_Type_1).
|
1. MODEL D06 TYPE 1. Built on Tuya WiFi module TYWE3S (ESP8266 chip). Analogue of ESP-01. Does not require replacement. Total triggering time about 1.5 sec. [Photo](https://github.com/aZholtikov/ESP-NOW-Window-Door-Sensor/tree/main/hardware/Model_D06_Type_1).
|
||||||
2. Model D06 Type 2. Built on Tuya WiFi module CBU (BK7231N chip). Replacement required. No physical equivalent (as of this writing). Performed replacement with ESP-M2 (ESP8285 chip) because it was in stock. It can be replaced with any ESP8266 compatible. Total response time about 0.5 sec. [Photo](https://github.com/aZholtikov/ESP-NOW-Window-Door-Sensor/tree/main/hardware/Model_D06_Type_2).
|
2. MODEL D06 TYPE 2. Built on Tuya WiFi module CBU (BK7231N chip). Replacement required. No physical equivalent (as of this writing). Performed replacement with ESP-M2 (ESP8285 chip) because it was in stock. It can be replaced with any ESP8266 compatible. Total response time about 0.5 sec. [Photo](https://github.com/aZholtikov/ESP-NOW-Window-Door-Sensor/tree/main/hardware/Model_D06_Type_2).
|
||||||
|
@ -20,12 +20,13 @@ void sendAttributesMessage(void);
|
|||||||
|
|
||||||
struct deviceConfig
|
struct deviceConfig
|
||||||
{
|
{
|
||||||
const String firmware{"1.3"};
|
|
||||||
String espnowNetName{"DEFAULT"};
|
String espnowNetName{"DEFAULT"};
|
||||||
String deviceName = "ESP-NOW window " + String(ESP.getChipId(), HEX);
|
String deviceName = "ESP-NOW window " + String(ESP.getChipId(), HEX);
|
||||||
uint8_t deviceClass{HABSDC_WINDOW};
|
uint8_t deviceClass{HABSDC_WINDOW};
|
||||||
} config;
|
} config;
|
||||||
|
|
||||||
|
const String firmware{"1.3"};
|
||||||
|
|
||||||
char receivedBytes[128]{0};
|
char receivedBytes[128]{0};
|
||||||
uint8_t counter{0};
|
uint8_t counter{0};
|
||||||
uint8_t messageLenght{0};
|
uint8_t messageLenght{0};
|
||||||
@ -201,7 +202,7 @@ void setupWebServer()
|
|||||||
{
|
{
|
||||||
String configJson;
|
String configJson;
|
||||||
DynamicJsonDocument json(256); // To calculate the buffer size uses https://arduinojson.org/v6/assistant.
|
DynamicJsonDocument json(256); // To calculate the buffer size uses https://arduinojson.org/v6/assistant.
|
||||||
json["firmware"] = config.firmware;
|
json["firmware"] = firmware;
|
||||||
json["espnowNetName"] = config.espnowNetName;
|
json["espnowNetName"] = config.espnowNetName;
|
||||||
json["deviceName"] = config.deviceName;
|
json["deviceName"] = config.deviceName;
|
||||||
json["deviceClass"] = config.deviceClass;
|
json["deviceClass"] = config.deviceClass;
|
||||||
@ -258,7 +259,7 @@ void sendAttributesMessage()
|
|||||||
json["Type"] = "ESP-NOW window sensor";
|
json["Type"] = "ESP-NOW window sensor";
|
||||||
json["MCU"] = "ESP8266";
|
json["MCU"] = "ESP8266";
|
||||||
json["MAC"] = myNet.getNodeMac();
|
json["MAC"] = myNet.getNodeMac();
|
||||||
json["Firmware"] = config.firmware;
|
json["Firmware"] = firmware;
|
||||||
json["Library"] = myNet.getFirmwareVersion();
|
json["Library"] = myNet.getFirmwareVersion();
|
||||||
serializeJsonPretty(json, outgoingData.message);
|
serializeJsonPretty(json, outgoingData.message);
|
||||||
char temp[sizeof(esp_now_payload_data_t)]{0};
|
char temp[sizeof(esp_now_payload_data_t)]{0};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user