espressif / esp-who

Face detection and recognition framework
Other
1.67k stars 466 forks source link

Continuous streaming of video stops due to WIFI interruptions #123

Open fdoljack opened 4 years ago

fdoljack commented 4 years ago

Hi, I am posting this here so others can benefit what I found.
If your camera's web server abruptly stops streaming and returns error code 11, then you may have a situation like I experienced. In esp_httpd_server.h is found HTTPD_DEFAULT_CONFIG where .recv_wait_timeout and .send_wait_timeout both are set to 5 seconds. In my simple home network I was experiencing traffic interruptions that often exceeded 5 seconds, typically around 10 seconds. This kills streaming on the camera resulting in this error code 11. It was quite puzzling until using Wireshark on a receiving client I found there was a device in LAN that occasionally sent out a STP packet (Spanning Tree Protocol). The device was a Netgear WIFI dongle attached to the Dish Hopper and the Hopper was active as a root bridge system. STP is only needed in mesh networks of which mine is not. With no way to turn off STP in that device I increased the above timeouts to 30 seconds. Problem solved! (I read somewhere that STP can interrupt network traffic to a maximum of 30 seconds.)