mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-06-26 16:21:33 +02:00
Compare commits
15 Commits
feat/cellu
...
3.3.2
Author | SHA1 | Date | |
---|---|---|---|
9ed58d1853 | |||
6c52b038e9 | |||
2f69932ef7 | |||
1d96a274a6 | |||
df9f6dfc95 | |||
3fc02b3f54 | |||
958ed0bd80 | |||
e9be9dcc83 | |||
7fbab82088 | |||
decdecdf22 | |||
145c612867 | |||
37de127887 | |||
baf80ce250 | |||
80100e2475 | |||
d9c3fc6ec4 |
1
.github/workflows/check.yml
vendored
1
.github/workflows/check.yml
vendored
@ -38,6 +38,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: 'true'
|
||||
- uses: arduino/compile-sketches@v1.1.2
|
||||
with:
|
||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -4,5 +4,7 @@ build
|
||||
/.idea/
|
||||
.pio
|
||||
.cache
|
||||
.clangd
|
||||
logs
|
||||
|
||||
gen_compile_commands.py
|
||||
compile_commands.json
|
||||
|
File diff suppressed because one or more lines are too long
@ -423,6 +423,11 @@ static void initMqtt(void) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (networkOption == UseCellular) {
|
||||
Serial.println("MQTT not available for cellular options");
|
||||
return;
|
||||
}
|
||||
|
||||
if (mqttClient.begin(mqttUri)) {
|
||||
Serial.println("Successfully connected to MQTT broker");
|
||||
createMqttTask();
|
||||
@ -934,6 +939,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 +953,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 +1510,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);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=AirGradient Air Quality Sensor
|
||||
version=3.2.0
|
||||
version=3.3.2
|
||||
author=AirGradient <support@airgradient.com>
|
||||
maintainer=AirGradient <support@airgradient.com>
|
||||
sentence=ESP32-C3 / ESP8266 library for air quality monitor measuring PM, CO2, Temperature, TVOC and Humidity with OLED display.
|
||||
|
@ -240,7 +240,7 @@ bool Configuration::updateTempHumCorrection(JSONVar &json, TempHumCorrection &ta
|
||||
|
||||
JSONVar corrections = json[jprop_corrections];
|
||||
if (!corrections.hasOwnProperty(correctionName)) {
|
||||
logWarning(String(correctionName) + " correction field not found on configuration");
|
||||
logInfo(String(correctionName) + " correction field not found on configuration");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -739,7 +739,13 @@ bool Configuration::parse(String data, bool isLocal) {
|
||||
jsonInvalid();
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else if (JSON.typeof_(root[jprop_mqttBrokerUrl]) == "null" and !isLocal) {
|
||||
// So if its not available on the json and json comes from aigradient server
|
||||
// then set its value to default (empty)
|
||||
jconfig[jprop_mqttBrokerUrl] = jprop_mqttBrokerUrl_default;
|
||||
}
|
||||
else {
|
||||
if (jsonTypeInvalid(root[jprop_mqttBrokerUrl], "string")) {
|
||||
failedMessage =
|
||||
jsonTypeInvalidMessage(String(jprop_mqttBrokerUrl), "string");
|
||||
|
@ -804,16 +804,16 @@ std::string Measurements::buildMeasuresPayload(Measures &mc) {
|
||||
|
||||
oss << ",";
|
||||
|
||||
// NOx
|
||||
if (utils::isValidNOx(mc.nox)) {
|
||||
oss << std::round(mc.nox);
|
||||
// TVOC
|
||||
if (utils::isValidVOC(mc.tvoc)) {
|
||||
oss << std::round(mc.tvoc);
|
||||
}
|
||||
|
||||
oss << ",";
|
||||
|
||||
// TVOC
|
||||
if (utils::isValidVOC(mc.tvoc)) {
|
||||
oss << std::round(mc.tvoc);
|
||||
// NOx
|
||||
if (utils::isValidNOx(mc.nox)) {
|
||||
oss << std::round(mc.nox);
|
||||
}
|
||||
|
||||
oss << ",";
|
||||
@ -827,10 +827,6 @@ std::string Measurements::buildMeasuresPayload(Measures &mc) {
|
||||
oss << std::round(mc.pm_03_pc[1]);
|
||||
}
|
||||
|
||||
// char datapoint[128] = {0};
|
||||
// snprintf(datapoint, 128, "%d,%.0f,%.0f,%.0f,%.0f,%.0f,%d,%d,%d", co2, temp * 10,
|
||||
// hum * 10, pm01 * 10, pm25 * 10, pm10 * 10, tvoc, nox, pm003Count);
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
#include "Main/utils.h"
|
||||
|
||||
#ifndef GIT_VERSION
|
||||
#define GIT_VERSION "3.2.0-snap"
|
||||
#define GIT_VERSION "3.3.2-snap"
|
||||
#endif
|
||||
|
||||
|
||||
|
Submodule src/Libraries/airgradient-client updated: 774f8b70e6...938a92830d
Reference in New Issue
Block a user