Hello,
I am using FreeRTOS and lwip library to connect to a remote server. I have a client task which calls a function to send some data to the server. The function has a standard sequence of calling gethostbyname(), then socket(), connect(), write(), read() and eventually close().
The task is in the 30-second loop which means the function is called twice in a minute. The task runs perfectly for several days and then it gets stuck. I see it because after each passed loop I blink the blue LED for 500 ms and I see that it blinks once every 30 seconds for several days before it stops blinking.
However, when it gets stuck, if I power-down my router the task gets unstuck immediately! I can see that because I set a flag in the wifi event handler callback function when the connection is lost and I test this flag at the beginning of the task loop. If the flag is set it makes the blue LED blink fast and it really blinks like that for as long as the router is powered down. This means that the task is unstuck by the loss of the wifi connection!
When I power-up the router I see that the LED stops fast blinking and starts blinking again only once in 30 seconds (of course it first blinks every few seconds until the vTaskDelayUntil catches up with its time). I also see that the messages to the server go through again. It works fine again for several days until it gets stuck again.
One of the messages that go to the server is a heap size and I can see that it is stable and unchanged.
Does anyone know how (if at all) the lwip can get stuck and how to fix this?
Thanks
Possible problem with client using lwip
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- 中文文档讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: No registered users and 326 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.