Comments (13)
Oh, interesting - looks like the PMS::DATA
declaration that is being referred to is in your own AirGradient.h
here.
from arduino.
Trying to remove the PMS.h
include and instead replace it with AirGradient.h
doesn't compile:
/home/stevekuznetsov/Arduino/libraries/AirGradient_Air_Quality_Sensor/AirGradient.h:10:10: fatal error: SoftwareSerial.h: No such file or directory
#include <SoftwareSerial.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
exit status 1
Error compiling for board LOLIN C3 Mini
Doesn't look like there's a SoftwareSerial
for the board?
from arduino.
Aaah ... perhaps this is what I need? It is mentioned on the outdoor sensor guide but not on the ONE V9 one.
from arduino.
Did you manage to compile it ?
In order to have the data stored locally I use dnsmasq and fake the IP for hw.airgradient.com to a local IP - I noticed the Arduino client does not respect TTL and I see dns queries every 10 sec for over 8K per day :) Once I can compile it, will switch to an IP to avoid the DNS query.
Here are some other general suggestions to people that might be reading this - the WifiManager allows for custom config fields - it might be a good place to set some general options e.g. the LEDs.
In addition, when the device is connected to a computer with a USB-C for firmware update it would be easy to have a serial menu that the user can interact with - the web flasher has a console option so it would be few lines of simple code - I found pressing the button on the unit difficult when looking at the screen - had to take it apart and hold my finger on the button to press it at the exact right moment (2 sec. window ) - have a console based setup menu would solve this.
from arduino.
@bluesky-ca yes! Sorry - I linked PR #35 here - that was what I ended up doing, with those steps it compiled. I contacted the maintainers to see if they will merge that PR.
from arduino.
Searching for "PMS Library" find the original but it also matches one from airgradient - did you try that one to see if they patched the original one, or one needs to patch the original as they mention in their blog post:
Name: "AirGradient Air Quality Sensor"
Author: AirGradient [email protected]
Maintainer: AirGradient [email protected]
Sentence: ESP8266 library for an air quality sensor featuring PM2.5, CO2, Temperature, TVOC and Humidity with OLED display.
Paragraph: Air quality monitoring library supporting the Plantower PMS5003 particle sensor, the Senseair S8 CO2 sensor and the SHT3x/SHT4x sensor for humidity and temperature. Kits with all components including a nice enclosure are available in our online shop. You can also connect an OLED display or send the air quality data to the AirGradient platform or any other backend. Optionally you can connect the Sensirion SGP4x TVOC module from AirGradient.
Website: https://www.airgradient.com/open-airgradient/instructions/
Category: Sensors
Architecture: *
Types: Contributed
Versions: [1.0.0, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.3.5, 1.4.1, 1.4.2, 2.0.0, 2.0.2, 2.1.0, 2.2.0, 2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.4.6, 2.4.7, 2.4.11, 2.4.12]
If this lib is the correct that would change the additional libs to:
"S8_UART"
"AirGradient Air Quality Sensor"
This would be simpler and not require patching the .h file.
from arduino.
You need the patched PMS Library as described here, as far as I could tell. Achim said they are in the middle of rewriting a bunch of this so I am not sure if that will be correct moving forward, it's just what worked for me.
from arduino.
I was able to compile it ( thanks for all your work in getting the info together ) but only when I set the fqbn to esp32:esp32:XIAO_ESP32C3 - if I connect AirG. or any other C3 board I have and run: arduino-cli board list for all of them I get:
/dev/ttyACM0 serial Serial Port (USB) DFRobot Beetle ESP32-C3 esp32:esp32:dfrobot_beetle_esp32c3 esp32:esp32
Using fqbn with esp32:esp32:dfrobot_beetle_esp32c3 ( or esp32:esp32:esp32c3m1IKit or esp32:esp32:esp32c3 ) fails to compile as there is no definition for Serial0 - should arduino-cli board list work and return a correct fqbn or is there a better way ?
Related to ONE_V9.ino I think the includes should be #include <PMS.h> #include <s8_uart.h> to make it obvious that the two files are not local to the project - compile works with "PMS.h" or <PMS.h>
from arduino.
In order to have the data stored locally I use dnsmasq and fake the IP for hw.airgradient.com to a local IP - I noticed the Arduino client does not respect TTL and I see dns queries every 10 sec for over 8K per day :) Once I can compile it, will switch to an IP to avoid the DNS query.
What settings did you use for the DNS record? I have a local record in dnsmasq and it works just fine with the TTL
/etc/dnsmasq.d/10-local-domains.conf
host-record=pi.internal,192.168.0.10,900
cname=airgradient.internal,pi.internal,900
from arduino.
I have been using a fake host method with addn-hosts=/etc/hosts.fake and min-cache-ttl=60 - I have very few hosts defined there as I use pi-hole to resolve most hosts, but looks like the fake host method is not applying TTL based on your comment - I will check it out - thanks for the tip.
One thing about the addn-hosts is that you can use wildcard - it allows with one line to match all hosts of a domain, which can be useful ( I used this before setting up pi-hole ).
Based on your dns name using airgradient.internal I assume you recompiled the firmware and changed it from hw.airgradient.com - what value did you use for fqbn ?
from arduino.
Fqbn seems to be specific to the Arduino IDE. I'm using PlatformIO and set the board to lolin_c3_mini.
Maybe there is something similar in Arduino.
See here:
https://github.com/lschloetterer/airgradient-one-v9
from arduino.
Thanks - lolin_c3_mini is there and I have used it to compile it, but if you look at the pin file I am not sure if the definitions match the schematic of the AirGradient - given that your setup works fine that implies that they defined all pins in the code and don't use default values - the problem comes when compiling code and assuming defaults e.g. default SPI pins when connected to a TFT display - I run into this problem and now create custom pin files for any boards I purchase from AliExpress :-)
I only have arduino-cli installed as I am trying to duplicate the old portable setup from v1 - in v2 of the IDE I believe the portable feature is not working, so with the cli version I can have a custom arduino-cli.yaml with custom locations.
from arduino.
Closing this as the branch now has instructions.
from arduino.
Related Issues (20)
- LED inconsistency | Firmware v. 3.1.1 HOT 6
- Add boot to keep HA integration compatability HOT 1
- Unable to change configurationControl HOT 6
- Low temperature reading from PMS5003T HOT 2
- Configuration always save configure on power up
- firmware versions and relevant boards HOT 1
- Interest in Github Action for Arduino Compile? HOT 1
- Implement Correction Formula for PM2.5 on Display
- Home Assistant Integration - stuck on already_in_progress if AirGradient is initially inaccessible HOT 2
- PCB 4.3: Missing raw values for tvocRaw and noxRaw
- PCB 4.3: Wrong model name HOT 3
- PCB 4.3: Boot loop if not connected to Dashboard HOT 1
- Firmware 3.1.3 WiFi not reconnecting on power failure HOT 1
- PCB 3.3 sometimes not recognizing SHT HOT 2
- Rename Example File DiyIndoorProV3_7 HOT 2
- Ignore parameter values out of range HOT 6
- Timeout handling HOT 3
- MQTT over TLS fails with "esp-tls-mbedtls: No server verification option..."
- Use HTPPS Endpoints
- Error message "firmware update fail, will retry" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from arduino.