Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] instructions to compile #160

Open
hestiahacker opened this issue Jun 2, 2024 · 26 comments
Open

[docs] instructions to compile #160

hestiahacker opened this issue Jun 2, 2024 · 26 comments

Comments

@hestiahacker
Copy link

Problem

Attempting to compile in the Arduino IDE results in the following error:

/home/user/air_gradient_open_air_firmware/examples/OneOpenAir/OneOpenAir.ino:40:10: fatal error: AirGradient.h: No such file or directory
   40 | #include "AirGradient.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: AirGradient.h: No such file or directory

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

  1. Set up Arduino IDE to compile for the ESP32 board using the instructions on the blog
  2. Install the "serial" library for Python (e.g. sudo apt install python3-serial)
  3. Checkout this repo and open ./examples/OneOpenAir/OneOpenAir.ino in the Arduino IDE
  4. Click the verify button (check mark button in the upper left of the Arduino IDE) and see the posted error above

Attempts at resolving this

I tried a number of things to resolve this.

  • Make a symlink pointing to ./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)
  • Copy ./examples/OneOpenAir/OneOpenAir.ino into ./src/, and open and compile that (so the file is next to the .h file we want to include)
  • Make a symlink to ./src/Libraries named ./examples/OneOpenAir/libraries so the sketch directory has a libraries folder, as described in the arduino documentation
  • File -> Preference -> Change Sketchbook location to the root git repo, ./src, or ./examples/OneOpenAir to get it to find the libraries directory
  • copy OneOpenAir.ino into the ./src directory, rename ./src to OneOpenAir, 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:

/home/user/air_gradient_open_air_firmware/OneOpenAir/OneOpenAir.ino:41:10: fatal error: OtaHandler.h: No such file or directory
   41 | #include "OtaHandler.h"
      |          ^~~~~~~~~~~~~~
compilation terminated.
exit status 1

Compilation error: OtaHandler.h: No such file or directory

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:

home/user/air_gradient_open_air_firmware/OneOpenAir/AgConfigure.cpp: In member function 'bool Configuration::parse(String, bool)':
/home/user/air_gradient_open_air_firmware/OneOpenAir/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.0/cores/esp32/Arduino.h:192,
                 from /home/user/air_gradient_open_air_firmware/OneOpenAir/Main/PrintLog.h:4,
                 from /home/user/air_gradient_open_air_firmware/OneOpenAir/AgConfigure.h:5,
                 from /home/user/air_gradient_open_air_firmware/OneOpenAir/AgConfigure.cpp:1:
/home/user/.arduino15/packages/esp32/hardware/esp32/3.0.0/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.0/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/air_gradient_open_air_firmware/OneOpenAir/Libraries/Arduino_JSON/src/JSON.h:25,
                 from /home/user/air_gradient_open_air_firmware/OneOpenAir/Libraries/Arduino_JSON/src/Arduino_JSON.h:23,
                 from /home/user/air_gradient_open_air_firmware/OneOpenAir/AgConfigure.cpp:2:
/home/user/air_gradient_open_air_firmware/OneOpenAir/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/air_gradient_open_air_firmware/OneOpenAir/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.0/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.0/cores/esp32/WString.h:214:8: note: candidate: 'bool String::operator==(const char*) const' (reversed)
  214 |   bool operator==(const char *cstr) const {
      |        ^~~~~~~~
/home/user/air_gradient_open_air_firmware/OneOpenAir/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/air_gradient_open_air_firmware/OneOpenAir/AgApiClient.cpp: In member function 'bool AgApiClient::postToServer(String)':
/home/user/air_gradient_open_air_firmware/OneOpenAir/AgApiClient.cpp:108:7: error: 'WiFi' was not declared in this scope
  108 |   if (WiFi.isConnected() == false) {
      |       ^~~~
/home/user/air_gradient_open_air_firmware/OneOpenAir/AgApiClient.cpp:118:3: error: 'WiFiClient' was not declared in this scope
  118 |   WiFiClient wifiClient;
      |   ^~~~~~~~~~
/home/user/air_gradient_open_air_firmware/OneOpenAir/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: ambiguous overload for 'operator==' (operand types are 'JSONVar' and 'String')
@hestiahacker
Copy link
Author

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 2e62abe 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'

@hestiahacker
Copy link
Author

After some additional research, it appears the commit which added isOfflineMode (commit da6326d) 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?

@pnt325
Copy link
Contributor

pnt325 commented Jun 8, 2024

Hi @hestiahacker

You can download firmware on branch master for office release. For newest support function and bugfix on branch develop.

The Arduino IDE only get the firmware for office release after 1-2 days.

@hestiahacker
Copy link
Author

hestiahacker commented Jun 8, 2024

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.

@pnt325
Copy link
Contributor

pnt325 commented Jun 8, 2024

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:

Build Instructions: AirGradient ONE:
https://www.airgradient.com/documentation/one-v9/ Build Instructions:
AirGradient Open Air:
https://www.airgradient.com/documentation/open-air-pst-kit-1-3/
Please make sure you have esp32 board manager installed. Tested with
version 2.0.11.
Important flashing settings:
- Set board to "ESP32C3 Dev Module"
- Enable "USB CDC On Boot"
- Flash frequency "80Mhz"
- Flash mode "QIO"
- Flash size "4MB"
- Partition scheme "Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)"
- JTAG adapter "Disabled"

If it's not worked, please remove the library on your PC then install again.

@abstractpoint
Copy link

abstractpoint commented Jun 15, 2024

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) {
                         ^~~~~~~
...

@pnt325
Copy link
Contributor

pnt325 commented Jun 16, 2024

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

hestiahacker pushed a commit to hestiahacker/arduino that referenced this issue Jun 17, 2024
@hestiahacker
Copy link
Author

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.

Still unable to compile

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 3b6859f.

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

Conflicting documentation

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"

Important flashing settings:
- 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

@mattkelly
Copy link

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

@hestiahacker
Copy link
Author

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

@mattkelly
Copy link

mattkelly commented Jun 22, 2024

@hestiahacker FWIW if you need help getting unblocked, here's a minimal commit off of develop to make compilation/running work:

  1. Lazily remove wifi connection check for now
  2. Fix types used for comparison
  3. C++ doesn't support designated initializers, so don't use one

hestiahacker pushed a commit to hestiahacker/arduino that referenced this issue Jul 1, 2024
@hestiahacker
Copy link
Author

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

@mattkelly
Copy link

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.

@stablestud
Copy link

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:

  1. Press Boot SW while plugging cable in
  2. pio run -e esp32-c3 --target upload
  3. Replug cable to reset device
  4. Done

@stablestud
Copy link

stablestud commented Jul 12, 2024

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

@hestiahacker
Copy link
Author

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.

@pnt325
Copy link
Contributor

pnt325 commented Jul 24, 2024

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

@hestiahacker
Copy link
Author

Hello @pnt325

I feel like there's been a miscommunication here. There are two issues that have not been answered.

  1. The code does not compile in the Arduino IDE. This has been verified by multiple people. If @mattkelly's patch is applied, it still does not compile because the sketch is too big as described here.
  2. Because the OneOpenAir.ino uses the library instead of the code from the repo, it's difficult for contributors to make changes to the library and test them. In order to make changes, we have to modify files in ~/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.

@airgradienthq
Copy link
Owner

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

hestiahacker pushed a commit to hestiahacker/arduino that referenced this issue Jul 25, 2024
@airgradienthq
Copy link
Owner

Arduino Editor
image

Board Manager:
image

Here are my Arduino Settings:
image

@airgradienthq
Copy link
Owner

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

@hestiahacker
Copy link
Author

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.

Three compilation errors

WiFi not defined

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.

Ambiguous overload

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.

Designated initializers

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.

Details

Here are all the details of the compiler errors when trying to compile the master branch

Compiler errors
/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:290:45: error: ambiguous overload for 'operator==' (operand types are 'JSONVar' and 'String')
  290 |     if (jconfig[jprop_configurationControl] ==
In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/3.0.3/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.3/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.3/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:298:45: error: ambiguous overload for 'operator==' (operand types are 'JSONVar' and 'String')
  298 |     if (jconfig[jprop_configurationControl] ==
/home/user/.arduino15/packages/esp32/hardware/esp32/3.0.3/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.3/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

Sketch too large

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.

@stablestud
Copy link

stablestud commented Jul 27, 2024

What about using PlatformIO as official way?
What purpose has the current PlatformIO config file?

@mng2
Copy link

mng2 commented Oct 10, 2024

I just got my unit today and thought I'd share my experience setting up the build. I followed these instructions and was able to successfully compile on Ubuntu 22.04, Arduino IDE version 2.3.3. (Haven't tried flashing, maybe in a few days.)

There were a few differences, if I remember correctly.

  • I didn't use the json for the boards. The Boards Manager already had an entry for esp32 by Espressif.
  • I installed AirGradient library 3.1.9, I assume it goes with the code version in this repo.
  • I had to pip install pyserial.

@hestiahacker
Copy link
Author

It's been 4 months since my last comment in this thread, so I went back to see if this was silently fixed. I updated the arduino repo (this one), updated Arduino IDE to 2.3.3, updated to v3.1.13 of the AirGradent library (installed via the Arduino IDE's library manager). When I tried to verify the sketch, I got lots of new compilation errors.

So I spun up a fresh Debian 12 VM and tried the instructions @mng2 linked to a couple weeks ago.

git clone https://github.com/airgradienthq/arduino.git

wget https://downloads.arduino.cc/arduino-ide/arduino-ide_2.3.3_Linux_64bit.AppImage
chmod +x ./arduino-ide_2.3.3_Linux_64bit.AppImage 
./arduino-ide_2.3.3_Linux_64bit.AppImage 
# Install esp32 board by Expressif Systems, v 3.0.7 (I also found that no board manager URL was required)
# Install AirGradent library, v3.1.13
# File -> Open... Select ~/arduino/examples/OneOpenAir/OneOpenAir.ino
# Set board to "ESP32C3 Dev Module"
# Enable "USB CDC On Boot"
# Partition scheme "Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)"
# (All other settings mentioned in OneOpenAir.ino were already correct)
# Click the "Verify" button, observe compilation errors

If you run the same commands as above, it will demonstrate that the repo does not compile when following the documentation. This is as of commit 566f8a6 The compilation errors are related to headers not being included, or ambiguous operator overloads (full log of errors is below).

I'd love for one of the people who believe this to be incorrect to try exactly what is listed above using Debian 12. This should make sure we're on the same page, and if the problem turns out to somehow be Debian specific, we can go from there. I'd really love to help maintain the firmware, but it's challenging when it doesn't compile out of the box. Next time I'm at a machine where I can easily spin up an Ubuntu 22.04 VM, I'll try reproducing it over there as well.

errors that appear when trying to compile using the commands above
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp: In member function 'void Configuration::saveConfig()':
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:221:3: error: 'File' was not declared in this scope
  221 |   File file = SPIFFS.open(CONFIG_FILE_NAME, "w", true);
      |   ^~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:222:7: error: 'file' was not declared in this scope
  222 |   if (file && !file.isDirectory()) {
      |       ^~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp: In member function 'void Configuration::loadConfig()':
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:246:3: error: 'File' was not declared in this scope
  246 |   File file = SPIFFS.open(CONFIG_FILE_NAME);
      |   ^~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:247:7: error: 'file' was not declared in this scope
  247 |   if (file && !file.isDirectory()) {
      |       ^~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:256:5: error: 'SPIFFS' was not declared in this scope
  256 |     SPIFFS.format();
      |     ^~~~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp: In member function 'bool Configuration::begin()':
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgConfigure.cpp:333:8: error: 'SPIFFS' was not declared in this scope
  333 |   if (!SPIFFS.begin(true)) {
      |        ^~~~~~
/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:420:45: error: ambiguous overload for 'operator==' (operand types are 'JSONVar' and 'String')
  420 |     if (jconfig[jprop_configurationControl] ==
In file included from /home/user/.arduino15/packages/esp32/hardware/esp32/3.0.7/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.7/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.7/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.h:8:
/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:428:45: error: ambiguous overload for 'operator==' (operand types are 'JSONVar' and 'String')
  428 |     if (jconfig[jprop_configurationControl] ==
/home/user/.arduino15/packages/esp32/hardware/esp32/3.0.7/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.7/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:113:7: error: 'WiFi' was not declared in this scope
  113 |   if (WiFi.isConnected() == false) {
      |       ^~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgApiClient.cpp:121:3: error: 'WiFiClient' was not declared in this scope
  121 |   WiFiClient wifiClient;
      |   ^~~~~~~~~~
/home/user/Arduino/libraries/AirGradient_Air_Quality_Sensor/src/AgApiClient.cpp:124:20: error: 'wifiClient' was not declared in this scope
  124 |   if (client.begin(wifiClient, uri.c_str()) == false) {
      |                    ^~~~~~~~~~

exit status 1

Compilation error: exit status 1

@mng2
Copy link

mng2 commented Dec 2, 2024

@hestiahacker The instructions say to use the esp32 board package version 2.0.11. That may be what you are missing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants