Search code examples
serveresp8266nodemculocal-networkesp8266wifi

How to get access to ESP8266 ( NODEMCU ) served website outside local network?


I'm able to connect my ESP8266 to local network, serve a website and access it on my mobile using the local IP address. So I tried getting my Public IP using api.ipify.org and use it to access the nodemcu server outside my local network but I couldn't access the website using my public ip.

How to expose my nodemcu server to the internet rather than just local network ?

Would love any code based solution not involving 3rd party services.

THANKS IN ADVANCE


Solution

  • The concept is port forwarding.

    First you need to know your public IP using https://www.whatsmyip.org/

    Second, access the router settings where you want the ESP8266 to connect

    Third, navigate to the "forwarding" tab then Virtual server. there you can input the public IP address and the Port you want to expose to public.

    Finally, access the ESP8266 anywhere by typing the IP:Port in the browser