From 145c612867ba4de2691355831f89c5b995541ac9 Mon Sep 17 00:00:00 2001 From: samuelbles07 Date: Mon, 31 Mar 2025 13:53:56 +0700 Subject: [PATCH] Enable cellular at debug when registering network On boot, airgradient-client change cellular init timeout to 5 mins --- .gitignore | 2 ++ examples/OneOpenAir/OneOpenAir.ino | 12 ++++++++++++ src/Libraries/airgradient-client | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 82085f6..c9a020a 100644 --- a/.gitignore +++ b/.gitignore @@ -4,5 +4,7 @@ build /.idea/ .pio .cache +.clangd logs +gen_compile_commands.py compile_commands.json diff --git a/examples/OneOpenAir/OneOpenAir.ino b/examples/OneOpenAir/OneOpenAir.ino index 82123fe..8f13a6a 100644 --- a/examples/OneOpenAir/OneOpenAir.ino +++ b/examples/OneOpenAir/OneOpenAir.ino @@ -934,6 +934,11 @@ void initializeNetwork() { networkOption = UseWifi; } + if (networkOption == UseCellular) { + // Enable serial stream debugging to check the AT command when doing registration + agSerial->setDebug(true); + } + if (!agClient->begin(ag->deviceId().c_str())) { oledDisplay.setText("Client", "initialization", "failed"); delay(5000); @@ -943,6 +948,11 @@ void initializeNetwork() { ESP.restart(); } + if (networkOption == UseCellular) { + // Disabling it again + agSerial->setDebug(false); + } + if (networkOption == UseWifi) { if (!wifiConnector.connect()) { Serial.println("Cannot initiate wifi connection"); @@ -1495,11 +1505,13 @@ void networkingTask(void *args) { else if (networkOption == UseCellular) { if (agClient->isClientReady() == false) { Serial.println("Cellular client not ready, ensuring connection..."); + agSerial->setDebug(true); if (agClient->ensureClientConnection() == false) { Serial.println("Cellular client connection not ready, retry in 5s..."); delay(5000); continue; } + agSerial->setDebug(false); } } diff --git a/src/Libraries/airgradient-client b/src/Libraries/airgradient-client index 774f8b7..f4c503e 160000 --- a/src/Libraries/airgradient-client +++ b/src/Libraries/airgradient-client @@ -1 +1 @@ -Subproject commit 774f8b70e68a6c867d72d7a8ed2d6b12354cb9bd +Subproject commit f4c503ee2f644d36e496f57c3487f6e87ec70597