Skip to content
This repository was archived by the owner on Jan 6, 2023. It is now read-only.

Commit 47f2126

Browse files
committed
Moves ESP8266 NTP configuration to header
1 parent e69ba0d commit 47f2126

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

examples/Esp8266-lwmqtt/ciotc_config.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ const char* project_id = "project-id";
2323
const char* location = "us-central1";
2424
const char* registry_id = "my-registry";
2525
const char* device_id = "my-device";
26+
27+
// Configuration for NTP
28+
const char* ntp_primary = "pool.ntp.org";
29+
const char* ntp_secondary = "time.nist.gov";
30+
2631
// To get the private key run (where private-key.pem is the ec private key
2732
// used to create the certificate uploaded to google cloud iot):
2833
// openssl ec -in <private-key.pem> -noout -text

examples/Esp8266-lwmqtt/esp8266_mqtt.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ void setupWifi() {
8787
delay(100);
8888
}
8989

90-
configTime(0, 0, "pool.ntp.org", "time.nist.gov");
90+
configTime(0, 0, ntp_primary, ntp_secondary);
9191
Serial.println("Waiting on time sync...");
9292
while (time(nullptr) < 1510644967) {
9393
delay(10);

0 commit comments

Comments
 (0)