-
Notifications
You must be signed in to change notification settings - Fork 0
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
Ethernet sample not working as expected #789
Comments
This is the same as this one:
|
How about using the network information classes and ask the OS if it has an IP address ? These classes eventually call |
IsConnected doesn't indicate an internet connection, it indicates that the physical cable is attached. The underlying OS knows that information (or at least how to get it) because it's capable of sending an event when it changes. We just need one of 2 things for Core:
|
Isn't
That is what actually happens, it sounds like we have a timing conflict with the connection being raised and the initial property value. I'm suggesting that we look at using the network interface classes as they should call the I would also think that using the network interface classes would give us better cross platform compatibility as fixing the event on F7 just fixes that platform. Has anyone tested this on a Pi ? |
WorkaroundBefore starting the App, please put it on
|
Sample application is the Ethernet_Basics application.
Expected Behaviour
The application should wait for a connection and then then get a web page. The connection may already be present in which case the code should proceed to get the web page anyway.
What Happening
Start the board with the network cable connected.
The following is from the start up sequence for the application.
Key points are:
Interface 6 (Ethernet ) is sending event 36 (Connected) to Core.
Note that the application has not started yet.
Interface 1 (WiFi) is sending event 38 (NTP Update) to Core.
Next up we get a message from the application:
This does not appear to be coming from the application code.
The code then seems to pause waiting for an event as the network information is not displayed which it should do.
Next up, disconnect and then reconnect the network cable to the device. The following output is generated:
Running through the events:
Interface 6 (Ethernet) raising event 37 (Disconnected) which is picked up by the application.
Plugging the network cable back in to the device we get the Connected and NTP changed events as described previously.
Further Investigation
This could be an issue in Core where the
IsConnected
property is not being set correctly.We should probable adjust the sample code and add an
else
clause to the statementif (ethernet.IsConnected)
to output a message that the WiFi cable is not connected.It may also be desirable to refactor this sample to take into account cables not being connected at the start and plugged / unplugged during the application run.
The text was updated successfully, but these errors were encountered: