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

Setting a static IP hangs until an Ethernet cable is attached to another port #12

Open
ssilverman opened this issue Feb 8, 2021 · 6 comments

Comments

@ssilverman
Copy link

while(!link_status){
}

This code will hang if I want to set a static IP but don't yet have a cable plugged in. I waited for a while and it looks like the link status is never set to something other than Unknown (0). Is link_callback supposed to be called at all in this case?

@ssilverman
Copy link
Author

@ssilverman
Copy link
Author

My solution is to just comment out that tight while loop. Then things work as expected.

@ssilverman
Copy link
Author

ssilverman commented Feb 22, 2021

Just pinging on this issue because you answered #13 just now :)

@troy-at-skyfront
Copy link

I am also having this issue. I'll try to comment out the while loop as you suggested.

@lorenzofattori
Copy link

Having the same issue, currently commented the lines in the library, but it would be nice to have a fix on library level so we don't have to do this manually at every library update.

Cheers!

@ssilverman
Copy link
Author

ssilverman commented Jan 30, 2022

I think that this behaviour shouldn’t be here. I know @vjmuzik you said that the library should block because that’s how you remembered some older Arduino library behaving, however, why would there exist an Ethernet.linkStatus() function at all if it would always return “LinkON”?

If the library blocks until “link”, wouldn’t that contradict the mere existence of that function? For example, the API says there’s also “LinkOFF” and “Unknown” return values. How can code ever even check this if the library blocks until link?

Additionally, this blocking behaviour makes it very easy to “freeze” any Teensy using this library just by unplugging the Ethernet cable at startup. This will prevent any other functions from running, for example data collection.

I’m also going to guess that most users of this library are writing new code and are probably not relying on some “old behaviour”, whatever that was.

My three and a half cents… thank you for reading. :)

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