• That looks great! If it helps, you can use a templated string for the HTML...

    var page =`<html><body><script>var ws;setTimeout(function(){
    ...
    </script><p>something</p></body></html>`­;
    

    Which makes things tidier.

    Setting a DNS name is much harder I'm afraid. It is possible to update the ESP8266 (wifi module) firmware to enable this, but out of the box it isn't supported. setHostname is just the WiFi access point name.

    The easiest thing you can do is to set the IP address. You should be able to replace the wifi.getIP line with:

    var info = {ip:"192.168.1.9"};
    wifi.setIP(info, (err) => {
    })
    

    And then you'll always have the ESP8266 at a set IP address.

About

Avatar for Gordon @Gordon started