Good afternoon, tell me how to fix the following situation.
We have ESP32S and the W5500 mini Ethernet module is also connected to it.
I am sending data via http_request.post if sending is done over a Wi-Fi connection, then everything works well, if sending is done over an Ethernet connection, then sending does not happen, ESP simply reboots. There is nothing in the logs even at the VERBOSE level, they simply do not have time to form.
The Ethernet configuration and data sending code is below.
#ETHERNET_CODE
ethernet:
type: W5500
clk_pin: GPIO18
mosi_pin: GPIO23
miso_pin: GPIO19
cs_pin: GPIO5
interrupt_pin: GPIO32
reset_pin: GPIO33
clock_speed: 25MHz
http_request:
timeout: 5s
id: send_data_url
verify_ssl: false
script:
- id: send_data_to_server
then:
- if:
condition:
lambda: 'return id(send_data) == 1;'
then:
- if:
condition:
lambda: 'return id(send_all_data) == 1;'
then:
- logger.log:
format: "***** Sending Data *****"
level: INFO
tag: "DATA"
- http_request.post:
id: send_data_url
url: https://server.com/data/m.php
json: |
JsonObject device = root.createNestedArray("devices").createNestedObject();
device["mac"] = id(bme_temperature).state;
JsonArray sensors = device.createNestedArray("sensors");
std::array<std::tuple<const char*, const char*, const float*>, 1> sensor_data = {{
{"T1", "C", &id(bme_temperature).state},
}};
for (auto& sensor : sensor_data) {
const char* id = std::get<0>(sensor);
const char* unit = std::get<1>(sensor);
const float* value = std::get<2>(sensor);
if (!isnan(*value)) {
JsonObject sensor_object = sensors.createNestedObject();
sensor_object["id"] = id;
sensor_object["value"] = *value;
if (unit) {
sensor_object["unit"] = unit;
}
}
}