-->
Page 1 of 1

wifi.sta.sethostname("NodeMCU")

PostPosted: Sun Apr 24, 2016 3:42 am
by Calin
I try to give a name to each device on the network to which I am connected

wifi.setmode(wifi.STATION)
wifi.sta.config("........","..........")

if (wifi.sta.sethostname("NodeMCU") == true) then
print("hostname was successfully changed")
else
print("hostname was not changed")
end
And I receive:
> dofile("pwm_analog_on_off_1.lua");
pwm_analog_on_off_1.lua:1: attempt to call field 'sethostname' (a nil value)

So what 's wrong ?
Thank you
Calin

Re: wifi.sta.sethostname("NodeMCU")

PostPosted: Thu Apr 28, 2016 8:28 am
by TerryE
Sounds like you are using a current dev build. This API function was only added recently