Setting the ESP8266's hostname

By default, each ESP8266 uses the last six hexdecimal digits of its MAC address prefixed by ESP_ to make its hostname unique, e.g. ESP_B19F40. You can change this from within your sketch by calling WiFi.hostname() and passing the function a string containing the new hostname. This call MUST occur before you start the connection with WiFi.begin()