-
Notifications
You must be signed in to change notification settings - Fork 116
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
Comments
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.
|
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 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 Please follow instruction begin of file: arduino/examples/OneOpenAir/OneOpenAir.ino Lines 12 to 27 in 8a83e40
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.
|
You're missed |
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 compileI 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.
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 documentationWe 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:
From comments in the source code we see: Set board to "ESP32C3 Dev Module" arduino/examples/OneOpenAir/OneOpenAir.ino Lines 20 to 21 in 8a83e40
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
|
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).
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 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, @pnt325 @airgradienthq To flash the device I do:
|
Additionally I added the following entries to the
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. |
You can find it on Arduino libraries with name |
Hello @pnt325 I feel like there's been a miscommunication here. There are two issues that have not been answered.
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. |
@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. Three compilation errorsWiFi not defined
I don't understand how this is compiling on your machine. Ambiguous overload
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
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. DetailsHere are all the details of the compiler errors when trying to compile the master branch Compiler errors
Sketch too largeThis 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? |
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.
|
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
|
@hestiahacker The instructions say to use the esp32 board package version |
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:
The text was updated successfully, but these errors were encountered: