(solved - sort of) odd socket behavior

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

(solved - sort of) odd socket behavior

Postby mzimmers » Wed Dec 02, 2020 9:36 pm

Hi all -

Recently, my app (running release/v4.1 on a WROVER) began experiencing a significant lag on socket input. I perform a socket recvfrom with MSG_PEEK in a relatively tight loop. When I send a message from my PC to the ESP32 (via a multicast group), WireShark shows the message immediately, but my app doesn't see it for several (between 6 and ~60) seconds.

I'm not blocking; I put a telltale in the peek that indicates no data, over and over and over, until finally, it sees the message.

Any ideas? This is a showstopper for us.

Thanks...
Last edited by mzimmers on Thu Dec 17, 2020 10:28 pm, edited 1 time in total.

ESP_Sprite
Posts: 9040
Joined: Thu Nov 26, 2015 4:08 am

Re: odd socket behavior

Postby ESP_Sprite » Thu Dec 03, 2020 1:36 am

Strange, especially with such a long delay. Does disabling wifi power saving perhaps help?

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: odd socket behavior

Postby mzimmers » Thu Dec 03, 2020 1:38 am

Hi Sprite - I doubt that would help, but I can't do that anyway. I need WiFi running.

EDIT: I have a little trouble understanding git history...are there any WiFi-related patches or updates I should be using?

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: odd socket behavior

Postby mzimmers » Thu Dec 03, 2020 5:53 pm

Hi Sprite - I misread your reply above. I would certainly like to disable power saving when running on line power. In my sdkconfig file, CONFIG_PM_ENABLE is not set. Is there anything else I need to do?

Thanks...

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: odd socket behavior

Postby mzimmers » Thu Dec 03, 2020 10:38 pm

Another couple of data points:

This only seems to occur on my home network (a Google Nest mesh).

While the delay varies greatly, all the delayed units seem to receive their packet at (nearly) the same time. All the units experiencing the delay respond simultaneously.

User avatar
mzimmers
Posts: 643
Joined: Wed Mar 07, 2018 11:54 pm
Location: USA

Re: odd socket behavior

Postby mzimmers » Thu Dec 17, 2020 10:28 pm

I don't know what caused this, but recently I had a sustained power outage, which (presumably) caused a reset in my home network. Since then, everything's been back to normal. Marking this as solved.

Who is online

Users browsing this forum: No registered users and 155 guests