Skip to content

An attempt to improve Yun's discovery #2658

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

Merged
merged 2 commits into from
Feb 19, 2015
Merged

An attempt to improve Yun's discovery #2658

merged 2 commits into from
Feb 19, 2015

Conversation

ffissore
Copy link
Contributor

Thanks @roadfun. See #2576

/cc @cmaglie

@ffissore ffissore mentioned this pull request Feb 17, 2015

boolean reachable = false;
for (Integer port : ports) {
reachable = reachable || NetUtils.isReachable(inetAddress, port);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This loop always check for 80 and 22, it may be rewritten as:

reachable = false;
for (Integer port : ports) {
  if (NetUtils.isReachable(inetAddress, port)) {
    reachable = true;
    break;
  }
}

so it stops at the first successful check

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After @roadfun comment, I've changed && to a ||. This way the loop will spin but it won't run isReachable any more as soon as one returns true

@ronguest
Copy link

Tried both "macosx" download links. When I unzip the files in both cases I get a mess that Arduino has been damaged and should be moved to the trash. So I can't test this build.

@ffissore
Copy link
Contributor Author

I can download and unpack it successfully but I'll trigger another build

@ffissore
Copy link
Contributor Author

@ArduinoBot build this please

Federico Fissore added 2 commits February 19, 2015 09:15
…ersions

Refactored NetUtils.isReachable to two functions:
isReachableByEcho and isPortOpen
If the first one will fail, the second one will be used
@ffissore
Copy link
Contributor Author

Since InetAddress.isReachable is reported to be reliable on mac, I've merged both ways into NetUtils (see https://github.com/ffissore/Arduino/commit/0990f98b1430bdd79022d48981f91ddf354bae78)
Now, first attempt is done by isReachableByEcho, second one by opening ports with isPortOpen

@ronguest
Copy link

Sorry Federico but this doesn't work for me either. I checked the Console log and launching the app gives an error I've never seen before, and a quick web search didn't turn up any clue. I'd have to do some digging to figure out why it doesn't work if it works for you. Only thing I can guess is some sort of security/sandbox issue. But I don't have any problem downloading and running the official build.

2/19/15 8:41:30.753 AM CoreServicesUIAgent[2653]: Error -60005 creating authorization
2/19/15 8:41:30.817 AM CoreServicesUIAgent[2653]: Error SecAssessmentCreate: The operation couldn’t be completed. (OSStatus error -67030.)

@ffissore
Copy link
Contributor Author

Ah maybe it's because osx treat the app as unsecure because you've downloaded and it's not signed (automated builds are not signed, only releases are)
You should find some way to allow this app to run: I've once seen a temporary permission, but I can't point you to the right button, sorry

@ronguest
Copy link

My usual trick for opening unsigned apps didn't work. I'll do some more searching.

@ronguest
Copy link

Figured out the work around - in this case it requires changing the system setting to allow any app to run. The single-app exceptions doesn't work. Having solved that problem.

I think this build works as well as the version I created. I still some issues (e.g. sometimes no Yuns are shown at all) but those are common between your build and mine. Definitely this fixes the "port 80 not open" problem.

@ffissore
Copy link
Contributor Author

Good! Thanks for all your work and feedback :)

ffissore added a commit that referenced this pull request Feb 19, 2015
An attempt to improve Yun's discovery
@ffissore ffissore merged commit 947951d into arduino:master Feb 19, 2015
@ffissore ffissore deleted the better-yun-discovery branch February 19, 2015 15:42
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

Successfully merging this pull request may close these issues.

4 participants