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

check_network #5

Open
pbecchi opened this issue Oct 11, 2017 · 4 comments
Open

check_network #5

pbecchi opened this issue Oct 11, 2017 · 4 comments

Comments

@pbecchi
Copy link

pbecchi commented Oct 11, 2017

Check_network has been modified from original 2.1.7 code . Since ESP32 do not have a ping function like Arduinos and ESP8266 the code need to be rewritten.
Could you tell me the reason for your changes and essential features you have added to this routine?
If necessary a logic diagram will be usefull.

@tcsaba101
Copy link
Owner

This cheking the internet connection status in 3 steps, performing a light fault detection too.
Three levels of connection checking:
check Ethernet controller is ok?
not: FAIL, break;
yes: check Router IP exist (DHCP in operation)
not: FAIL, break;
yes: check Internet access exists (ping local Google dns)
not: FAIL
yes: TRUE

The reason is the fact the EtherCard module doesn't care about the existing connection, and when a network call has launched and connection is missing it stacks at some point and after a long time comes back to the program cycle. Sometimes one cycle has been 30 secs.
This way if there is no connection the Network calls are disabled and it operates as a dumb controller still the network comes back.
If you need more info let me know.

@pbecchi
Copy link
Author

pbecchi commented Oct 12, 2017

For Esp we have a different situation :
WiFi reconnect automatically
We can only check with Ping to see if target is reachable (not yet on Esp32!)
Then we can send PUT or GET with a timeout to avoid program hang!

@tcstmarkt
Copy link

That will be ok.
The important is to avoid http comm when no connection.

And how Ethernet works? this will be similar to SG21: controller, router, service host. That looks the same.

@pbecchi
Copy link
Author

pbecchi commented Oct 12, 2017

Ethernet will be the last to develop

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

No branches or pull requests

3 participants