Skip to content

Commit

Permalink
Merge pull request #133 from kike-canaries/devel
Browse files Browse the repository at this point in the history
Devel
  • Loading branch information
hpsaturn authored Mar 4, 2022
2 parents fb83959 + dd118d6 commit 77a6c63
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 19 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# Air Quality Sensors Library

Generic sensor manager, abstractions and bindings of multiple sensors libraries: Honeywell, Plantower, Panasonic, Sensirion, etc. and CO2 sensors. Also it's handling others environment sensors. This library is for general purpose, but also is the sensors library base of [CanAirIO project](https://canair.io/docs).
Generic sensor manager, abstractions and bindings of multiple sensors [libraries](https://github.com/kike-canaries/canairio_sensorlib/blob/master/platformio.ini#L18-L34): Honeywell, Plantower, Panasonic, Sensirion, etc. and CO2 sensors. Also it's handling others environment sensors. This library is for general purpose, but also is the sensors library base of [CanAirIO project](https://canair.io/docs).

For developers also you can check the complete library documentation [here](http://hpsaturn.com/canairio_sensorlib_doc/html/index.html)

Expand Down Expand Up @@ -291,7 +291,7 @@ Only import the `ino` file of the sample and install the libraries listed on `li

#### Prerequisites

For run the examples, you first need to install **arduino-cli** or the **Arduino IDE** with the libraries referenced in **lib_deps** on the file [platformio.ini](https://github.com/kike-canaries/canairio_sensorlib/blob/fix_ondataready_cb/platformio.ini), becuase **Arduino don't install it automatically** like PlatformIO. Then put CanAirIO sensor library in your library directory, you can download it from [releases](https://github.com/kike-canaries/canairio_sensorlib/releases) section.
For run the examples, you first need to install **arduino-cli** or the **Arduino IDE** with the libraries referenced in **lib_deps** on the file [platformio.ini](https://github.com/kike-canaries/canairio_sensorlib/blob/master/platformio.ini), becuase **Arduino don't install it automatically** like PlatformIO. Then put CanAirIO sensor library in your library directory, you can download it from [releases](https://github.com/kike-canaries/canairio_sensorlib/releases) section.

Also you need to add the **alternative links** for supporting the ESP32 boards:

Expand Down
7 changes: 3 additions & 4 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.5.3",
"version": "0.5.4",
"homepage":"https://canair.io",
"keywords":
[
Expand Down Expand Up @@ -41,7 +41,6 @@
"frameworks": ["espidf", "freertos", "arduino"],
"platforms":
[
"atmelavr",
"teensy",
"espressif32",
"espressif8266"
Expand Down Expand Up @@ -78,9 +77,9 @@
{"name":"Adafruit BME280 Library", "owner":"adafruit","version":"2.2.2"},
{"name":"Adafruit BMP280 Library", "owner":"adafruit","version":"2.6.1"},
{"name":"Adafruit BME680 Library","owner":"adafruit","version":"2.0.1"},
{"name":"Adafruit BusIO", "owner":"adafruit","version":"1.11.0"},
{"name":"Adafruit BusIO", "owner":"adafruit","version":"1.11.1"},
{"name":"Adafruit SHT31 Library", "owner":"adafruit","version":"2.0.0"},
{"name":"AM232X", "owner":"robtillaart", "version":"0.4.0"},
{"name":"AM232X", "owner":"robtillaart", "version":"0.4.1"},
{"name":"AHT10", "owner":"enjoyneering","version":"1.1.0"},
{"name":"sps30", "owner":"paulvha","version":"1.4.12"},
{"name":"MH-Z19", "owner":"wifwaf", "version":"1.5.3"},
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.5.3
version=0.5.4
author=@hpsaturn, CanAirIO project <[email protected]>
maintainer=Antonio Vanegas <[email protected]>
url=https://github.com/kike-canaries/canairio_sensorlib
Expand Down
16 changes: 13 additions & 3 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ lib_deps =
adafruit/Adafruit BME280 Library @ 2.2.2
adafruit/Adafruit BMP280 Library @ 2.6.1
adafruit/Adafruit BME680 Library @ 2.0.1
adafruit/Adafruit BusIO @ 1.11.0
adafruit/Adafruit BusIO @ 1.11.1
adafruit/Adafruit SHT31 Library @ 2.0.0
robtillaart/AM232X @ 0.4.0
robtillaart/AM232X @ 0.4.1
enjoyneering/AHT10 @ 1.1.0
paulvha/sps30 @ 1.4.12
wifwaf/MH-Z19 @ 1.5.3
Expand Down Expand Up @@ -53,7 +53,6 @@ build_flags =
lib_deps =
${env.lib_deps}


[arduino_avr]
platform = atmelavr
board = pro16MHzatmega328
Expand All @@ -80,6 +79,17 @@ src_filter = -<*> +<platformio/>
extends = esp32_common
src_filter = -<*> +<advanced_multivariable/>

; [env:teensy36]
; platform = teensy
; framework = arduino
; board = teensy36
; upload_speed = ${env.upload_speed}
; monitor_speed = ${env.monitor_speed}
; lib_deps = ${env.lib_deps}
; build_flags =
; ${env.build_flags}
; -D TEENSY_OPT_SMALLEST_CODE

;[env:arduino]
;extends = arduino_avr
;src_filter = -<*> +<platformio/>
7 changes: 0 additions & 7 deletions src/Sensors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -722,11 +722,6 @@ bool Sensors::sps30Read() {
if (!isSensorRegistered(SENSORS::SSPS30)) return false;
uint8_t ret, error_cnt = 0;
delay(35); //Delay for sincronization

if(i2conly && sample_time > 30) {
if (!sps30.start()) return false; // power saving validation
delay(15000);
}

do {
ret = sps30.GetValues(&val);
Expand Down Expand Up @@ -754,8 +749,6 @@ bool Sensors::sps30Read() {
unitRegister(UNIT::PM4);
unitRegister(UNIT::PM10);

if(i2conly && sample_time > 30) sps30.stop(); // power saving validation

if (pm25 > 1000 && pm10 > 1000) {
onSensorError("[W][SLIB] SPS30 setup message \t: out of range pm25 > 1000");
return false;
Expand Down
9 changes: 7 additions & 2 deletions src/Sensors.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
#include <s8_uart.h>
#include <sps30.h>

#define CSL_VERSION "0.5.3"
#define CSL_REVISION 356
#define CSL_VERSION "0.5.4"
#define CSL_REVISION 357

/***************************************************************
* S E T U P E S P 3 2 B O A R D S A N D F I E L D S
Expand Down Expand Up @@ -64,6 +64,11 @@
#define PMS_RX 23
#define PMS_TX 33
#define DHT_SENSOR_PIN 19
#elif M5PICOD4
#define PMS_RX 3
#define PMS_TX 1
#define DHT_SENSOR_PIN 19

#else // **DEFAULT** for legacy CanAirIO devices:
#define PMS_RX 17 // D1MIN1 / TTGOT7 / ESP32DEVKIT, also for main ESP32 dev boards use it
#define PMS_TX 16
Expand Down

0 comments on commit 77a6c63

Please sign in to comment.