From af832c44d11c08610a59fbe267a97a223bae6eab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniele=20Vigan=C3=B2?= Date: Sat, 9 Sep 2023 13:06:13 +0200 Subject: [PATCH] Update ESP32 and Arduino examples --- arduino/tempLightSensor/tempLightSensor.ino | 8 ++++---- esp32/rssiHall/rssiHall.ino | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/arduino/tempLightSensor/tempLightSensor.ino b/arduino/tempLightSensor/tempLightSensor.ino index 5891ca1..63c6d8a 100644 --- a/arduino/tempLightSensor/tempLightSensor.ino +++ b/arduino/tempLightSensor/tempLightSensor.ino @@ -55,7 +55,7 @@ struct netConfig { } config; char serial[9]; -const String apiURL = "/api/device/subscribe/"; +const String dpsURL = "/dps/device/subscribe/"; const String telemetryURL = "/telemetry/"; void setup(void) { @@ -63,7 +63,7 @@ void setup(void) { analogReference(EXTERNAL); - StaticJsonDocument<20> api; + StaticJsonDocument<20> dps; byte mac[6]; int eeAddress = 0; @@ -110,8 +110,8 @@ void setup(void) { Serial.println("DEBUG: clock updated via NTP."); #endif - api["serial"] = serial; - postData(config, apiURL, api); + dps["serial"] = serial; + postData(config, dpsURL, dps); telemetry["device"] = serial; // payload["id"] = serverName; diff --git a/esp32/rssiHall/rssiHall.ino b/esp32/rssiHall/rssiHall.ino index 8059ddb..378418a 100644 --- a/esp32/rssiHall/rssiHall.ino +++ b/esp32/rssiHall/rssiHall.ino @@ -55,13 +55,13 @@ struct netConfig { } config; char* serial; -const String apiURL = "/api/device/subscribe/"; +const String dpsURL = "/dps/device/subscribe/"; const String telemetryURL = "/telemetry/"; void setup(void) { Serial.begin(115200); - StaticJsonDocument<64> api; + StaticJsonDocument<64> dps; preferences.begin("iot"); // Get the serial number from flash @@ -117,8 +117,8 @@ void setup(void) { Serial.println("DEBUG: clock updated via NTP."); #endif - api["serial"] = serial; - postData(config, apiURL, api); + dps["serial"] = serial; + postData(config, dpsURL, dps); telemetry["device"] = serial; // payload["id"] = serverName;