AirGradient Forum

Compilation error: Libraries/airgradient-client/src/common.h: No such file or directory

@ Achim
When I try to compile the Example file "OneOpenAir.ino " under the AirGradient Air Quality Sensor with Arduino IDE 2.3.6, I get this error and check the folder path it does not found the file “command.h.”

Compilation error: Libraries/airgradient-client/src/common.h: No such file or directory

/private/var/folders/6_/_05frmsx38d7jxd95rp2d1300000gn/T/.arduinoIDE-unsaved2025327-73744-17pca5l.37al/OneOpenAir/OneOpenAir.ino:39:10: fatal error: Libraries/airgradient-client/src/common.h: No such file or directory
39 | #include “Libraries/airgradient-client/src/common.h”
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1

Anybody having an idea to fix this?

Are you trying to make changes to any of the custom libraries, or just trying to compile it yourself?

If not modifying the custom libraries, then you probably just need to install the Library. Check Step 2 here:
arduino/docs/howto-compile.md at master · airgradienthq/arduino · GitHub

Or if you want the latest code available for your modification, then use the second part of Step 2 that starts with “Version >= 3.3.0” which shows where to clone the repo to the correct Libraries folder on your computer, which will also address the error you are getting and allow you to make changes in that directory so you can compile your own modified code

@MallocArray

Are you trying to make changes to any of the custom libraries, or just trying to compile it yourself?
No, I do not make changes to any of the custom libraries. Yes, I just try to compile it.

If not modifying the custom libraries, then you probably just need to install the Library. Check Step 2 here:
arduino/docs/howto-compile.md at master · airgradienthq/arduino · GitHub
I downgrade arduino-esp32 which is 3.x. to version 2.0.17
I downgrade Airgradient libraries from v3.3.6 to v3.2.0 and compile it with no errors detected.

I uninstalled Airgradient libraries from v 3.2.0 and prepared to upgrade to V3.3.0 with Git Clone the files again.

From my terminal, go to the Arduino libraries folder (windows and mac: Documents/Arduino/libraries).
With git cli, execute this command git clone --recursive GitHub - airgradienthq/arduino: Firmware of open-source hardware air quality monitors AirGradient ONE (indoor) and AirGradient Open Air (outdoor). AirGradient_Air_Quality_Sensor
It failed to clone the files, it seems I do not have the correct access rights, then it compiled with the same errors of missing “command.h”

I stay on libraries v3.2.0 then the compile process completes with no errors.
Any idea of the git file issue?

Alan

Downgrading the ESP32 package to 2.0.17 is documented as a requirement as their development platform only supports the 2.x line.

The AirGradient library section could use some improvement, as they mention specific versions, but really it all comes down to if you want to use the version that is published, then you can install them from the Library Manager with no issue. So where the documentation says 3.2.0 should really be the latest available, which is currently 3.3.6. So if that is the version you want to use, then you don’t need to mess with git at all.

Regarding your git issue, it would be helpful to see the exact error that git gave you to know what is going on, and what folder you were in when trying to run the git clone command, as it is expecting you to be in your library folder already. This changes depending on Windows, Mac, or Linux.

But if you just want the latest firmware, you can avoid compiling at all and use this link to get the latest released firmware installed, which is 3.3.6
AirGradient ONE (I-9PSL) and Open Air (O-1PST) Firmware Versions


@MallocArray
I attached screen shot of the error during using git to clone the files. I have changed the folder to Libraries under the Document/Arduino/Libraries before the Git process. I have deleted the AirGradient libraries before the git process.

I also get the same thing in Windows.

Remove the --recursive part of the command and then it should work

Thanks for your updates and findings !!

So they recently added some new libraries that look to be links to other Github repositories and that is where the recursive requirement is coming from, but that process is failing.

I opened an Incident on the main repo to let them know and hopefully get a better solution
symlinks to other Library repos failing to clone recursively · Issue #307 · airgradienthq/arduino

Without the repository flag, you’ll have 2 folders that are blank so you’ll probably get compile errors even now, so not a perfect solution at this time
AirGradient_Air_Quality_Sensor\src\Libraries\airgradient-ota
AirGradient_Air_Quality_Sensor\src\Libraries\airgradient-client

Thank for your explanation in details, I am not a programmer but I am understand it clearly.
Hope the solution will be fixed soon.