-->
Page 1 of 3

connecting ESP8266 remotely

PostPosted: Wed Oct 19, 2016 2:47 am
by Syed Niamath
Hi,

Currently I am able to connect my ESP8266 which is set to 192.168.4.1 (wifimanager.autoconnect) which works perfectly from my webbrowser.

This works fine locally (within my wifi network), but I want to connect it remotely.

Earlier I have connected remotely through a webserver by hardcoding domin name "const char* host = "myserver.com"; "

What should I do so that it works both locally and remotely.

Please suggest.

Re: connecting ESP8266 remotely

PostPosted: Wed Oct 19, 2016 3:21 am
by carl
Correct me if I am wrong. So you want to connect your ESP8266 thru internet where you can control its pins anywhere you are?

If that is the case then this might help.

1. When you are using ESPlorer when programming your ESP8266
[url]http://thinkingparts.blogspot.com/2015/08/home-automation-uploading-code-into_23.html[/url]
2. When you are using Arduino IDE when Programming your ESP8266
[url]http://thinkingparts.blogspot.com/2015/08/home-automation-diy-version-internet_13.html[/url]
3. When you are using Lua Loader when programming your ESP8266
[url]http://thinkingparts.blogspot.com/2015/08/programming-esp8266-using-lua-loader.html[/url]


Let the Interent of Things Begin!!!

Re: connecting ESP8266 remotely

PostPosted: Wed Oct 19, 2016 4:55 am
by eduperez
Syed Niamath wrote:Hi,

Currently I am able to connect my ESP8266 which is set to 192.168.4.1 (wifimanager.autoconnect) which works perfectly from my webbrowser.

This works fine locally (within my wifi network), but I want to connect it remotely.

Earlier I have connected remotely through a webserver by hardcoding domin name "const char* host = "myserver.com"; "

What should I do so that it works both locally and remotely.

Please suggest.


Can you configure your local router? In that case, there are two options that I have used before:
  • Configure your local DNS so "myserver.com" points to "192.168.4.1".
  • Configure your router to redirect traffic to "myserver.com" IP address to "192.168.4.1".

Re: connecting ESP8266 remotely

PostPosted: Wed Oct 19, 2016 4:58 am
by Syed Niamath
Thanks Carl for those links, I'm using Arduino IDE.

Yes you are right! want to control the ESP8266 pins from anywhere.

Also In my recent experience when its connected locally (192.168.4.1) the response is very good whereas from server(domain name) it takes almost 4 to 5 secs. Is this maybe due to latency issue?