• 1) Many routers let you reserve an IP based on MAC address. I've used this facility on a Netgear router on an Espruino/ESP8266 project of my own.
    2) WebSockets if you can connect directly to the ESP8266 over LAN, MQTT if you need to be remote/WAN and don't want to open your firewall to your home network.
    3) ESP8266 Espruino build has facility to save WIFI credentials independently of your sketch/code. Check out the documentation.

    Good luck

    Edit: If you can't assign an IP based on Mac address go with MQTT. This negates the issue of a dynamically changing IP address, lets you use remotely without firewall compromise (which is often unsafe DMZ), and is great for two way communication.

  • Thanks for your reply, Ollie.
    Actually, my goal is to make esp8266 as portable as possible. I tried to eliminates all the manual configs that might need on my routers. Just like using a wemo, I never really have to mess with the router setting to get it to work. All I need is to turn it on, login to the wemo and setup the wifi login info and done. this is what I am trying to achieve in this proof of concept design. then expend it from there.

    By the way, I am having hard time to get the external ip(the public ip of my modem). when I do wifi.getIp(), it only returns the local ip(192.168.x.x). How do I get the external ip from esp8266? bcuz I want to get the the real ip and post it to my web server whenever it changes so I can access from outside.

About

Avatar for Ollie @Ollie started