Skip to content
New issue

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

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

Already on GitHub? # to your account

LwipIntfDev::connected() does not reflect connection #8099

Closed
5 of 6 tasks
d-a-v opened this issue Jun 3, 2021 · 0 comments · Fixed by #8784
Closed
5 of 6 tasks

LwipIntfDev::connected() does not reflect connection #8099

d-a-v opened this issue Jun 3, 2021 · 0 comments · Fixed by #8784

Comments

@d-a-v
Copy link
Collaborator

d-a-v commented Jun 3, 2021

Basic Infos

  • This issue complies with the issue POLICY doc.
  • I have read the documentation at readthedocs and the issue is not addressed there.
  • I have tested that the issue is present in current master branch (aka latest git).
  • I have searched the issue tracker for a similar issue.
  • If there is a stack dump, I have decoded it.
  • I have filled out all fields below.

Platform

  • Hardware: esp82xx
  • Core Version: git master
  • Development Env: Arduino IDE
  • Operating System: any

Settings in IDE

  • Module: any
  • Flash Mode: any
  • Flash Size: any
  • Reset Method: any
  • Flash Frequency: any
  • CPU Frequency: any
  • Upload Using: any
  • Upload Speed: any

Problem Description

#6680 (review)

LwipIntfDev::connected() always returns true once it has connected once and acquired an IP address. So this does not really reflect the fact that the connection is active like you have with the WiFi. Even if you unplug the cable, it still returns true. This prevents to re-route to WiFi when ethernet is down.
Can't we replace this by checking the socket status by calling getSn_SR() ?

@jbaudoux @infrafast

MCVE Sketch

https://github.com/esp8266/Arduino/blob/master/libraries/lwIP_w5500/examples/TCPClient/TCPClient.ino

@d-a-v d-a-v added this to the 3.0.1 milestone Jun 3, 2021
@d-a-v d-a-v self-assigned this Jun 3, 2021
@d-a-v d-a-v modified the milestones: 3.0.1, 3.1 Jun 24, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant