Compare commits

...

15 Commits

Author SHA1 Message Date
9ed58d1853 Prepare release 3.3.2 2025-03-31 17:12:15 +07:00
6c52b038e9 Merge pull request #295 from airgradienthq/feat/enable-at-debug
Enable cellular AT command debug when in network registration
2025-03-31 17:09:43 +07:00
2f69932ef7 add depth submodule update 2025-03-31 17:04:37 +07:00
1d96a274a6 Merge branch 'develop' into feat/enable-at-debug 2025-03-31 16:55:12 +07:00
df9f6dfc95 Fix bugs from 3.3.1 release 2025-03-31 16:52:09 +07:00
3fc02b3f54 Check signal when initialize cellular client 2025-03-31 16:51:29 +07:00
958ed0bd80 Fix TVOC and NOx payload position 2025-03-31 15:26:34 +07:00
e9be9dcc83 Fix mqtt host still exist on local when on server is disabled 2025-03-31 14:51:53 +07:00
7fbab82088 Change log level when correction not found 2025-03-31 14:07:30 +07:00
decdecdf22 Don't start mqtt when network option is cellular
Even when mqtt host is set
2025-03-31 14:01:49 +07:00
145c612867 Enable cellular at debug when registering network
On boot, airgradient-client change cellular init timeout to 5 mins
2025-03-31 13:53:56 +07:00
37de127887 prepare 3.3.1 release 2025-03-28 14:37:08 +07:00
baf80ce250 untrack compile_commands.json 2025-03-28 14:24:13 +07:00
80100e2475 prepare 3.3.0 release 2025-03-28 14:13:40 +07:00
d9c3fc6ec4 Merge pull request #292 from airgradienthq/feat/cellular
Add cellular connection as network options for AirGradient ONE and Open Air
2025-03-28 13:55:17 +07:00
9 changed files with 38 additions and 1608 deletions

View File

@ -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
View File

@ -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

View File

@ -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);
}
}

View File

@ -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.

View File

@ -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");

View File

@ -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();
}

View File

@ -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