2

I am trying to access my Arduino Yun from the internet, and it's not quite working. I have correctly port forwarded the port 5555 from the router to the Yun (verified I am able to access my many other NAT'd resources).

I can access the Yun from my internal network.

In the Arduino sketch I have this (among many other things). Mainly taken from example sketches.

#include <Bridge.h>
#include <HttpClient.h>
#include <YunServer.h>
#include <YunClient.h>

YunServer server;

void setup {
   // Listen for incoming connections on port 5555
   server.noListenOnLocalhost();
   server.begin();
}

Is server.noListenOnLocalhost(); the right one to use to access from the outside world?

2

Well, I'm not familiar with the Yun, but the first thing that stands out is the missing

Bridge.begin();

line apparently needed to initialize the Bridge library that you use.

And you do have something like

YunClient client = server.accept();

and "more" in the main loop (or a function where applicable) of your code, right ?

And yes, noListenOnLocalhost() is the correct function for serving external clients.

  • Yes, I have Bridge.begin(); and YunClient client = server.accept(); is there within the loop. I'm able to access everything internally, just not externally. – Pat Feb 26 '14 at 17:46
  • So your answer helped me validate that what I am doing is correct. I'll mark it as solved. What ended up happening is that my router didn't save the NAT for port 5555. So I re-did that, and it's good. Thanks again for verifying that noListenOnLocalhost() is correct for external hits! – Pat Feb 26 '14 at 17:50
  • @Pat Glad to have... ahem... "helped" :-) – FredP Feb 26 '14 at 17:53
  • You did! I wasn't sure if noListenOnLocalhost() was correct, and the documentation on noListenOnLocalhost vs listenOnLocalhost wasn't overly clear (I think they both say the exact same thing). – Pat Feb 26 '14 at 17:54
  • The doc is "correct", but indeed not very explicit regarding internal VS external. And I must admit that when I first saw the function name I found it rather suspect. – FredP Feb 26 '14 at 17:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.