Skip to content

Commit 3e8d1f0

Browse files
authored
Merge pull request #58 from RLeclair/raulleclair/delayfix
Adding pnp set telemetry call to samples.
2 parents aefe104 + 5aadc55 commit 3e8d1f0

File tree

8 files changed

+15
-4
lines changed

8 files changed

+15
-4
lines changed

examples/Azure_IoT_Central_Arduino_Nano_RP2040_Connect/Azure_IoT_Central_Arduino_Nano_RP2040_Connect.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,7 @@ void setup()
354354
ArduinoBearSSL.onGetTime(get_time); // Required for server trusted root validation.
355355

356356
azure_pnp_init();
357+
azure_pnp_set_telemetry_frequency(TELEMETRY_FREQUENCY_IN_SECONDS);
357358

358359
/*
359360
* The configuration structure used by Azure IoT must remain unchanged (including data buffer)

examples/Azure_IoT_Central_Arduino_Nano_RP2040_Connect/iot_configs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
// After that, the sample automatically generates a new password and re-connects.
1919
#define IOT_CONFIG_MQTT_PASSWORD_LIFETIME_IN_MINUTES 60
2020

21+
// Publish 1 message every 10 seconds.
22+
#define TELEMETRY_FREQUENCY_IN_SECONDS 10
23+
2124
// Time Zone Offset
2225
#define IOT_CONFIG_TIME_ZONE -8
2326
#define IOT_CONFIG_TIME_ZONE_DAYLIGHT_SAVINGS_DIFF 1

examples/Azure_IoT_Central_Arduino_Portenta_H7/Azure_IoT_Central_Arduino_Portenta_H7.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@ void setup()
356356
ArduinoBearSSL.onGetTime(get_time); // Required for server trusted root validation.
357357

358358
azure_pnp_init();
359+
azure_pnp_set_telemetry_frequency(TELEMETRY_FREQUENCY_IN_SECONDS);
360+
359361
/*
360362
* The configuration structure used by Azure IoT must remain unchanged (including data buffer)
361363
* throughout the lifetime of the sample. This variable must also not lose context so other

examples/Azure_IoT_Central_Arduino_Portenta_H7/iot_configs.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
// After that, the sample automatically generates a new password and re-connects.
1919
#define IOT_CONFIG_MQTT_PASSWORD_LIFETIME_IN_MINUTES 60
2020

21+
// Publish 1 message every 10 seconds.
22+
#define TELEMETRY_FREQUENCY_IN_SECONDS 10
23+
2124
// Time Zone Offset
2225
#define IOT_CONFIG_TIME_ZONE -8
2326
#define IOT_CONFIG_TIME_ZONE_DAYLIGHT_SAVINGS_DIFF 1

examples/Azure_IoT_Central_ESP32/Azure_IoT_Central_ESP32.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,7 @@ void setup()
400400
sync_device_clock_with_ntp_server();
401401

402402
azure_pnp_init();
403+
azure_pnp_set_telemetry_frequency(TELEMETRY_FREQUENCY_IN_SECONDS);
403404

404405
configure_azure_iot();
405406
azure_iot_start(&azure_iot);

examples/Azure_IoT_Central_ESP32/iot_configs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
// please update the suffix with the format '(ard;<platform>)' as an url-encoded string.
6666
#define AZURE_SDK_CLIENT_USER_AGENT "c%2F" AZ_SDK_VERSION_STRING "(ard%3Besp32)"
6767

68-
// Publish 1 message every 2 seconds.
69-
#define TELEMETRY_FREQUENCY_IN_SECONDS 2
68+
// Publish 1 message every 10 seconds.
69+
#define TELEMETRY_FREQUENCY_IN_SECONDS 10
7070

7171
// For how long the MQTT password (SAS token) is valid, in minutes.
7272
// After that, the sample automatically generates a new password and re-connects.

examples/Azure_IoT_Central_ESP32_AzureIoTKit/Azure_IoT_Central_ESP32_AzureIoTKit.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ void setup()
361361
sync_device_clock_with_ntp_server();
362362

363363
azure_pnp_init();
364+
azure_pnp_set_telemetry_frequency(TELEMETRY_FREQUENCY_IN_SECONDS);
364365

365366
/*
366367
* The configuration structure used by Azure IoT must remain unchanged (including data buffer)

examples/Azure_IoT_Central_ESP32_AzureIoTKit/iot_configs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@
6565
// please update the suffix with the format '(ard;<platform>)' as an url-encoded string.
6666
#define AZURE_SDK_CLIENT_USER_AGENT "c%2F" AZ_SDK_VERSION_STRING "(ard%3Besp32)"
6767

68-
// Publish 1 message every 2 seconds.
69-
#define TELEMETRY_FREQUENCY_IN_SECONDS 2
68+
// Publish 1 message every 10 seconds.
69+
#define TELEMETRY_FREQUENCY_IN_SECONDS 10
7070

7171
// For how long the MQTT password (SAS token) is valid, in minutes.
7272
// After that, the sample automatically generates a new password and re-connects.

0 commit comments

Comments
 (0)