From 209426a56a73bd557e83af69bbcdf7a22def000a Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Fri, 5 Apr 2019 11:08:33 +0200 Subject: [PATCH 1/2] bugfix cyclic.cpp (no senddata before reset) --- src/cyclic.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/cyclic.cpp b/src/cyclic.cpp index 3a35ad4a..eb3f9a99 100644 --- a/src/cyclic.cpp +++ b/src/cyclic.cpp @@ -75,7 +75,6 @@ void doHousekeeping() { "Memory full, counter cleared (heap low water mark = %d Bytes / " "free heap = %d bytes)", ESP.getMinFreeHeap(), ESP.getFreeHeap()); - SendPayload(COUNTERPORT, prio_high); // send data before clearing counters reset_counters(); // clear macs container and reset all counters get_salt(); // get new salt for salting hashes @@ -87,7 +86,6 @@ void doHousekeeping() { #ifdef BOARD_HAS_PSRAM if (ESP.getMinFreePsram() <= MEM_LOW) { ESP_LOGI(TAG, "PSRAM full, counter cleared"); - SendPayload(COUNTERPORT, prio_high); // send data before clearing counters reset_counters(); // clear macs container and reset all counters get_salt(); // get new salt for salting hashes From a1f095fe7e0a668e218c581880ef872320eb51a6 Mon Sep 17 00:00:00 2001 From: Verkehrsrot Date: Sat, 6 Apr 2019 11:36:07 +0200 Subject: [PATCH 2/2] BME280/BME680 documentation details added --- README.md | 2 +- src/hal/generic.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8b9b6579..8535f2dc 100644 --- a/README.md +++ b/README.md @@ -146,7 +146,7 @@ If you're using a device with OLED display, or if you add such one to the I2C bu # Sensors and Peripherals -You can add up to 3 user defined sensors. Insert sensor's payload scheme in [*sensors.cpp*](src/sensors.cpp). Bosch BME280 / BME680 environment sensors are supported. Enable *flag lib_deps_sensors* for your board in [*platformio.ini*](src/platformio.ini) and configure BME in board's hal file before build. If you need Bosch's proprietary BSEC libraray (e.g. to get indoor air quality value from BME680) further enable *build_flags_sensors*, which comes on the price of reduced RAM and increased build size. RTC DS3231, generic serial NMEA GPS, I2C LoPy GPS are supported, and to be configured in board's hal file. See [*generic.h*](src/hal/generic.h) for all options. +You can add up to 3 user defined sensors. Insert sensor's payload scheme in [*sensors.cpp*](src/sensors.cpp). Bosch BME280 / BME680 environment sensors are supported. Enable flag *lib_deps_sensors* for your board in [*platformio.ini*](src/platformio.ini) and configure BME in board's hal file before build. If you need Bosch's proprietary BSEC libraray (e.g. to get indoor air quality value from BME680) further enable *build_flags_sensors*, which comes on the price of reduced RAM and increased build size. RTC DS3231, generic serial NMEA GPS, I2C LoPy GPS are supported, and to be configured in board's hal file. See [*generic.h*](src/hal/generic.h) for all options and for proper configuration of BME280/BME680. Output of user sensor data can be switched by user remote control command 0x13 sent to Port 2. diff --git a/src/hal/generic.h b/src/hal/generic.h index 7511ffff..ae0c90bf 100644 --- a/src/hal/generic.h +++ b/src/hal/generic.h @@ -17,13 +17,22 @@ #define SPI_CS GPIO_NUM_5 // enable only if device has these sensors, otherwise comment these lines +// tutorial to connect BME sensor see here: +// https://sbamueller.wordpress.com/2019/02/26/paxcounter-mit-umweltsensor/ +// +// in platformio.ini append +// lib_deps = <...> ${common.lib_deps_sensors} +// for loading necessary libraries + // BME680 sensor on I2C bus #define HAS_BME 1 // Enable BME sensors in general #define HAS_BME680 GPIO_NUM_21, GPIO_NUM_22 // SDA, SCL #define BME680_ADDR BME680_I2C_ADDR_PRIMARY // connect SDIO of BME680 to GND + // BME280 sensor on I2C bus //#define HAS_BME 1 // Enable BME sensors in general //#define HAS_BME280 GPIO_NUM_21, GPIO_NUM_22 // SDA, SCL +//#define BME280_ADDR 0x76 // change to 0x77 depending on your wiring // user defined sensors //#define HAS_SENSORS 1 // comment out if device has user defined sensors