mirror of
https://github.com/airgradienthq/arduino.git
synced 2025-12-17 19:18:27 +01:00
Compare commits
39 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
23f8c383fd | ||
|
|
c0ad1dbfad | ||
|
|
75be7d9fc5 | ||
|
|
309d322100 | ||
|
|
89ebe6c39f | ||
|
|
29db5469f5 | ||
|
|
5802cf17f6 | ||
|
|
4a4ce89f00 | ||
|
|
8985e08a00 | ||
|
|
e984aced18 | ||
|
|
73edf56c97 | ||
|
|
e54c62a2ef | ||
|
|
5c95f011e4 | ||
|
|
bed448e7d6 | ||
|
|
eb8378adfa | ||
|
|
f94ed5c5f5 | ||
|
|
9471f3e323 | ||
|
|
e6d90372c2 | ||
|
|
fabf0550fc | ||
|
|
ce0af5bf60 | ||
|
|
93bdbd85d5 | ||
|
|
29f583f20d | ||
|
|
0f6a2fe908 | ||
|
|
e3ce2c41be | ||
|
|
92b3c69b98 | ||
|
|
f4d518aa87 | ||
|
|
831c844c24 | ||
|
|
060a7f6815 | ||
|
|
d8eb6b3c1a | ||
|
|
77859bea22 | ||
|
|
969858b5cb | ||
|
|
09b5805686 | ||
|
|
b09b753339 | ||
|
|
ddb3dba131 | ||
|
|
e780b0ace6 | ||
|
|
e82da5401e | ||
|
|
50a98acde4 | ||
|
|
21b9ddb2ed | ||
|
|
1ee05da5d1 |
31
.github/workflows/check.yml
vendored
31
.github/workflows/check.yml
vendored
@@ -1,5 +1,36 @@
|
|||||||
on: [push, pull_request]
|
on: [push, pull_request]
|
||||||
jobs:
|
jobs:
|
||||||
|
trailing-whitespace:
|
||||||
|
runs-on: ubuntu-24.04
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4.2.2
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: Check for trailing whitespace
|
||||||
|
run: |
|
||||||
|
set -u
|
||||||
|
|
||||||
|
# Don't enforce checks on vendored libraries.
|
||||||
|
readonly EXCLUDED_DIR='src/Libraries'
|
||||||
|
|
||||||
|
has_trailing_whitespace=false
|
||||||
|
|
||||||
|
while read -r line; do
|
||||||
|
if grep \
|
||||||
|
"\s$" \
|
||||||
|
--line-number \
|
||||||
|
--with-filename \
|
||||||
|
--binary-files=without-match \
|
||||||
|
"${line}"; then
|
||||||
|
has_trailing_whitespace=true
|
||||||
|
fi
|
||||||
|
done < <(git ls-files | grep --invert-match "^${EXCLUDED_DIR}/")
|
||||||
|
|
||||||
|
if [ "$has_trailing_whitespace" = true ]; then
|
||||||
|
echo "ERROR: Found trailing whitespace"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
compile:
|
compile:
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
|||||||
23
README.md
23
README.md
@@ -20,13 +20,32 @@ Make sure you have exactly the versions of libraries and boards installed as des
|
|||||||
|
|
||||||
If you have an older version of the AirGradient PCB not mentioned in the example files, please downgrade this library to version 2.4.15 to support these legacy boards.
|
If you have an older version of the AirGradient PCB not mentioned in the example files, please downgrade this library to version 2.4.15 to support these legacy boards.
|
||||||
|
|
||||||
|
### Release Process
|
||||||
|
|
||||||
|
Releases published on GitHub are **not immediately deployed to all devices in the market**. Each release first goes through internal testing, including limited deployments in select locations to verify stability and functionality.
|
||||||
|
|
||||||
|
If the tests pass, the firmware is then made available for:
|
||||||
|
- **FOTA (Firmware Over-The-Air) updates** from AirGradient dashboard
|
||||||
|
- **Manual flashing** via [Airgradient](https://www.airgradient.com/documentation/firmwares/) website
|
||||||
|
|
||||||
|
Each GitHub release note will also include the planned rollout date for wider availability.
|
||||||
|
|
||||||
## Help & Support
|
## Help & Support
|
||||||
|
|
||||||
If you have any questions or problems, check out [our forum](https://forum.airgradient.com/).
|
If you have any questions or problems, check out [our forum](https://forum.airgradient.com/).
|
||||||
|
|
||||||
## Documentation
|
## Development
|
||||||
|
|
||||||
Local server API documentation is available in [/docs/local-server.md](/docs/local-server.md) and AirGradient server API on [https://api.airgradient.com/public/docs/api/v1/](https://api.airgradient.com/public/docs/api/v1/).
|
* See [compilation instructions](/docs/howto-compile.md) for details about how to customize AirGradient's firmware and flash it to your device.
|
||||||
|
|
||||||
|
## Over the air (OTA) updates
|
||||||
|
|
||||||
|
* See the [OTA Updates documentation](/docs/ota-updates.md) for details about how AirGradient monitors receive over the air updates.
|
||||||
|
|
||||||
|
## API documentation
|
||||||
|
|
||||||
|
* [Local server API documentation](/docs/local-server.md)
|
||||||
|
* [AirGradient Cloud server API documentation](https://api.airgradient.com/public/docs/api/v1/).
|
||||||
|
|
||||||
## The following libraries have been integrated into this library for ease of use
|
## The following libraries have been integrated into this library for ease of use
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ Choose based on how python installed on your machine. But most user, using `apt`
|
|||||||
|
|
||||||
## How to contribute
|
## How to contribute
|
||||||
|
|
||||||
The instructions above are the instructions for how to build an official release of the AirGradient firmware using the Arduino IDE. If you intend to make changes that will you intent to contribute back to the main project, instead of installing the AirGradient library, check out the repo at `Documents/Arduino/libraries` (for Windows and Mac), or `~/Arduino/Libraries` (Linux). If you installed the library, you can remove it from the library manager in the Arduino IDE, or just delete the directory.
|
The instructions above are the instructions for how to build an official release of the AirGradient firmware using the Arduino IDE. If you intend to make changes which you plan to contribute back to the main project, instead of installing the AirGradient library, check out the repository at Documents/Arduino/libraries (for Windows and Mac) or ~/Arduino/libraries (for Linux). If you installed the library, you can remove it from the library manager in the Arduino IDE, or just delete the directory.
|
||||||
|
|
||||||
**NOTE:** When cloning the repository, for version >= 3.3.0 it has submodule, please use `--recursive` flag like this: `git clone --recursive https://github.com/airgradienthq/arduino.git AirGradient_Air_Quality_Sensor`
|
**NOTE:** When cloning the repository, for version >= 3.3.0 it has submodule, please use `--recursive` flag like this: `git clone --recursive https://github.com/airgradienthq/arduino.git AirGradient_Air_Quality_Sensor`
|
||||||
|
|
||||||
@@ -100,6 +100,3 @@ There are 2 environment options to compile this project, PlatformIO and ArduinoI
|
|||||||
|
|
||||||
- For PlatformIO, it should work out of the box
|
- For PlatformIO, it should work out of the box
|
||||||
- For arduino, files in `src` folder and also from `Examples` can be modified at `Documents/Arduino/libraries` for Windows and Mac, and `~/Arduino/Libraries` for Linux
|
- For arduino, files in `src` folder and also from `Examples` can be modified at `Documents/Arduino/libraries` for Windows and Mac, and `~/Arduino/Libraries` for Linux
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -109,7 +109,6 @@ Compensated values apply correction algorithms to make the sensor values more ac
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Set Configuration Parameters (PUT)
|
### Set Configuration Parameters (PUT)
|
||||||
|
|||||||
@@ -294,7 +294,7 @@ static bool sgp41Init(void) {
|
|||||||
configuration.hasSensorSGP = true;
|
configuration.hasSensorSGP = true;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Serial.println("Init SGP41 failuire");
|
Serial.println("Init SGP41 failure");
|
||||||
configuration.hasSensorSGP = false;
|
configuration.hasSensorSGP = false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -351,7 +351,7 @@ static bool sgp41Init(void) {
|
|||||||
configuration.hasSensorSGP = true;
|
configuration.hasSensorSGP = true;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Serial.println("Init SGP41 failuire");
|
Serial.println("Init SGP41 failure");
|
||||||
configuration.hasSensorSGP = false;
|
configuration.hasSensorSGP = false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -374,7 +374,7 @@ static bool sgp41Init(void) {
|
|||||||
configuration.hasSensorSGP = true;
|
configuration.hasSensorSGP = true;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Serial.println("Init SGP41 failuire");
|
Serial.println("Init SGP41 failure");
|
||||||
configuration.hasSensorSGP = false;
|
configuration.hasSensorSGP = false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -193,6 +193,7 @@ void setup() {
|
|||||||
|
|
||||||
/** Initialize local configure */
|
/** Initialize local configure */
|
||||||
configuration.begin();
|
configuration.begin();
|
||||||
|
configuration.setConfigurationUpdatedCallback(configUpdateHandle);
|
||||||
|
|
||||||
/** Init I2C */
|
/** Init I2C */
|
||||||
Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN);
|
Wire.begin(I2C_SDA_PIN, I2C_SCL_PIN);
|
||||||
@@ -370,8 +371,11 @@ void loop() {
|
|||||||
/** factory reset handle */
|
/** factory reset handle */
|
||||||
factoryConfigReset();
|
factoryConfigReset();
|
||||||
|
|
||||||
/** check that local configuration changed then do some action */
|
if (configuration.isCommandRequested()) {
|
||||||
configUpdateHandle();
|
// Each state machine already has an independent request command check
|
||||||
|
stateMachine.executeCo2Calibration();
|
||||||
|
stateMachine.executeLedBarTest();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void co2Update(void) {
|
static void co2Update(void) {
|
||||||
@@ -555,7 +559,7 @@ static bool sgp41Init(void) {
|
|||||||
configuration.hasSensorSGP = true;
|
configuration.hasSensorSGP = true;
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
Serial.println("Init SGP41 failuire");
|
Serial.println("Init SGP41 failure");
|
||||||
configuration.hasSensorSGP = false;
|
configuration.hasSensorSGP = false;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@@ -571,7 +575,7 @@ void checkForFirmwareUpdate(void) {
|
|||||||
if (networkOption == UseWifi) {
|
if (networkOption == UseWifi) {
|
||||||
agOta = new AirgradientOTAWifi;
|
agOta = new AirgradientOTAWifi;
|
||||||
} else {
|
} else {
|
||||||
agOta = new AirgradientOTACellular(cellularCard);
|
agOta = new AirgradientOTACellular(cellularCard, agClient->getICCID());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Indicate main task that firmware update is in progress
|
// Indicate main task that firmware update is in progress
|
||||||
@@ -948,6 +952,8 @@ static void boardInit(void) {
|
|||||||
} else {
|
} else {
|
||||||
Serial.println("Set S8 AbcDays failure");
|
Serial.println("Set S8 AbcDays failure");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ag->s8.printInformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
localServer.setFwMode(fwMode);
|
localServer.setFwMode(fwMode);
|
||||||
@@ -1039,10 +1045,17 @@ void initializeNetwork() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send data for the first time to AG server at boot
|
// Send data for the first time to AG server at boot only if postDataToAirgradient is enabled
|
||||||
|
if (configuration.isPostDataToAirGradient()) {
|
||||||
sendDataToAg();
|
sendDataToAg();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Skip fetch configuration if configuration control is set to "local" only
|
||||||
|
if (configuration.getConfigurationControl() == ConfigurationControl::ConfigurationControlLocal) {
|
||||||
|
ledBarEnabledUpdate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
std::string config = agClient->httpFetchConfig();
|
std::string config = agClient->httpFetchConfig();
|
||||||
configSchedule.update();
|
configSchedule.update();
|
||||||
@@ -1074,8 +1087,8 @@ static void configurationUpdateSchedule(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::string config = agClient->httpFetchConfig();
|
std::string config = agClient->httpFetchConfig();
|
||||||
if (agClient->isLastFetchConfigSucceed() && configuration.parse(config.c_str(), false)) {
|
if (agClient->isLastFetchConfigSucceed()) {
|
||||||
configUpdateHandle();
|
configuration.parse(config.c_str(), false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1084,8 +1097,6 @@ static void configUpdateHandle() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stateMachine.executeCo2Calibration();
|
|
||||||
|
|
||||||
String mqttUri = configuration.getMqttBrokerUri();
|
String mqttUri = configuration.getMqttBrokerUri();
|
||||||
if (mqttClient.isCurrentUri(mqttUri) == false) {
|
if (mqttClient.isCurrentUri(mqttUri) == false) {
|
||||||
mqttClient.end();
|
mqttClient.end();
|
||||||
@@ -1157,11 +1168,6 @@ static void configUpdateHandle() {
|
|||||||
if (configuration.isDisplayBrightnessChanged()) {
|
if (configuration.isDisplayBrightnessChanged()) {
|
||||||
oledDisplay.setBrightness(configuration.getDisplayBrightness());
|
oledDisplay.setBrightness(configuration.getDisplayBrightness());
|
||||||
}
|
}
|
||||||
|
|
||||||
stateMachine.executeLedBarTest();
|
|
||||||
}
|
|
||||||
else if(ag->isOpenAir()) {
|
|
||||||
stateMachine.executeLedBarTest();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update display and led bar notification based on updated configuration
|
// Update display and led bar notification based on updated configuration
|
||||||
@@ -1660,11 +1666,11 @@ void networkingTask(void *args) {
|
|||||||
|
|
||||||
// Run scheduler
|
// Run scheduler
|
||||||
networkSignalCheckSchedule.run();
|
networkSignalCheckSchedule.run();
|
||||||
configSchedule.run();
|
|
||||||
transmissionSchedule.run();
|
transmissionSchedule.run();
|
||||||
|
configSchedule.run();
|
||||||
checkForUpdateSchedule.run();
|
checkForUpdateSchedule.run();
|
||||||
|
|
||||||
delay(1000);
|
delay(50);
|
||||||
}
|
}
|
||||||
|
|
||||||
vTaskDelete(handleNetworkTask);
|
vTaskDelete(handleNetworkTask);
|
||||||
|
|||||||
@@ -202,14 +202,14 @@ String OpenMetrics::getPayload(void) {
|
|||||||
}
|
}
|
||||||
if (utils::isValidNOx(nox)) {
|
if (utils::isValidNOx(nox)) {
|
||||||
add_metric("nox_index",
|
add_metric("nox_index",
|
||||||
"The processed Nitrous Oxide (NOx) index as measured by the "
|
"The processed Nitrogen Oxide (NOx) index as measured by the "
|
||||||
"AirGradient SGP sensor",
|
"AirGradient SGP sensor",
|
||||||
"gauge");
|
"gauge");
|
||||||
add_metric_point("", String(nox));
|
add_metric_point("", String(nox));
|
||||||
}
|
}
|
||||||
if (utils::isValidNOx(noxRaw)) {
|
if (utils::isValidNOx(noxRaw)) {
|
||||||
add_metric("nox_raw",
|
add_metric("nox_raw",
|
||||||
"The raw input value to the Nitrous Oxide (NOx) index as "
|
"The raw input value to the Nitrogen Oxide (NOx) index as "
|
||||||
"measured by the AirGradient SGP sensor",
|
"measured by the AirGradient SGP sensor",
|
||||||
"gauge");
|
"gauge");
|
||||||
add_metric_point("", String(noxRaw));
|
add_metric_point("", String(noxRaw));
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
name=AirGradient Air Quality Sensor
|
name=AirGradient Air Quality Sensor
|
||||||
version=3.3.8
|
version=3.3.9
|
||||||
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.
|
||||||
|
|||||||
@@ -456,6 +456,10 @@ bool Configuration::begin(void) {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Configuration::setConfigurationUpdatedCallback(ConfigurationUpdatedCallback_t callback) {
|
||||||
|
_callback = callback;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Parse JSON configura string to local configure
|
* @brief Parse JSON configura string to local configure
|
||||||
*
|
*
|
||||||
@@ -951,15 +955,18 @@ bool Configuration::parse(String data, bool isLocal) {
|
|||||||
changed = true;
|
changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ledBarTestRequested || co2CalibrationRequested) {
|
||||||
|
commandRequested = true;
|
||||||
|
updated = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
updated = true;
|
updated = true;
|
||||||
saveConfig();
|
saveConfig();
|
||||||
printConfig();
|
printConfig();
|
||||||
} else {
|
_callback();
|
||||||
if (ledBarTestRequested || co2CalibrationRequested) {
|
|
||||||
updated = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1159,6 +1166,12 @@ bool Configuration::isUpdated(void) {
|
|||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Configuration::isCommandRequested(void) {
|
||||||
|
bool oldState = this->commandRequested;
|
||||||
|
this->commandRequested = false;
|
||||||
|
return oldState;
|
||||||
|
}
|
||||||
|
|
||||||
String Configuration::jsonTypeInvalidMessage(String name, String type) {
|
String Configuration::jsonTypeInvalidMessage(String name, String type) {
|
||||||
return "'" + name + "' type is invalid, expecting '" + type + "'";
|
return "'" + name + "' type is invalid, expecting '" + type + "'";
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ private:
|
|||||||
bool co2CalibrationRequested;
|
bool co2CalibrationRequested;
|
||||||
bool ledBarTestRequested;
|
bool ledBarTestRequested;
|
||||||
bool updated;
|
bool updated;
|
||||||
|
bool commandRequested = false;
|
||||||
String failedMessage;
|
String failedMessage;
|
||||||
bool _noxLearnOffsetChanged;
|
bool _noxLearnOffsetChanged;
|
||||||
bool _tvocLearningOffsetChanged;
|
bool _tvocLearningOffsetChanged;
|
||||||
@@ -70,6 +71,9 @@ public:
|
|||||||
bool hasSensorSGP = true;
|
bool hasSensorSGP = true;
|
||||||
bool hasSensorSHT = true;
|
bool hasSensorSHT = true;
|
||||||
|
|
||||||
|
typedef void (*ConfigurationUpdatedCallback_t)();
|
||||||
|
void setConfigurationUpdatedCallback(ConfigurationUpdatedCallback_t callback);
|
||||||
|
|
||||||
bool begin(void);
|
bool begin(void);
|
||||||
bool parse(String data, bool isLocal);
|
bool parse(String data, bool isLocal);
|
||||||
String toString(void);
|
String toString(void);
|
||||||
@@ -90,6 +94,7 @@ public:
|
|||||||
void reset(void);
|
void reset(void);
|
||||||
String getModel(void);
|
String getModel(void);
|
||||||
bool isUpdated(void);
|
bool isUpdated(void);
|
||||||
|
bool isCommandRequested(void);
|
||||||
String getFailedMesage(void);
|
String getFailedMesage(void);
|
||||||
void setPostToAirGradient(bool enable);
|
void setPostToAirGradient(bool enable);
|
||||||
bool noxLearnOffsetChanged(void);
|
bool noxLearnOffsetChanged(void);
|
||||||
@@ -116,6 +121,8 @@ public:
|
|||||||
PMCorrection getPMCorrection(void);
|
PMCorrection getPMCorrection(void);
|
||||||
TempHumCorrection getTempCorrection(void);
|
TempHumCorrection getTempCorrection(void);
|
||||||
TempHumCorrection getHumCorrection(void);
|
TempHumCorrection getHumCorrection(void);
|
||||||
|
private:
|
||||||
|
ConfigurationUpdatedCallback_t _callback;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /** _AG_CONFIG_H_ */
|
#endif /** _AG_CONFIG_H_ */
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ AgSchedule::~AgSchedule() {}
|
|||||||
void AgSchedule::run(void) {
|
void AgSchedule::run(void) {
|
||||||
uint32_t ms = (uint32_t)(millis() - count);
|
uint32_t ms = (uint32_t)(millis() - count);
|
||||||
if (ms >= period) {
|
if (ms >= period) {
|
||||||
handler();
|
|
||||||
count = millis();
|
count = millis();
|
||||||
|
handler();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
#define RGB_COLOR_R 255, 0, 0 /** Red */
|
#define RGB_COLOR_R 255, 0, 0 /** Red */
|
||||||
#define RGB_COLOR_G 0, 255, 0 /** Green */
|
#define RGB_COLOR_G 0, 255, 0 /** Green */
|
||||||
#define RGB_COLOR_Y 255, 150, 0 /** Yellow */
|
#define RGB_COLOR_Y 255, 255, 0 /** Yellow */
|
||||||
#define RGB_COLOR_O 255, 40, 0 /** Orange */
|
#define RGB_COLOR_O 255, 128, 0 /** Orange */
|
||||||
#define RGB_COLOR_P 180, 0, 255 /** Purple */
|
#define RGB_COLOR_P 180, 0, 255 /** Purple */
|
||||||
#define RGB_COLOR_CLEAR 0, 0, 0 /** No color */
|
#define RGB_COLOR_CLEAR 0, 0, 0 /** No color */
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "Main/utils.h"
|
#include "Main/utils.h"
|
||||||
|
|
||||||
#ifndef GIT_VERSION
|
#ifndef GIT_VERSION
|
||||||
#define GIT_VERSION "3.3.8-snap"
|
#define GIT_VERSION "3.3.9-snap"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Submodule src/Libraries/airgradient-client updated: a4ac14936e...c23bb2ceac
Submodule src/Libraries/airgradient-ota updated: c772392427...7b103e9073
@@ -260,13 +260,14 @@ bool MqttClient::connect(String id) {
|
|||||||
connected = false;
|
connected = false;
|
||||||
if (user.isEmpty()) {
|
if (user.isEmpty()) {
|
||||||
logInfo("Connect without auth");
|
logInfo("Connect without auth");
|
||||||
if(CLIENT()->connect(id.c_str())) {
|
connected = CLIENT()->connect(id.c_str());
|
||||||
connected = true;
|
} else {
|
||||||
|
logInfo("Connect with auth");
|
||||||
|
connected = CLIENT()->connect(id.c_str(), user.c_str(), password.c_str());
|
||||||
}
|
}
|
||||||
return connected;
|
return connected;
|
||||||
}
|
}
|
||||||
return CLIENT()->connect(id.c_str(), user.c_str(), password.c_str());
|
|
||||||
}
|
|
||||||
void MqttClient::handle(void) {
|
void MqttClient::handle(void) {
|
||||||
if (isBegin == false) {
|
if (isBegin == false) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -835,3 +835,13 @@ bool S8::setAbcPeriod(int hours) {
|
|||||||
* @return int Hour
|
* @return int Hour
|
||||||
*/
|
*/
|
||||||
int S8::getAbcPeriod(void) { return getCalibPeriodABC(); }
|
int S8::getAbcPeriod(void) { return getCalibPeriodABC(); }
|
||||||
|
|
||||||
|
|
||||||
|
void S8::printInformation(void) {
|
||||||
|
Serial.print("S8 type ID: 0x");
|
||||||
|
Serial.println(getSensorTypeId(), HEX);
|
||||||
|
Serial.print("S8 serial number: 0x");
|
||||||
|
Serial.println(getSensorId(), HEX);
|
||||||
|
Serial.print("S8 memory map version: 0x");
|
||||||
|
Serial.println(getMemoryMapVersion(), HEX);
|
||||||
|
}
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ public:
|
|||||||
bool isBaseLineCalibrationDone(void);
|
bool isBaseLineCalibrationDone(void);
|
||||||
bool setAbcPeriod(int hours);
|
bool setAbcPeriod(int hours);
|
||||||
int getAbcPeriod(void);
|
int getAbcPeriod(void);
|
||||||
|
void printInformation(void);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Variables */
|
/** Variables */
|
||||||
|
|||||||
Reference in New Issue
Block a user