Now that i read up on it a little context in case OT is interested: https://medium.com/@_tiwiz/bonjour-andr ... 3d3fde760e
for example:
WiFi.hostname("abcd");
Serial.println(WiFi.hostname());
Shows that the host name is still empty. After it connects to WiFi the automatic name of ESP_123456 is returned by WiFi.hostname()
Yes, this is first thing in setup(), before any other reference to WiFi object.
Note: it seems to be random/intermitant, it worked fine all afternoon then suddenly stopped working and I cannot get it to work again. Two different NodeMCU units. Also tried different LwIP options.
I am using ESP8266 2.5.0 with board: NodeMCU 1.0 (ESP12E module)
Arduino IDE 1.8.9