|
@ -51,8 +51,10 @@ uint32_t loop_count = 0; |
|
|
#define SENSOR1_ID "5a9e9e38f55bff001a49487e" |
|
|
#define SENSOR1_ID "5a9e9e38f55bff001a49487e" |
|
|
// Humidity
|
|
|
// Humidity
|
|
|
#define SENSOR2_ID "5a9e9e38f55bff001a49487d" |
|
|
#define SENSOR2_ID "5a9e9e38f55bff001a49487d" |
|
|
// Pressure
|
|
|
// Pressure (sea-level)
|
|
|
#define SENSOR3_ID "5a9e9e38f55bff001a49487c" |
|
|
#define SENSOR3_ID "5a9e9e38f55bff001a49487c" |
|
|
|
|
|
// Pressure RAW
|
|
|
|
|
|
#define SENSOR9_ID "5d12233630bde6001adf6092" |
|
|
// PM10
|
|
|
// PM10
|
|
|
#define SENSOR4_ID "5a9e9e38f55bff001a49487b" |
|
|
#define SENSOR4_ID "5a9e9e38f55bff001a49487b" |
|
|
// PM2.5
|
|
|
// PM2.5
|
|
@ -75,7 +77,7 @@ static constexpr uint8_t SDS_TX = D1; |
|
|
static constexpr uint8_t SDS_RX = D2; |
|
|
static constexpr uint8_t SDS_RX = D2; |
|
|
|
|
|
|
|
|
static constexpr uint8_t GEIGER_PIN = D6; |
|
|
static constexpr uint8_t GEIGER_PIN = D6; |
|
|
static constexpr float CONV_FACTOR = 0.008120; |
|
|
static constexpr float CONV_FACTOR = 0.008120 / 2.5; |
|
|
static constexpr float OWN_BACKGROUND_CPS = 0; // documentation says 0.2 (make sure value doesn't get negative if subtracting!)
|
|
|
static constexpr float OWN_BACKGROUND_CPS = 0; // documentation says 0.2 (make sure value doesn't get negative if subtracting!)
|
|
|
|
|
|
|
|
|
#ifndef EXTERNAL_POWER |
|
|
#ifndef EXTERNAL_POWER |
|
@ -156,8 +158,11 @@ void ICACHE_FLASH_ATTR getValuesJSON(char* buffer, const size_t buf_len, int for |
|
|
humidityObject["sensor"] = SENSOR2_ID; |
|
|
humidityObject["sensor"] = SENSOR2_ID; |
|
|
humidityObject["value"] = sd.humidity; |
|
|
humidityObject["value"] = sd.humidity; |
|
|
JsonObject pressureObject = array.createNestedObject(); |
|
|
JsonObject pressureObject = array.createNestedObject(); |
|
|
pressureObject["sensor"] = SENSOR3_ID; |
|
|
pressureObject["sensor"] = SENSOR9_ID; |
|
|
pressureObject["value"] = sd.pressure; |
|
|
pressureObject["value"] = sd.pressure; |
|
|
|
|
|
JsonObject pressureObject2 = array.createNestedObject(); |
|
|
|
|
|
pressureObject2["sensor"] = SENSOR3_ID; |
|
|
|
|
|
pressureObject2["value"] = sd.pressure+16; |
|
|
if (sd.sds_updated) { |
|
|
if (sd.sds_updated) { |
|
|
JsonObject pm10Object = array.createNestedObject(); |
|
|
JsonObject pm10Object = array.createNestedObject(); |
|
|
pm10Object["sensor"] = SENSOR4_ID; |
|
|
pm10Object["sensor"] = SENSOR4_ID; |
|
@ -409,7 +414,7 @@ void setup() { |
|
|
//wifi_status_led_uninstall();
|
|
|
//wifi_status_led_uninstall();
|
|
|
|
|
|
|
|
|
sds.begin(); |
|
|
sds.begin(); |
|
|
sds.setCustomWorkingPeriod(15); // sensor sends data every 15 minutes
|
|
|
sds.setCustomWorkingPeriod(5); // sensor sends data every 5 minutes
|
|
|
sds.setQueryReportingMode(); // ensures sensor is in 'query' reporting mode
|
|
|
sds.setQueryReportingMode(); // ensures sensor is in 'query' reporting mode
|
|
|
|
|
|
|
|
|
Wire.begin(BMP_SDA, BMP_SCL); |
|
|
Wire.begin(BMP_SDA, BMP_SCL); |
|
|