feat: set dhcp hostname
All checks were successful
/ platformio (push) Successful in 3m52s
/ openscad (push) Successful in 1m44s

This commit is contained in:
s3lph 2024-12-28 15:43:00 +01:00
parent e5207e00de
commit f88dcd6376
Signed by: s3lph
GPG key ID: 0AA29A52FB33CFB5
2 changed files with 3 additions and 2 deletions

View file

@ -16,4 +16,4 @@ upload_protocol = esptool
lib_deps =
adafruit/Adafruit NeoPixel@^1.11.0
sstaub/NTP@^1.6
https://git.kabelsalat.ch/s3lph/Arduino-Library-SoftDhcp.git@^0.0.1
https://git.kabelsalat.ch/s3lph/Arduino-Library-SoftDhcp.git@^0.0.2

View file

@ -54,7 +54,7 @@ void setupNtp() {
}
void expired() {
//Serial.println("DHCP lease expired, stopping NTP");
Serial.println("DHCP lease expired, stopping NTP");
ntp.stop();
ntpInitialized = false;
}
@ -63,6 +63,7 @@ void setup() {
Serial.begin(115200);
dhcp.onLease(setupNtp);
dhcp.onExpire(expired);
dhcp.hostname("ambient-lighting-clock");
dhcp.requestOption(DHCP_TIME_SERVERS);
dhcp.begin();
WiFi.begin(ssid, password);