Open pedrohugo-psc opened 3 weeks ago
@pedrohugo-psc Are you just starting your project? Since MDF is out of maintenance and v4.4 is nearing its life cycle, it is recommended that you use mesh lite .
@pedrohugo-psc Are you just starting your project? Since MDF is out of maintenance and v4.4 is nearing its life cycle, it is recommended that you use mesh lite .
Hello, @zhangyanjiaoesp,
This project aims to request data from meters via Modbus TCP, RS485, PIMA, PULSE, or RS232 and send this data to a database. Therefore, it is necessary to connect the device to the internet via WiFi and use WiFi Mesh to avoid network overload. The system runs well with RS485, PIMA, PULSE, or RS232 for extended periods without encountering these bugs, and MDF functions properly. However, recently, I needed to integrate Modbus TCP for data requests, which has introduced bugs when this protocol is selected. If another protocol is used, the system runs well. I believe the issue is memory fragmentation because, upon analyzing the memory using esp_get_free_heap_size(), no memory leaks were detected.
There is the log below apper first type memory allocation failed:
And this log apper wifi_nvs_set fail:
@zhangyanjiaoesp,
This project is not new and has been running well for a long time. However, I recently needed to implement the Modbus TCP protocol to request data, which has caused this issue to appear.
@pedrohugo-psc ok, I will check the logs you provide. By the way, can you provide a demo to test?
@pedrohugo-psc Can you open the Wi-Fi information logs? There seems only have the warning logs. The wifi_nvs_set fail is setting the STA's channel and AP'channel, seems to be the set config fail. The first type memory allocation failure indicates that the device is receiving packets. Can't get more information. Can you explain what Wi-Fi mesh and Modbus TCP do in your case ?
Hi, @zhangyanjiaoesp,
This project is extensive and proprietary to the company, making it complicated to send a demo.
Regarding WiFi Mesh, I use this module to connect the root to the router and the nodes to their parent devices. The root is an ESP with a better signal, while the other ESPs become nodes. The purpose of this WiFi Mesh is to avoid overloading the network.
Regarding Modbus TCP, I use this module for the ESP to request data from the meter. The requests occur every 30 seconds. The connection between the ESPs and the meter is via the network, with the ESPs obtaining an IP address via DHCP before connecting. I use the W5500 module for Ethernet.
The ESPs request data, and every 15 minutes, the data is sent to the AWS database through the root.
This project ran well without Modbus TCP and the issue appeared after its integration.
I ran the code again and set the log output to verbose. I hope this log can help:
@zhangyanjiaoesp,
Sorry for sending the previous log. This new log contains more information and I hope it helps.
Hello, @zhangyanjiaoesp,
The last log have a lot information, but hasn´t information about WiFi. Then, I send another one log that have WiFi log:
Another thing I noticed is that when I use the LILYGO TTGO T-Internet-POE board with the ESP32-WROOM-32E, these bugs don't appear. I conducted this test for 6 days. Is it possible that the bugs are caused by using the ESP32-WROOM-32D?
Edit: Furthermore, this problem can be caused by SPI pins (HSPI), utilized by module W5500?
Answers checklist.
IDF version.
v4.4.4
Espressif SoC revision.
ESP32-WROOM-32D
Operating System used.
Windows
How did you build your project?
VS Code IDE
If you are using Windows, please specify command line type.
None
Development Kit.
Devkit_v4
Power Supply used.
USB
What is the expected behavior?
I'd like to run the ESP32 using WiFi-Mesh via MDF and Modbus TCP while disconnected from the internet for an extended period without experiencing memory allocation issues or other problems. Afterward, I would like to connect this device to the internet.
What is the actual behavior?
When running the ESP32 using WiFi-Mesh via MDF and Modbus TCP while disconnected from the internet for an extended period, can 3 types memory allocation failure occurs, causing a reboot, although the device can still connect to the internet. Additionally, if the memory allocation failure does not occur, a wifi_nvs_set failure appears, preventing the ESP from connecting to the internet.
Steps to reproduce.
In this project, I am using a combination of WiFi Mesh via MDF and Modbus TCP. It is essential to integrate both solutions and run them for an extended period without being connected to the internet.
Debug Logs.
More Information.
No response