[resolved]change name esp32 expressif

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
bellad
Posts: 96
Joined: Tue May 14, 2019 1:47 pm

[resolved]change name esp32 expressif

Post by bellad » Mon Feb 24, 2020 1:03 pm

hello,
i will have several ESP32 on my wifi router and everyone is called ' expressif' ,
is it possible to change the name?
thank
Last edited by bellad on Mon Feb 24, 2020 1:47 pm, edited 1 time in total.

DJShadow1966
Posts: 60
Joined: Sun Jun 23, 2019 4:55 am
Location: Gateshead, Tyne and Wear

Re: change name esp32 expressif

Post by DJShadow1966 » Mon Feb 24, 2020 1:29 pm

Hello

Yes you can change the hostname this is what I use.

Code: Select all

import network, ntptime, utime, machine

sta_if = network.WLAN(network.STA_IF)
sta_if.active(True)
# Next Line changes the hostname.
sta_if.config(dhcp_hostname="ComputerTest2")
sta_if.connect('*****', '*****')
print("Connecting ")
while not sta_if.isconnected():
    print(".", end="")
    utime.sleep(1)

try:
    ntptime.settime()
except:
    pass

bellad
Posts: 96
Joined: Tue May 14, 2019 1:47 pm

Re: change name esp32 expressif

Post by bellad » Mon Feb 24, 2020 1:33 pm

thank you very much

but no dhcp ,
it's ok , it's work

Post Reply