← index #6618PR #3527
Related · high · value 0.302
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/modnetwork.c: Add dhcp_hostname handling

closedby waddyanoopened 2017-12-30updated 2018-05-02

Support dhcp_hostname similarly to esp8266

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