I think that's as expected. wifi.getIP returns almost immediately, and only calls the callback when the ESP8266 responds with the IP address. It means that the callback won't have got called by the time your console.log calls execute, and the IP will stay empty.
... if we could get the IP address immediately, wifi.getIP could have returned it directly, rather than faffing with the callbacks :)
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I think that's as expected.
wifi.getIP
returns almost immediately, and only calls the callback when the ESP8266 responds with the IP address. It means that the callback won't have got called by the time yourconsole.log
calls execute, and the IP will stay empty.... if we could get the IP address immediately,
wifi.getIP
could have returned it directly, rather than faffing with the callbacks :)