airgradient-prometheus icon indicating copy to clipboard operation
airgradient-prometheus copied to clipboard

SGP41 sensor support

Open falkecarlsen opened this issue 2 years ago • 1 comments

AirGradient library does not yet support this module, so I have made a best-effort implementation and some housekeeping.

  • Adds support and error handling for SGP41 module with compensation based on measured SHT values.
  • Moves from SSD1306Wire display library to U8g2lib, as the reference implementation has nicer support for three-line legible display of metrics without cycling. Also seems to have out-of-the-box support for the SH1106 displays shipped with pre-PRO edition kits. 3 by 2, static display of metrics in my opinion superior, as you need not wait for the metric you want, to be shown.
  • Adds flag to enable AQI conversion based on PM2.5 to be shown on display, PM2.5 is regardless the metric reported.
  • Adds verbose flag to debug readings but not otherwise spam serial when in production. Errors are always printed. Spurious address is printed from AirGradient library every SHT-sample though.

I would appreciate a person with a SSD1306 display testing whether the U8g2lib works as expected.

falkecarlsen avatar Oct 02 '23 18:10 falkecarlsen

@geerlingguy this PR might require some changes to https://github.com/geerlingguy/internet-pi setup of Prometheus to allow for catching the two additional metrics, and addition of gauges/graphs for the Grafana dashboard. I found templates/airgradient-air-quality.json.j2 in the internet-pi repo which seems a serialised version of some configuration, I would appreciate some help in generating this correctly.

falkecarlsen avatar Oct 02 '23 18:10 falkecarlsen

This pr has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

github-actions[bot] avatar Feb 09 '24 02:02 github-actions[bot]

@geerlingguy please advice what you think next steps are. Firmware running without issue in my AG since PR submission.

falkecarlsen avatar Feb 10 '24 19:02 falkecarlsen

@falkecarlsen - Hmm... after merge, the arduino library tests are failing with a number of compile errors: https://github.com/geerlingguy/airgradient-prometheus/actions/runs/7892739782/job/21539886224

geerlingguy avatar Feb 14 '24 03:02 geerlingguy

@falkecarlsen - Hmm... after merge, the arduino library tests are failing with a number of compile errors: https://github.com/geerlingguy/airgradient-prometheus/actions/runs/7892739782/job/21539886224

Due to major bump in AirGradient library. Fix in #44.

falkecarlsen avatar Feb 14 '24 09:02 falkecarlsen