mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-06-28 01:00:59 +02:00
Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
9fb01d42f4 | |||
7bb013939c | |||
0da21155e7 | |||
7a153cc0ea | |||
b079c35e6b | |||
6051e183b8 | |||
c95379b957 | |||
0cae8bc185 | |||
5902a4c8e4 |
@ -117,6 +117,7 @@ static uint32_t factoryBtnPressTime = 0;
|
|||||||
static AgFirmwareMode fwMode = FW_MODE_I_9PSL;
|
static AgFirmwareMode fwMode = FW_MODE_I_9PSL;
|
||||||
static bool ledBarButtonTest = false;
|
static bool ledBarButtonTest = false;
|
||||||
static String fwNewVersion;
|
static String fwNewVersion;
|
||||||
|
static int lastCellSignalQuality = 99; // CSQ
|
||||||
|
|
||||||
SemaphoreHandle_t mutexMeasurementCycleQueue;
|
SemaphoreHandle_t mutexMeasurementCycleQueue;
|
||||||
static std::vector<Measurements::Measures> measurementCycleQueue;
|
static std::vector<Measurements::Measures> measurementCycleQueue;
|
||||||
@ -1475,14 +1476,20 @@ void networkSignalCheck() {
|
|||||||
auto result = cell->retrieveSignal();
|
auto result = cell->retrieveSignal();
|
||||||
if (result.status != CellReturnStatus::Ok) {
|
if (result.status != CellReturnStatus::Ok) {
|
||||||
agClient->setClientReady(false);
|
agClient->setClientReady(false);
|
||||||
|
lastCellSignalQuality = 99;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Save last signal quality
|
||||||
|
lastCellSignalQuality = result.data;
|
||||||
|
|
||||||
if (result.data == 99) {
|
if (result.data == 99) {
|
||||||
// 99 indicate cellular not attached to network
|
// 99 indicate cellular not attached to network
|
||||||
agClient->setClientReady(false);
|
agClient->setClientReady(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Serial.printf("Cellular signal strength %d\n", result.data);
|
|
||||||
|
Serial.printf("Cellular signal quality %d\n", result.data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1501,6 +1508,7 @@ void networkingTask(void *args) {
|
|||||||
if (networkOption == UseCellular) {
|
if (networkOption == UseCellular) {
|
||||||
Serial.println("Prepare first measures cycle to send on boot for 20s");
|
Serial.println("Prepare first measures cycle to send on boot for 20s");
|
||||||
delay(20000);
|
delay(20000);
|
||||||
|
networkSignalCheck();
|
||||||
newMeasurementCycle();
|
newMeasurementCycle();
|
||||||
sendDataToServer();
|
sendDataToServer();
|
||||||
measurementSchedule.update();
|
measurementSchedule.update();
|
||||||
@ -1558,7 +1566,10 @@ void newMeasurementCycle() {
|
|||||||
measurementCycleQueue.erase(measurementCycleQueue.begin());
|
measurementCycleQueue.erase(measurementCycleQueue.begin());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Get current measures
|
||||||
auto mc = measurements.getMeasures();
|
auto mc = measurements.getMeasures();
|
||||||
|
mc.signal = cell->csqToDbm(lastCellSignalQuality); // convert to RSSI
|
||||||
|
|
||||||
measurementCycleQueue.push_back(mc);
|
measurementCycleQueue.push_back(mc);
|
||||||
Serial.println("New measurement cycle added to queue");
|
Serial.println("New measurement cycle added to queue");
|
||||||
// Release mutex
|
// Release mutex
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name=AirGradient Air Quality Sensor
|
name=AirGradient Air Quality Sensor
|
||||||
version=3.3.3
|
version=3.3.4
|
||||||
author=AirGradient <support@airgradient.com>
|
author=AirGradient <support@airgradient.com>
|
||||||
maintainer=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.
|
sentence=ESP32-C3 / ESP8266 library for air quality monitor measuring PM, CO2, Temperature, TVOC and Humidity with OLED display.
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
platform = espressif32
|
platform = espressif32
|
||||||
board = esp32-c3-devkitm-1
|
board = esp32-c3-devkitm-1
|
||||||
framework = arduino
|
framework = arduino
|
||||||
build_flags = !echo '-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 -D CORE_DEBUG_LEVEL=3 -D GIT_VERSION=\\"'$(git describe --tags --always --dirty)'\\"'
|
build_flags = !echo '-D ARDUINO_USB_CDC_ON_BOOT=1 -D ARDUINO_USB_MODE=1 -D AG_LOG_LEVEL=AG_LOG_LEVEL_INFO -D GIT_VERSION=\\"'$(git describe --tags --always --dirty)'\\"'
|
||||||
board_build.partitions = partitions.csv
|
board_build.partitions = partitions.csv
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
lib_deps =
|
lib_deps =
|
||||||
|
@ -827,6 +827,12 @@ std::string Measurements::buildMeasuresPayload(Measures &mc) {
|
|||||||
oss << std::round(mc.pm_03_pc[1]);
|
oss << std::round(mc.pm_03_pc[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
oss << ",";
|
||||||
|
|
||||||
|
if (mc.signal < 0) {
|
||||||
|
oss << mc.signal;
|
||||||
|
}
|
||||||
|
|
||||||
return oss.str();
|
return oss.str();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#include "Main/utils.h"
|
#include "Main/utils.h"
|
||||||
|
|
||||||
#ifndef GIT_VERSION
|
#ifndef GIT_VERSION
|
||||||
#define GIT_VERSION "3.3.3-snap"
|
#define GIT_VERSION "3.3.4-snap"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
Submodule src/Libraries/airgradient-client updated: 30e9807671...d24b369604
Submodule src/Libraries/airgradient-ota updated: 24d2dc537c...fde4380164
Reference in New Issue
Block a user