mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-07-29 00:17: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:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user