← index #6618PR #8831
Related · high · value 0.205
QUERY · ISSUE

ESP32: dhcp_hostname is read-only on non-WLAN interfaces

openby scyopened 2020-11-13updated 2025-11-25
docs

Hi there!

On a network.WLAN interface, I can set .config(dhcp_hostname='galactica'). However, on a LAN interface, I cannot:

>>> import network
>>> l = network.LAN()
>>> l.config('dhcp_hostname')
'espressif'
>>> l.config(dhcp_hostname='galactica')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: unknown config param

I was trying to do this on an Olimex ESP32-POE board, i.e. phy_type=network.PHY_LAN8720, but as far as I understand, the exact interface doesn’t matter since this config option will simply be passed to the ESP32’s DHCP client.

Would be cool if I could set a hostname also for a wired board! Thanks in advance for looking into this.

CANDIDATE · PULL REQUEST

esp32: esp8266: Rename dhcp_hostname to hostname

closedby IhorNehrutsaopened 2022-06-28updated 2023-07-10
port-esp8266port-esp32

This resolve misunderstanding from #8792
IRL dhcp_hostname is station or access point name.

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied