Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP32S2 TCP Server: Error EAGAIN on socket.accept() #4085

Closed
Larrxi opened this issue Jan 28, 2021 · 4 comments
Closed

ESP32S2 TCP Server: Error EAGAIN on socket.accept() #4085

Larrxi opened this issue Jan 28, 2021 · 4 comments
Assignees
Labels
bug espressif applies to multiple Espressif chips network

Comments

@Larrxi
Copy link

Larrxi commented Jan 28, 2021

I try to start a TCP server on my Lilygo TTGO T8 ESP32-S2 with display.

code.py output:
192.168.43.83
will timeoutTraceback (most recent call last):
  File "code.py", line 18, in <module>
OSError: [Errno 11] EAGAIN

Code done running.

I am using the code from here:
https://gist.github.com/hierophect/5bb6133a69f8395841531013d46d2703

@tannewt tannewt added bug espressif applies to multiple Espressif chips network labels Jan 28, 2021
@tannewt tannewt added this to the 6.x.x - Bug Fixes milestone Jan 28, 2021
@hierophect
Copy link
Collaborator

I think this is probably because the Server Socket PR inadvertently changed the default timeout of sockets to 0 instead of None. You could try increasing the timeout with settimeout(None) or try #4049 which will revert to a no-timeout default.

@Larrxi
Copy link
Author

Larrxi commented Jan 29, 2021

With settimeout -1 it give other error EATIMEOUT or something and it did print out the client IP address.

I then try with #4049 (without settimeout) and now it proceeds further:

code.py output:
192.168.43.83
Connected by ('192.168.43.17', 22723)
bytearray(b'Hello, world\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00')

The client gets:
Received b''

@Larrxi
Copy link
Author

Larrxi commented Feb 1, 2021

Okey it works when, before connecting socket, setting socket.settimeout(None).
Thanks!

@hierophect
Copy link
Collaborator

@Larrxi no problem. Note that since #4095 has now been merged, you shouldn't even need to take that step anymore on the most recent builds, as the default behavior has been returned to a timeout of None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug espressif applies to multiple Espressif chips network
Projects
None yet
Development

No branches or pull requests

3 participants