From 3dfe573cd34333e4d1848eec0df3e2ee2f53dc92 Mon Sep 17 00:00:00 2001 From: pennam Date: Thu, 2 May 2024 17:12:10 +0200 Subject: [PATCH 1/2] TimeService: do no use NTP if we are using cellular connection --- src/utility/time/TimeService.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/utility/time/TimeService.cpp b/src/utility/time/TimeService.cpp index 05290b21..5bf081de 100644 --- a/src/utility/time/TimeService.cpp +++ b/src/utility/time/TimeService.cpp @@ -292,9 +292,11 @@ unsigned long TimeServiceClass::getRemoteTime() * This is the most reliable time source and it will * ensure a correct behaviour of the library. */ - unsigned long const ntp_time = NTPUtils::getTime(_con_hdl->getUDP()); - if(isTimeValid(ntp_time)) { - return ntp_time; + if(_con_hdl->getInterface() != NetworkAdapter::CELL) { + unsigned long const ntp_time = NTPUtils::getTime(_con_hdl->getUDP()); + if(isTimeValid(ntp_time)) { + return ntp_time; + } } /* As fallback if NTP request fails try to obtain the From f9c4543ea7172100850fe79c99db4fa1a1a84645 Mon Sep 17 00:00:00 2001 From: pennam Date: Mon, 10 Jun 2024 10:25:04 +0200 Subject: [PATCH 2/2] CI: add Arduino_Cellular dependency --- .github/workflows/compile-examples.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/compile-examples.yml b/.github/workflows/compile-examples.yml index a4e68ab0..4e286b9f 100644 --- a/.github/workflows/compile-examples.yml +++ b/.github/workflows/compile-examples.yml @@ -170,6 +170,7 @@ jobs: - name: arduino:mbed_portenta libraries: | - name: ArduinoECCX08 + - name: Arduino_Cellular sketch-paths: | - examples/ArduinoIoTCloud-DeferredOTA - examples/utility/Provisioning @@ -211,6 +212,8 @@ jobs: platforms: | # Install renesas_portenta platform via Boards Manager - name: arduino:renesas_portenta + libraries: | + - name: Arduino_Cellular sketch-paths: | - examples/utility/Provisioning # UNO R4 WiFi