-->
Page 1 of 5

Accessing 8266 remotely via internet, rather than LAN

PostPosted: Tue Dec 22, 2015 7:52 am
by RyanC
Hi there,
So I'm sure this is a question which is answered many times elsewhere, but the internet is so flooded with various sources, I'm having a really tough time wrapping my head around this. For instance, right now, I have working this sketch: https://gist.github.com/igrr/9ef4d5c74355503e3b1f . All is well, it's working fine, but I can only access it by typing the network ip if I'm on the same LAN. How do I go from this to, say, being able to move this servo while I'm at the library or wherever?
Thanks for the help

Re: Accessing 8266 remotely via internet, rather than LAN

PostPosted: Thu Dec 24, 2015 10:32 am
by pzwolinski
Forward port 80 to the IP of the ESP?

Re: Accessing 8266 remotely via internet, rather than LAN

PostPosted: Thu Dec 24, 2015 11:54 am
by GengusKahn
Hi there, Port forwarding will work well but you need to set this up on each router for each device, then it gets complicated.

Us a simple post to Thingspeak then view data remotely rather than directly.......

This is posting the data from a DHT sensor and the System Vcc, View this very elegantly and simply via freeboard.io

Code: Select all// Use WiFiClient class to create Thingspeak Post
  WiFiClient client;
  if (!client.connect(hostts, 80)) {
    return;
  }
  String url = "/update?key=";
  url += thingspeak_key;
  url += "&field1=";
  url += pfTemp;
  url += "&field2=";
  url += pfHum;
  url += "&field3=";
  url += pfDew;
  url += "&field4=";
  url += pfVcC/1000, 3;
// This will send the request to the server
  client.print(String("GET ") + url + " HTTP/1.1\r\n" +
               "Host: " + hostts + "\r\n" +
               "Connection: close\r\n\r\n");
  delay(50);
  client.stop();   

Re: Accessing 8266 remotely via internet, rather than LAN

PostPosted: Fri Dec 25, 2015 7:48 am
by RyanC
Hi there,

Thanks for the responses, they've been a good hint. Unfortunately, I'm pretty deep into code noob territory, and know virtually no programming thus far. Can anyone give me more of a step by step on how to go from this working code to accessing that code remotely? Failing that, can someone please point out any existing guide which might be helpful for arduino and the esp? The ones I've found have not been helpful for those using the arduino IDE.

Thanks again