Skip to content

How to set hostname properly? #8816

Answered by cziter15
cziter15 asked this question in Q&A
Jan 18, 2023 · 6 comments · 26 replies
Discussion options

You must be logged in to vote

TL;DR

  • Hostname should be set before calling WiFi.begin(), preferably with WiFi mode set to WIFI_STA (and WIFI_OFF on ESP32).
  • The hostname set by WiFi.setHostname has nothing to do with mDNS hostname.
  • Your code shouldn't stuck in loop(), even when you call handle() and similar methods manually as some services are handled after returning from loop function. Calling delay(1) or yield() is not a magic solution. See: #8816 (reply in thread)

Replies: 6 comments 26 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
22 replies
@cziter15
Comment options

@d-a-v
Comment options

d-a-v Jan 24, 2023
Collaborator

@cziter15
Comment options

@d-a-v
Comment options

d-a-v Jan 24, 2023
Collaborator

@cziter15
Comment options

Comment options

You must be logged in to vote
4 replies
@cziter15
Comment options

@hmueller01
Comment options

@d-a-v
Comment options

d-a-v Jan 22, 2023
Collaborator

@cziter15
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by cziter15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants