mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-12-18 03:28:29 +01:00
Compare commits
1 Commits
develop
...
feat/ce-co
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
844674d8ee |
@@ -998,7 +998,7 @@ void initializeNetwork() {
|
|||||||
delay(2500);
|
delay(2500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!agClient->begin(ag->deviceId().c_str())) {
|
if (!agClient->begin(ag->deviceId().c_str(), AirgradientClient::ONE_OPENAIR)) {
|
||||||
oledDisplay.setText("Client", "initialization", "failed");
|
oledDisplay.setText("Client", "initialization", "failed");
|
||||||
delay(5000);
|
delay(5000);
|
||||||
oledDisplay.showRebooting();
|
oledDisplay.showRebooting();
|
||||||
@@ -1057,7 +1057,7 @@ void initializeNetwork() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string config = agClient->httpFetchConfig();
|
std::string config = agClient->coapFetchConfig();
|
||||||
configSchedule.update();
|
configSchedule.update();
|
||||||
// Check if fetch configuration failed or fetch succes but parsing failed
|
// Check if fetch configuration failed or fetch succes but parsing failed
|
||||||
if (agClient->isLastFetchConfigSucceed() == false ||
|
if (agClient->isLastFetchConfigSucceed() == false ||
|
||||||
@@ -1086,7 +1086,7 @@ static void configurationUpdateSchedule(void) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string config = agClient->httpFetchConfig();
|
std::string config = agClient->coapFetchConfig();
|
||||||
if (agClient->isLastFetchConfigSucceed()) {
|
if (agClient->isLastFetchConfigSucceed()) {
|
||||||
configuration.parse(config.c_str(), false);
|
configuration.parse(config.c_str(), false);
|
||||||
}
|
}
|
||||||
@@ -1428,7 +1428,7 @@ void postUsingCellular(bool forcePost) {
|
|||||||
xSemaphoreGive(mutexMeasurementCycleQueue);
|
xSemaphoreGive(mutexMeasurementCycleQueue);
|
||||||
|
|
||||||
// Attempt to send
|
// Attempt to send
|
||||||
if (agClient->httpPostMeasures(payload, extendPmMeasures) == false) {
|
if (agClient->coapPostMeasures(payload) == false) {
|
||||||
// Consider network has a problem, retry in next schedule
|
// Consider network has a problem, retry in next schedule
|
||||||
Serial.println("Post measures failed, retry in next schedule");
|
Serial.println("Post measures failed, retry in next schedule");
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -953,13 +953,7 @@ bool Configuration::parse(String data, bool isLocal) {
|
|||||||
String(value ? "true" : "false"));
|
String(value ? "true" : "false"));
|
||||||
jconfig[jprop_extendedPmMeasures] = value;
|
jconfig[jprop_extendedPmMeasures] = value;
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else if (JSON.typeof_(root[jprop_extendedPmMeasures]) == "null" and !isLocal) {
|
|
||||||
// So if its not available on the json and json comes from aigradient server
|
|
||||||
// then set its value to default (false)
|
|
||||||
jconfig[jprop_extendedPmMeasures] = jprop_extendedPmMeasures_default;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (jsonTypeInvalid(root[jprop_extendedPmMeasures], "boolean")) {
|
if (jsonTypeInvalid(root[jprop_extendedPmMeasures], "boolean")) {
|
||||||
failedMessage = jsonTypeInvalidMessage(
|
failedMessage = jsonTypeInvalidMessage(
|
||||||
String(jprop_extendedPmMeasures), "boolean");
|
String(jprop_extendedPmMeasures), "boolean");
|
||||||
|
|||||||
Submodule src/Libraries/airgradient-client updated: 0a2ff8abbb...3a37795565
Reference in New Issue
Block a user