mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-30 17:07:16 +02:00
Enable cellular at debug when registering network
On boot, airgradient-client change cellular init timeout to 5 mins
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -4,5 +4,7 @@ build
|
|||||||
/.idea/
|
/.idea/
|
||||||
.pio
|
.pio
|
||||||
.cache
|
.cache
|
||||||
|
.clangd
|
||||||
logs
|
logs
|
||||||
|
gen_compile_commands.py
|
||||||
compile_commands.json
|
compile_commands.json
|
||||||
|
@ -934,6 +934,11 @@ void initializeNetwork() {
|
|||||||
networkOption = UseWifi;
|
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())) {
|
if (!agClient->begin(ag->deviceId().c_str())) {
|
||||||
oledDisplay.setText("Client", "initialization", "failed");
|
oledDisplay.setText("Client", "initialization", "failed");
|
||||||
delay(5000);
|
delay(5000);
|
||||||
@ -943,6 +948,11 @@ void initializeNetwork() {
|
|||||||
ESP.restart();
|
ESP.restart();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (networkOption == UseCellular) {
|
||||||
|
// Disabling it again
|
||||||
|
agSerial->setDebug(false);
|
||||||
|
}
|
||||||
|
|
||||||
if (networkOption == UseWifi) {
|
if (networkOption == UseWifi) {
|
||||||
if (!wifiConnector.connect()) {
|
if (!wifiConnector.connect()) {
|
||||||
Serial.println("Cannot initiate wifi connection");
|
Serial.println("Cannot initiate wifi connection");
|
||||||
@ -1495,11 +1505,13 @@ void networkingTask(void *args) {
|
|||||||
else if (networkOption == UseCellular) {
|
else if (networkOption == UseCellular) {
|
||||||
if (agClient->isClientReady() == false) {
|
if (agClient->isClientReady() == false) {
|
||||||
Serial.println("Cellular client not ready, ensuring connection...");
|
Serial.println("Cellular client not ready, ensuring connection...");
|
||||||
|
agSerial->setDebug(true);
|
||||||
if (agClient->ensureClientConnection() == false) {
|
if (agClient->ensureClientConnection() == false) {
|
||||||
Serial.println("Cellular client connection not ready, retry in 5s...");
|
Serial.println("Cellular client connection not ready, retry in 5s...");
|
||||||
delay(5000);
|
delay(5000);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
agSerial->setDebug(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Submodule src/Libraries/airgradient-client updated: 774f8b70e6...f4c503ee2f
Reference in New Issue
Block a user