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

Devel #207

Merged
merged 51 commits into from
Jan 18, 2025
Merged

Devel #207

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
0ab605e
added Telegram badge for support community
hpsaturn Feb 13, 2024
6da7201
Fix CO2scd30Init() function.
melkati Feb 16, 2024
8511eac
Add debug statement for SCD30 temperature offset in CO2scd30Init()
melkati Feb 16, 2024
4232934
Do sensorRegister(SENSORS::SSCD4x) prior to seeting offsets.
melkati Feb 19, 2024
0482305
Add temperature offset getter for Sensirion sensors
melkati Feb 20, 2024
c18bd12
Fix temperature offset getters for SCD4x and SCD30 sensors
melkati Feb 20, 2024
93180ee
Fix getTempOffset function declaration in Sensors class
melkati Feb 20, 2024
7b22bed
Merge branch 'kike-canaries:master' into fixOffset
melkati Feb 20, 2024
6d188f9
Refactor getTempOffset function to check if sensor is registered
melkati Feb 21, 2024
45ddbb0
Merge branch 'fixOffset' of https://github.com/melkati/canairio_senso…
melkati Feb 21, 2024
622ff0b
Merge pull request #204 from melkati/fixOffset
hpsaturn Feb 21, 2024
cbb19df
Add internal temperature offset initialization and retrieval methods
melkati Feb 27, 2024
2882fca
Merge pull request #205 from melkati/fixOffset
hpsaturn Feb 27, 2024
711acff
Merge pull request #206 from kike-canaries/fix_203_toffset
hpsaturn Mar 6, 2024
97c0d11
added basic and initial support for M5AirQ SCD40 sensor
hpsaturn Mar 7, 2024
e0fa841
removed Wire initialization. The user should do that. Please check!
hpsaturn Mar 7, 2024
ba50613
fixed SEN5X init issue (bad pin level choosed)
hpsaturn Mar 7, 2024
9b38f52
fixed issue on sen5x read. Added startMeasure call
hpsaturn Mar 7, 2024
d19b2dd
clang format and minors refators
hpsaturn Mar 7, 2024
130b126
removed unnecesary libraries
hpsaturn Mar 7, 2024
540ed6f
added missing variables from sen5x sensor. New units: voci and noxi
hpsaturn Mar 7, 2024
375a48a
fixed some clang issues
hpsaturn Mar 7, 2024
689712b
improved i2c init for M5AIRQ variant
hpsaturn Mar 8, 2024
b605255
Merge pull request #208 from kike-canaries/m5AirQS3
hpsaturn Mar 8, 2024
7b65fc0
Merge branch 'devel' of github.com:kike-canaries/canairio_sensorlib i…
hpsaturn Mar 23, 2024
e937396
removed old Travis Badge
hpsaturn Jun 1, 2024
25a1bcd
testing Serial0 and Generic driver for Airgradient. Works
hpsaturn Jun 3, 2024
9045759
fixed issue on S8 UART library. Thanks to @jcomas
hpsaturn Jun 13, 2024
d840280
fixed CI issue on M5Atom test
hpsaturn Jun 13, 2024
17acd44
fixes clang CI issues
hpsaturn Jun 13, 2024
d96782d
Merge pull request #209 from kike-canaries/air_gradient_drivers
hpsaturn Jun 13, 2024
d8e4975
added define globas for airgradient i2c pins.
hpsaturn Sep 14, 2024
ed476b9
initial implementation for SGP41 sensor (untested)
hpsaturn Sep 14, 2024
8bb5505
fixed some debug message issues
hpsaturn Sep 14, 2024
518228c
fixed some clang format issues
hpsaturn Sep 14, 2024
319b33c
added original driver from Airgradient for PMS5003T sensor
hpsaturn Sep 16, 2024
8deb1ab
removed missing references and some link fixes
hpsaturn Sep 17, 2024
a498293
fixed link issues for esp32 families. Pending esp8266 and atmel
hpsaturn Sep 17, 2024
28ce5f0
fixed issues for atmelsam and esp8266. (untested on real hw)
hpsaturn Sep 17, 2024
a3edd26
unified Serial schema for HardwareSerial reference
hpsaturn Sep 18, 2024
b198b5c
added read implementation for pms5003t
hpsaturn Sep 18, 2024
fe317d2
fixed issue on Serial initialization and added missing units
hpsaturn Sep 19, 2024
0b216f3
fixed some clang issues and removed warnning with ms init
hpsaturn Sep 20, 2024
4c8c8ff
missing clang fixes
hpsaturn Sep 20, 2024
fbbcf94
Merge pull request #211 from kike-canaries/improv_pms5003t
hpsaturn Sep 20, 2024
9598d14
Merge pull request #210 from kike-canaries/air_gradient_drivers
hpsaturn Sep 20, 2024
23b1acf
missing init and read methods calls for sgh41
hpsaturn Oct 4, 2024
666c236
now the default TX/RX pina are -1,-1. If not pass it on init
hpsaturn Jan 12, 2025
0400dca
Merge pull request #212 from kike-canaries/fix_uart_c3_generic
hpsaturn Jan 13, 2025
6f57d13
fixed issues with Python version on CI workflow
hpsaturn Jan 18, 2025
40d11ad
Merge pull request #213 from kike-canaries/fix_ci_issues
hpsaturn Jan 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 13 additions & 12 deletions .github/workflows/platformio.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,23 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
matrix:
python-version: [3.7]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
python-version: ${{ matrix.python-version }}
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -34,12 +40,7 @@ jobs:
- name: Basic Arduino IDE example test
run: |
cd examples/advanced_sensirion
pio run
- name: PlatformIO registry backward (M5CoreInk project)
run: |
git clone https://github.com/hpsaturn/co2_m5coreink.git
cd co2_m5coreink
pio run
pio run
- name: PlatformIO registry lastest (M5Atom project)
run: |
cd examples/m5atom
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
name: Schedule


on:
schedule:
- cron: '30 10 * * 3'

jobs:
build:
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 1
matrix:
python-version: [3.7]
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
- uses: actions/checkout@v4
- uses: actions/cache@v3
with:
python-version: ${{ matrix.python-version }}
path: |
~/.cache/pip
~/.platformio/.cache
key: ${{ runner.os }}-pio
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

[![PlatformIO](https://github.com/kike-canaries/canairio_sensorlib/workflows/PlatformIO/badge.svg)](https://github.com/kike-canaries/canairio_sensorlib/actions/) [![Build Status](https://travis-ci.com/kike-canaries/canairio_sensorlib.svg?branch=master)](https://travis-ci.com/kike-canaries/canairio_sensorlib.svg?branch=master) ![ViewCount](https://views.whatilearened.today/views/github/kike-canaries/canairio_sensorlib.svg)
[![PlatformIO](https://github.com/kike-canaries/canairio_sensorlib/workflows/PlatformIO/badge.svg)](https://github.com/kike-canaries/canairio_sensorlib/actions/) ![ViewCount](https://views.whatilearened.today/views/github/kike-canaries/canairio_sensorlib.svg) [![Telegram Group](https://img.shields.io/endpoint?color=neon&style=flat-square&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fcanairio)](https://t.me/canairio)

# Air Quality Sensors Library

Expand Down
32 changes: 32 additions & 0 deletions examples/m5airq/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[platformio]
src_dir = .
lib_dir = ../..
extra_configs = ../../unified-lib-deps.ini

[env]
framework = arduino
upload_speed = 1500000
monitor_speed = 115200
build_flags =
-D CORE_DEBUG_LEVEL=0
-D ARDUINO_USB_CDC_ON_BOOT=1
-D ARDUINO_ESP32_DEV=1
-D M5AIRQ=1 ; in your implementation you NEED it (it will improved in the future)
lib_deps =
${commonlibs.lib_deps}

[env:m5airq]
extends = env
platform = espressif32
board = esp32-s3-devkitc-1
board_build.filesystem = littlefs ; compatibility with original demo firmware
96 changes: 96 additions & 0 deletions examples/m5airq/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/**
* @file main.cpp
* @author Antonio Vanegas @hpsaturn
* @date June 2018 - 2024
* @brief CanAirIO M5AirQ test
* @license GPL3
*
* Full documentation:
* https://github.com/kike-canaries/canairio_sensorlib#canairio-air-quality-sensors-library
*
* Full implementation for WiFi and Bluetooth Air Quality fixed and mobile station:
* https://github.com/kike-canaries/canairio_firmware#canairio-firmware
*
* CanAirIO project documentation:
* https://canair.io/docs
*/

#include <Arduino.h>

#include <Sensors.hpp>

#define POWER_HOLD 46 // M5AirQ main board
#define SEN55_POWER_EN 10

#define GROVE_SDA 13
#define GROVE_SCL 15

#define I2C1_SDA_PIN 11
#define I2C1_SCL_PIN 12

void printSensorsDetected() {
uint16_t sensors_count = sensors.getSensorsRegisteredCount();
uint16_t units_count = sensors.getUnitsRegisteredCount();
Serial.println("-->[MAIN] Sensors detected \t: " + String(sensors_count));
Serial.println("-->[MAIN] Sensors units count\t: " + String(units_count));
Serial.print("-->[MAIN] Sensors devices names\t: ");
int i = 0;
while (sensors.getSensorsRegistered()[i++] != 0) {
Serial.print(sensors.getSensorName((SENSORS)sensors.getSensorsRegistered()[i - 1]));
Serial.print(",");
}
Serial.println();
}

void printSensorsValues() {
Serial.println("-->[MAIN] Preview sensor values :");
UNIT unit = sensors.getNextUnit();
while (unit != UNIT::NUNIT) {
String uName = sensors.getUnitName(unit);
float uValue = sensors.getUnitValue(unit);
String uSymb = sensors.getUnitSymbol(unit);
Serial.printf("-->[MAIN] %6s:\t%02.1f\t%s\n", uName.c_str(), uValue, uSymb.c_str());
unit = sensors.getNextUnit();
}
}

void onSensorDataOk() {
Serial.println("======= E X A M P L E T E S T =========");
printSensorsDetected();
printSensorsValues();
}

void onSensorDataError(const char* msg) {}
/******************************************************************************
* M A I N
******************************************************************************/

void powerEnableSensors() {
Serial.println("-->[POWR] == enable sensors ==");
pinMode(POWER_HOLD, OUTPUT);
digitalWrite(POWER_HOLD, HIGH);
pinMode(SEN55_POWER_EN, OUTPUT);
digitalWrite(SEN55_POWER_EN, LOW);
}

void setup() {
Serial.begin(115200);
delay(2000); // Only for debugging
powerEnableSensors(); // M5AirQ enable sensors

delay(100);
Serial.println("\n== Sensor test setup ==\n");
Serial.println("-->[SETUP] Detecting sensors..");

sensors.setSampleTime(10); // config sensors sample time interval
sensors.setOnDataCallBack(&onSensorDataOk); // all data read callback
sensors.setDebugMode(false); // [optional] debug mode
sensors.detectI2COnly(true); // not force to only i2c sensors
sensors.setTemperatureUnit(TEMPUNIT::CELSIUS); // comment for Celsius or set Fahrenheit
sensors.init(); // Auto detection (UART and i2c sensors)
delay(1000);
}

void loop() {
sensors.loop(); // read sensor data and showed it
}
2 changes: 1 addition & 1 deletion examples/m5atom/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@ build_flags =
lib_deps =
hpsaturn/CanAirIO Air Quality Sensors Library @ 0.7.4
fastled/FastLED@^3.5.0
m5stack/M5Atom@^0.0.7
m5stack/M5Atom@^0.1.2
5 changes: 3 additions & 2 deletions library.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "CanAirIO Air Quality Sensors Library",
"version": "0.7.4",
"version": "0.7.5",
"homepage":"https://canair.io",
"keywords":
[
Expand Down Expand Up @@ -86,10 +86,11 @@
{"name":"AM232X", "owner":"robtillaart", "version":"0.5.0"},
{"name":"sps30", "owner":"paulvha","version":"1.4.17"},
{"name":"MH-Z19", "owner":"wifwaf", "version":"1.5.4"},
{"name":"S8_UART", "owner":"jcomas", "version":"1.0.1"},
{"name":"S8_UART", "owner":"jcomas", "version":"1.0.2"},
{"name":"Sensirion Core","owner":"sensirion","version":"0.6.0"},
{"name":"Sensirion I2C SCD4x","owner":"sensirion","version":"0.4.0"},
{"name":"Sensirion I2C SEN5X","owner":"sensirion","version":"0.3.0"},
{"name":"Sensirion I2C SGP41","owner":"sensirion","version":"1.0.0"},
{"name":"DFRobot_MultiGasSensor","owner":"phzi","version":"2.0.0"},

{"name":"AHTxx", "version":"https://github.com/enjoyneering/AHTxx.git#eb21571"},
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=CanAirIO Air Quality Sensors Library
version=0.7.4
version=0.7.5
author=@hpsaturn, CanAirIO project <[email protected]>
maintainer=Antonio Vanegas <[email protected]>
url=https://github.com/kike-canaries/canairio_sensorlib
Expand Down
Loading
Loading