Skip to content

fix: connect failed - no CPU time for IP stack#1050

Open
devmirek wants to merge 1 commit intoknolleary:masterfrom
bonitoo-io:fix_connect
Open

fix: connect failed - no CPU time for IP stack#1050
devmirek wants to merge 1 commit intoknolleary:masterfrom
bonitoo-io:fix_connect

Conversation

@devmirek
Copy link
Copy Markdown

@devmirek devmirek commented Apr 3, 2024

ESP32-C3 is not able to receive CONNACK packet because the waiting loop did not have any delay to let other tasks to process incoming TCP packet data.

@EmbeddedDevver
Copy link
Copy Markdown

Better use yield().
Also same as #567 and #901

@devmirek
Copy link
Copy Markdown
Author

devmirek commented Apr 11, 2024

Better use yield(). Also same as #567 and #901

I would prefer yield() as well. I have tested it with yield() first. It didn't work. Small delay was the only option that reliably solved it (ESP32-C3 with WiFiClientSecure). It was a very tricky issue because sometimes it was successfully reconnected (CONNACK was received after reconnection) but the first connect always failed and sometimes the next reconnects randomly failed as well - always due to CONNACK timeout.

@devmirek devmirek changed the title fix: connect failed - no time for IP stack fix: connect failed - no CPU time for IP stack Apr 15, 2024
@hmueller01
Copy link
Copy Markdown

@devmirek Can you reproduce the problem with https://github.com/hmueller01/pubsubclient3 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants