Open hestiahacker opened 3 months ago
Update: I found the Flashing Of The AirGradient Firmware instructions. This resulted in a 'class Configuration' has no member named 'isOfflineMode' error message.
This is with version 3.1.0-beta.1 of the AirGradient library and commit 2e62abe2d7d8a3c549f04b78bfcff8c745ce9af0 of this repo.
The Flashing instructions say to install additional libraries listed on the top of the example code, but the example code does not specify any additional libraries to install.
home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino: In function 'void setup()':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:184:25: error: 'class Configuration' has no member named 'isOfflineMode'
184 | configuration.isOfflineMode() ? "online mode" : "offline mode", "");
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:188:25: error: 'class Configuration' has no member named 'setOfflineMode'
188 | configuration.setOfflineMode(!configuration.isOfflineMode());
| ^~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:188:55: error: 'class Configuration' has no member named 'isOfflineMode'
188 | configuration.setOfflineMode(!configuration.isOfflineMode());
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:192:29: error: 'class Configuration' has no member named 'isOfflineMode'
192 | configuration.isOfflineMode() ? " = True" : " = False", "");
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:201:38: error: 'class Configuration' has no member named 'isOfflineMode'
201 | connectToWifi = !configuration.isOfflineMode();
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:203:21: error: 'class Configuration' has no member named 'setOfflineModeWithoutSave'
203 | configuration.setOfflineModeWithoutSave(true);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:225:24: error: 'class Measurements' has no member named 'otaBootCount'; did you mean 'bootCount'?
225 | measurements.otaBootCount = 0;
| ^~~~~~~~~~~~
| bootCount
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:232:27: error: 'class AgApiClient' has no member named 'isNotAvailableOnDashboard'
232 | if (apiClient.isNotAvailableOnDashboard()) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:244:21: error: 'class OledDisplay' has no member named 'showRebooting'
244 | oledDisplay.showRebooting();
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:250:21: error: 'class WifiConnector' has no member named 'hasConfigurated'
250 | if (wifiConnector.hasConfigurated() == false) {
| ^~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:252:19: error: 'class Configuration' has no member named 'setOfflineModeWithoutSave'
252 | configuration.setOfflineModeWithoutSave(true);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:260:66: error: 'class Configuration' has no member named 'getDisplayBrightness'
260 | Serial.println("Display brightness: " + String(configuration.getDisplayBrightness()));
| ^~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:261:17: error: 'class OledDisplay' has no member named 'setBrightness'
261 | oledDisplay.setBrightness(configuration.getDisplayBrightness());
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:261:45: error: 'class Configuration' has no member named 'getDisplayBrightness'
261 | oledDisplay.setBrightness(configuration.getDisplayBrightness());
| ^~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino: In function 'void loop()':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:302:21: error: 'class Configuration' has no member named 'isOfflineMode'
302 | if (configuration.isOfflineMode() ||
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino: In function 'void ledBarEnabledUpdate()':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:465:36: error: 'class Configuration' has no member named 'getLedBarBrightness'
465 | int brightness = configuration.getLedBarBrightness();
| ^~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:470:18: error: 'class LedBar' has no member named 'setBrightness'; did you mean 'setBrighness'?
470 | ag->ledBar.setBrightness(brightness);
| ^~~~~~~~~~~~~
| setBrighness
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino: In function 'void displayExecuteOta(OtaState, String, int)':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:514:19: error: 'class OledDisplay' has no member named 'showNewFirmwareVersion'
514 | oledDisplay.showNewFirmwareVersion(msg);
| ^~~~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:523:19: error: 'class OledDisplay' has no member named 'showNewFirmwareFailed'
523 | oledDisplay.showNewFirmwareFailed();
| ^~~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:533:19: error: 'class OledDisplay' has no member named 'showNewFirmwareUpdating'
533 | oledDisplay.showNewFirmwareUpdating(String(processing));
| ^~~~~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:549:23: error: 'class OledDisplay' has no member named 'showNewFirmwareSuccess'
549 | oledDisplay.showNewFirmwareSuccess(String(i));
| ^~~~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino: In function 'void oneIndoorInit()':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:634:20: error: 'class StateMachine' has no member named 'executeLedBarPowerUpTest'; did you mean 'executeLedBarTest'?
634 | stateMachine.executeLedBarPowerUpTest();
| ^~~~~~~~~~~~~~~~~~~~~~~~
| executeLedBarTest
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino: In function 'void configUpdateHandle()':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:851:23: error: 'class Configuration' has no member named 'isLedBarBrightnessChanged'
851 | if (configuration.isLedBarBrightnessChanged()) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:852:25: error: 'class Configuration' has no member named 'getLedBarBrightness'
852 | if (configuration.getLedBarBrightness() == 0) {
| ^~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:858:20: error: 'class LedBar' has no member named 'setBrightness'; did you mean 'setBrighness'?
858 | ag->ledBar.setBrightness(configuration.getLedBarBrightness());
| ^~~~~~~~~~~~~
| setBrighness
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:858:48: error: 'class Configuration' has no member named 'getLedBarBrightness'
858 | ag->ledBar.setBrightness(configuration.getLedBarBrightness());
| ^~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:863:23: error: 'class Configuration' has no member named 'isLedBarModeChanged'
863 | if (configuration.isLedBarModeChanged()) {
| ^~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:864:25: error: 'class Configuration' has no member named 'getLedBarBrightness'
864 | if (configuration.getLedBarBrightness() == 0) {
| ^~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:871:22: error: 'class LedBar' has no member named 'setBrightness'; did you mean 'setBrighness'?
871 | ag->ledBar.setBrightness(configuration.getLedBarBrightness());
| ^~~~~~~~~~~~~
| setBrighness
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:871:50: error: 'class Configuration' has no member named 'getLedBarBrightness'
871 | ag->ledBar.setBrightness(configuration.getLedBarBrightness());
| ^~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:877:23: error: 'class Configuration' has no member named 'isDisplayBrightnessChanged'
877 | if (configuration.isDisplayBrightnessChanged()) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:878:19: error: 'class OledDisplay' has no member named 'setBrightness'
878 | oledDisplay.setBrightness(configuration.getDisplayBrightness());
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:878:47: error: 'class Configuration' has no member named 'getDisplayBrightness'
878 | oledDisplay.setBrightness(configuration.getDisplayBrightness());
| ^~~~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:884:32: error: 'class Configuration' has no member named 'newFirmwareVersion'
884 | fwNewVersion = configuration.newFirmwareVersion();
| ^~~~~~~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:887:22: error: 'class Measurements' has no member named 'otaBootCount'; did you mean 'bootCount'?
887 | if (measurements.otaBootCount == 0) {
| ^~~~~~~~~~~~
| bootCount
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:893:50: error: 'class Measurements' has no member named 'otaBootCount'; did you mean 'bootCount'?
893 | if ((measurements.bootCount - measurements.otaBootCount) >= (int)otaBootCount) {
| ^~~~~~~~~~~~
| bootCount
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:898:64: error: 'class Measurements' has no member named 'otaBootCount'; did you mean 'bootCount'?
898 | String(30 - (measurements.bootCount - measurements.otaBootCount)) +
| ^~~~~~~~~~~~
| bootCount
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:904:20: error: 'class Measurements' has no member named 'otaBootCount'; did you mean 'bootCount'?
904 | measurements.otaBootCount = measurements.bootCount;
| ^~~~~~~~~~~~
| bootCount
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino: In function 'void appLedHandler()':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:916:21: error: 'class Configuration' has no member named 'isOfflineMode'
916 | if (configuration.isOfflineMode() == false) {
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino: In function 'void appDispHandler()':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:935:23: error: 'class Configuration' has no member named 'isOfflineMode'
935 | if (configuration.isOfflineMode() == false) {
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino: In function 'void sendDataToServer()':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:1158:73: error: 'class Configuration' has no member named 'isOfflineMode'
1158 | if (configuration.isPostDataToAirGradient() == false || configuration.isOfflineMode()) {
| ^~~~~~~~~~~~~
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/LocalServer.cpp: In member function 'void LocalServer::_GET_config()':
/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/LocalServer.cpp:45:57: error: no matching function for call to 'Configuration::toString(AgFirmwareMode&)'
45 | server.send(200, "application/json", config.toString(fwMode));
| ~~~~~~~~~~~~~~~^~~~~~~~
In file included from /home/user/air_gradient_open_air_firmware/examples/OneOpenAir/LocalServer.h:4,
from /home/user/air_gradient_open_air_firmware/examples/OneOpenAir/LocalServer.cpp:1:
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.h:67:10: note: candidate: 'String Configuration::toString()'
67 | String toString(void);
| ^~~~~~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.h:67:10: note: candidate expects 0 arguments, 1 provided
exit status 1
Compilation error: 'class Configuration' has no member named 'isOfflineMode'
After some additional research, it appears the commit which added isOfflineMode (commit da6326db0fded87110163d7fc93f200afe6e202d) is only in tags 3.1.1 and 3.1.2 (as seen with git tag -l --contains da6326db0fded87110163d7fc93f200afe6e202d
).
The latest version available in the Arduino Library is 3.1.0-beta.1, which is why I'm running into this issue. If the Arduino library can not be automatically released when a firmware version is released, perhaps we can add instructions on how to configure the Arduino IDE use the local git checkout instead of having to install the library with the library manager to ensure this is resolved going forward?
The stacktrace from my previous comment was from trying to compile the firmware on the master branch.
Since then, version 3.1.3 of the library has been released and is available in the published libraries, however the master branch still does not compile, this time with a different error because the otaBootCount member doesn't exist.
The best way to solve this problem is to have the OneOpenAir.ino sketch use the local files to compile instead of requiring a library to be installed. As you seem to have indicated, the library available via the Arduino IDE will always lag behind.
My goal in opening this ticket is to ensure a new developer can always compile at least the master branch, and ideally also the develop branch as well. I have started creating this documentation, but since I am still unable to compile, clearly the documentation is not yet ready to be submitted to be merged in.
Hi @hestiahacker
All build is worked without any problem and otaBootCount
is removed from code since 3.1.3
Please follow instruction begin of file: https://github.com/airgradienthq/arduino/blob/8a83e408d3c036b089b63c053a11364b41a26092/examples/OneOpenAir/OneOpenAir.ino#L12-L27
If it's not worked, please remove the library on your PC then install again.
I'm also having compile issues, and I have followed these instructions above. 3.1.3 firmware and Library. Docs for compiling is a great idea.
/Users/temp/Repositories/2024/arduino/examples/OneOpenAir/OneOpenAir.ino: In function 'void oneIndoorInit()':
/Users/temp/Repositories/2024/arduino/examples/OneOpenAir/OneOpenAir.ino:722:25: error: 'Serial0' was not declared in this scope
if (ag->pms5003.begin(Serial0) == false) {
^~~~~~~
/Users/temp/Repositories/2024/arduino/examples/OneOpenAir/OneOpenAir.ino:722:25: note: suggested alternative: 'Serial1'
if (ag->pms5003.begin(Serial0) == false) {
^~~~~~~
...
I'm also having compile issues, and I have followed these instructions above. 3.1.3 firmware and Library. Docs for compiling is a great idea.
/Users/temp/Repositories/2024/arduino/examples/OneOpenAir/OneOpenAir.ino: In function 'void oneIndoorInit()': /Users/temp/Repositories/2024/arduino/examples/OneOpenAir/OneOpenAir.ino:722:25: error: 'Serial0' was not declared in this scope if (ag->pms5003.begin(Serial0) == false) { ^~~~~~~ /Users/temp/Repositories/2024/arduino/examples/OneOpenAir/OneOpenAir.ino:722:25: note: suggested alternative: 'Serial1' if (ag->pms5003.begin(Serial0) == false) { ^~~~~~~ ...
You're missed Enable CDC On Boot
I've added documentation on compiling based on what I've collected and what was said in this thread, but this project still doesn't compile.
I hope someone will be able to follow the development setup instructions and reproduce this issue so we can get to the bottom of it and get it resolved.
I have gone through the instructions for setting up a development environment again on a new machine using AirGradient Air Quality Sensor library version 3.1.3 and I am still unable to compile the firmware. I am on the "master" branch, and more specifically: on commit 3b6859f483f494d0556d36acdb95bfc3d7957f08.
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp: In member function 'bool Configuration::parse(String, bool)':
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:277:45: error: ambiguous overload for 'operator==' (operand types are 'JSONVar' and 'String')
277 | if (jconfig[jprop_configurationControl] ==
In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/3.0.1/cores/esp32/Arduino.h:192,
from /home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/Main/PrintLog.h:4,
from /home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.h:5,
from /home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:1:
/home/user/.arduino15/packages/esp32/hardware/esp32/3.0.1/cores/esp32/WString.h:211:8: note: candidate: 'bool String::operator==(const String&) const' (reversed)
211 | bool operator==(const String &rhs) const {
| ^~~~~~~~
/home/user/.arduino15/packages/esp32/hardware/esp32/3.0.1/cores/esp32/WString.h:214:8: note: candidate: 'bool String::operator==(const char*) const' (reversed)
214 | bool operator==(const char *cstr) const {
| ^~~~~~~~
In file included from /home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/Libraries/Arduino_JSON/src/JSON.h:25,
from /home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/Libraries/Arduino_JSON/src/Arduino_JSON.h:23,
from /home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:2:
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/Libraries/Arduino_JSON/src/JSONVar.h:85:8: note: candidate: 'bool JSONVar::operator==(const JSONVar&) const'
85 | bool operator==(const JSONVar& v) const;
| ^~~~~~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:286:45: error: ambiguous overload for 'operator==' (operand types are 'JSONVar' and 'String')
286 | if (jconfig[jprop_configurationControl] ==
/home/user/.arduino15/packages/esp32/hardware/esp32/3.0.1/cores/esp32/WString.h:211:8: note: candidate: 'bool String::operator==(const String&) const' (reversed)
211 | bool operator==(const String &rhs) const {
| ^~~~~~~~
/home/user/.arduino15/packages/esp32/hardware/esp32/3.0.1/cores/esp32/WString.h:214:8: note: candidate: 'bool String::operator==(const char*) const' (reversed)
214 | bool operator==(const char *cstr) const {
| ^~~~~~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/Libraries/Arduino_JSON/src/JSONVar.h:85:8: note: candidate: 'bool JSONVar::operator==(const JSONVar&) const'
85 | bool operator==(const JSONVar& v) const;
| ^~~~~~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgApiClient.cpp: In member function 'bool AgApiClient::postToServer(String)':
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgApiClient.cpp:108:7: error: 'WiFi' was not declared in this scope
108 | if (WiFi.isConnected() == false) {
| ^~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgApiClient.cpp:118:3: error: 'WiFiClient' was not declared in this scope
118 | WiFiClient wifiClient;
| ^~~~~~~~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgApiClient.cpp:120:20: error: 'wifiClient' was not declared in this scope
120 | if (client.begin(wifiClient, uri.c_str()) == false) {
| ^~~~~~~~~~
exit status 1
Compilation error: exit status 1
If we look at there errors, we can see they match up with the source code in this repo, so this is not a matter of having outdated code.
We also have conflicting documentation about which board to select in the Arduino IDE. Changing boards does not affect the compilation error above (all three options result in the same compilation error), but this is an additional problem related to the instructions to compile needing to be updated.
From https://www.airgradient.com/blog/install-arduino-c3-mini/ we see:
Don’t forget to select the Lolin C3 Mini board from Tools > Board > ESP 32 menu after installation.
From comments in the source code we see: Set board to "ESP32C3 Dev Module"
Then, to further complicate matters, the Arduino IDE auto-detects the device as an Adafruit QT Py ESP32-C3
@hestiahacker just confirming I'm seeing the exact same build errors as you. Thank you for writing up great instructions! Definitely extremely confusing trying to get started without them.
Thanks for your comment, @mattkelly. I was starting to wonder if I was in the twilight zone, where the code works fine for everyone except me!
I look forward to being a regular contributor once I get set up. I'm a big fan of documentation, so whenever I can't figure some thing out, there will be a PR after I get it sorted. 🙂
@hestiahacker FWIW if you need help getting unblocked, here's a minimal commit off of develop
to make compilation/running work:
Thanks for the patch, @mattkelly! I can confirm that after those changes, it doesn't give me the same compilation errors. Instead, it now fails because the sketch is too big. This is true whether the "ESP32C3 Dev Module" board is selected (as the comments indicate) or when the "Lolin C3 Mini" board is selected (as the instructions indicate).
Sketch uses 1459008 bytes (111%) of program storage space. Maximum is 1310720 bytes.
Global variables use 41068 bytes (12%) of dynamic memory, leaving 286612 bytes for local variables. Maximum is 327680 bytes.
Sketch too big; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing it.
text section exceeds available space in board
Compilation error: text section exceeds available space in board
The Arduino support document didn't have any easy fixes (e.g. a compiler setting to optimize for size instead of speed).
For anyone else who is playing along at home, these changes should not be made to your source tree. It won't make any difference at all. Instead, they should be applied to the files in ~/Arduino/libraries/AirGradient_Air_Quality_Sensor/
, as that's the copy that the compiler is going to use.
I'm very much looking forward to providing instructions on how to use the code in the repo instead of the library, so if anyone figures out how to do that, please let me know. Without those instructions, every API change will require releasing a new version of the library before it can be used in the code base (as opposed to adding it and using it at the same time).
Yup thanks for the clarification re: source tree - I've been finding my first dive into the Arduino ecosystem pretty confusing tbh!
I was also seeing the too big sketch error and honestly, I'm not sure how I got around it. I think I did an extra clean build somehow - it was a while ago now. I suspect that there's some cruft buildup happening from multiple repeated builds, not really sure yet.
Interesting that you all used Arduino IDE to compile the project,
I use PlatformIO
and compilation works fine for the esp32-c3
(AirGradient ONE) environment:
pio run -e esp32-c3
but not for the esp8266
environment:
pio run -e esp8266
(compilation errors)
It's used by old models so this was not of my concern.
@pnt325 @airgradienthq But I wonder what's the correct way of compiling the project then: Arduino IDE or PlatformIO?
To flash the device I do:
Boot SW
while plugging cable inpio run -e esp32-c3 --target upload
Additionally I added the following entries to the platformio.ini
under the [env:esp32-c3]
tag
board_build.flash_mode = qio
board_build.f_flash = 80000000L
Whether these are required I don't know, I simply translated the important flashing steps from OneOpenAir.ino (Arduino IDE) to PlatformIO
Given that the name of the repo is "arduino", I expected the it was expected to be compiled with the Arduino IDE. I'll be interested to see what @airgradienthq has to say about this.
Hi @hestiahacker
You can find it on Arduino libraries with name AirGradient Air Quality Sensor
. We are develop the library for Arduino, please follow the instruction on head of file to configuration Arduino before build at here. We are already test worked before release
Hello @pnt325
I feel like there's been a miscommunication here. There are two issues that have not been answered.
~/Arduino/libraries/AirGradient_Air_Quality_Sensor/
as described in this comment, and then if they work, copy those change over to the checkout of this git repo, submit them without end to end testing, hope that they get accepted, and only after they are accepted and a new version of the library is released can contributors fully test their changes. If there's an error, the entire process starts over. There's also a risk of an error when we're copying the code from the libraries directory to the git checkout which wouldn't exist if we could use the code from the git checkout directly.This ticket has been open for nearly two months and we are still unable to compile the project, which is a very frustrating experience for someone considering volunteering their time to help maintain the firmware.
@hestiahacker i am using the Arduino software to compile and flash since many months with the master branch and it works just fine for me.
It's very late here but I will publish my version number and settings here tomorrow.
Arduino Editor
Board Manager:
Here are my Arduino Settings:
@hestiahacker I just re-installed my complete environment and followed these steps and 3.1.4 compiles and flashes.
I am on Mac (Ventura 13.1) and cannot test on Linux. So I'm not sure if there is a problem from that side.
I set up a new computer with Arduino IDE 2.3.2 (Linux), and it doesn't compile there. There are two issues, compiler errors and a space issue. I've fixed the latter (error on my part), but the former requires code changes.
I'm using v3.1.4 of the AirGradient library.
WiFi
is not declared in src/AgApiClient.cpp
because neither WiFi.h nor WiFiClient.h are included in AgApiClient.cpp or AgApiClient.h
I don't understand how this is compiling on your machine.
error: ambiguous overload for 'operator=='
in AgConfigure.cpp
These errors is just a matter of casting the jconfig values to a Strings. Maybe this is a difference in compilers since it looks like you're using an old version of the Arduino IDE which was doing an implicit cast.
error: 'esp_mqtt_client_config_t' has no non-static data member named 'uri'
As said previously: "C++ doesn't support designated initializers, so don't use one". The only thing I can think of is that maybe this is another difference between the versions of Arduino that we are using.
Here are all the details of the compiler errors when trying to compile the master branch
This was an error on my part. I had the Partition Scheme set to the default instead of the "Minimal SPIFFS..." option. Once I fixed that, I was able to compile my fork (with @mattkelly's patch). To be clear, I could still not compile the master branch of this repo (airgradienthq/arduino) due to the compilation errors described above.
Note: This Partition Scheme setting got reset to the default when I was switching between the "Wemos D1 Mini" board that the documentation says should be selected and the "ESP32C3 Dev Module" that the comments say should be selected.
What about using PlatformIO as official way? What purpose has the current PlatformIO config file?
Problem
Attempting to compile in the Arduino IDE results in the following error:
The tactical problem issue here is that some included files are in examples/OneOpenAir, while others are in src, and Arduino IDE is not looking in all these places.
However, the core problem is I can not find instructions on how to configure the Arduino IDE to compile. Since I expect others can compile the code, I expect this is just a setup problem and not a broken codebase.
Steps to reproduce
sudo apt install python3-serial
)./examples/OneOpenAir/OneOpenAir.ino
in the Arduino IDEAttempts at resolving this
I tried a number of things to resolve this.
./examples/OneOpenAir/OneOpenAir.ino
, put it in./src/
, and open and compile that (so the file is next to the .h file we want to include)./examples/OneOpenAir/OneOpenAir.ino
into./src/
, and open and compile that (so the file is next to the .h file we want to include)./src/Libraries
named./examples/OneOpenAir/libraries
so the sketch directory has a libraries folder, as described in the arduino documentation./src
, or./examples/OneOpenAir
to get it to find the libraries directory./src
directory, rename./src
toOneOpenAir
, open OneOpenAir.ino in the Arduino IDE and attempt to compile it (this was tried because Arduino insists on having the name of the directory match the name of the .ino file)All of the above gave same error message except the last one, which give the error message below:
Symlinking to ../examples/OneOpenAir/OtaHandler.h, ../examples/OneOpenAir/LocalServer.h and ../examples/OneOpenAir/OpenMetrics.h works around the "No such file" errors, but then exposes the more serious compilation errors below: