Skip to content

Commit 2e4b803

Browse files
committed
fixed defaultConfig.h file
1 parent 98fe949 commit 2e4b803

File tree

3 files changed

+3
-75
lines changed

3 files changed

+3
-75
lines changed

Smogomierz.ino

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
//#define ASYNC_WEBSERVER_ON // - EXPERIMENTAL - FOR ESP32 ONLY!
1313
#endif
1414

15-
1615
/*
1716
1817
ESP8266
@@ -37,6 +36,7 @@
3736
SDS011/21: VIN - 5V; GND - G; TX - D1; RX - D2
3837
Sensirion SPS30: VIN - 5V; GND - G; TX - D1; RX - D2
3938
39+
4040
ESP32
4141
4242
Podłączenie czujnikow dla ESP32:
@@ -144,22 +144,19 @@
144144
#endif
145145
#include <ESP8266mDNS.h>
146146
#ifndef ASYNC_WEBSERVER_ON
147-
148147
#include <ESP8266HTTPUpdateServer.h>
149148
#endif
150149
#include <SoftwareSerial.h>
151150
#elif defined ARDUINO_ARCH_ESP32 // Arduino core for the ESP32 - 1.0.4-rc1 or later // at 1.0.3 autoupdate doesn't work !!!
152151
#include <WiFi.h>
153152
#include <WiFiClient.h>
154153
#include <ESPmDNS.h>
155-
156154
#ifdef ASYNC_WEBSERVER_ON
157155
#include <AsyncTCP.h>
158156
#include <ESPAsyncWebServer.h>
159157
#else
160158
#include <WebServer.h>
161159
#endif
162-
163160
#include <Update.h>
164161
#include <HTTPClient.h>
165162
#include <HTTPUpdate.h>
@@ -307,9 +304,7 @@ AsyncWebServer server(80);
307304
#else
308305
#ifdef ARDUINO_ARCH_ESP8266
309306
ESP8266WebServer WebServer(80);
310-
#ifndef DUSTSENSOR_SPS30
311307
ESP8266HTTPUpdateServer httpUpdater;
312-
#endif
313308
#elif defined ARDUINO_ARCH_ESP32
314309
WebServer WebServer(80);
315310
#endif
@@ -522,7 +517,6 @@ void setup() {
522517
#elif defined DUSTSENSOR_SPS30
523518
if (!strcmp(DUST_MODEL, "SPS30")) {
524519
Serial.println(F("Trying to connect to SPS30..."));
525-
526520
// set driver debug level
527521
sps30.EnableDebugging(SPS30_DEBUG);
528522

@@ -743,9 +737,7 @@ void setup() {
743737
WebServer.onNotFound(handle_root);
744738

745739
#ifdef ARDUINO_ARCH_ESP8266
746-
#ifndef DUSTSENSOR_SPS30
747740
httpUpdater.setup(&WebServer, "/update");
748-
#endif
749741
#elif defined ARDUINO_ARCH_ESP32
750742
/*handling uploading firmware file */
751743
WebServer.on("/update", HTTP_POST, []() {
@@ -821,7 +813,6 @@ void loop() {
821813
}
822814
#endif
823815
// DUST SENSOR refresh data - END
824-
825816
//yield();
826817

827818
#ifndef ASYNC_WEBSERVER_ON
@@ -881,7 +872,6 @@ void loop() {
881872
#ifndef ASYNC_WEBSERVER_ON
882873
WebServer.handleClient();
883874
#endif
884-
885875
previous_2sec_Millis = millis();
886876
}
887877
if (LUFTDATEN_ON or AQI_ECO_ON or AIRMONITOR_ON or SMOGLIST_ON) {
@@ -1356,56 +1346,6 @@ void takeNormalnPMMeasurements() {
13561346
#elif defined DUSTSENSOR_SPS30
13571347
read_sps30_data();
13581348

1359-
pmMeasurements[iPM][0] = int(calib * SPS30_PM1);
1360-
pmMeasurements[iPM][1] = int(calib * SPS30_PM25);
1361-
pmMeasurements[iPM][2] = int(calib * SPS30_PM10);
1362-
pmMeasurements[iPM][3] = int(calib * SPS30_PM4);
1363-
#else // If no dust sensor has been defined - use DUSTSENSOR_PMS5003_7003_BME280_0x76
1364-
pmMeasurements[iPM][0] = int(calib * data.PM_AE_UG_1_0);
1365-
pmMeasurements[iPM][1] = int(calib * data.PM_AE_UG_2_5);
1366-
pmMeasurements[iPM][2] = int(calib * data.PM_AE_UG_10_0);
1367-
=======
1368-
pmMeasurements[iPM][0] = int(calib * data.PM_AE_UG_1_0);
1369-
pmMeasurements[iPM][1] = int(calib * data.PM_AE_UG_2_5);
1370-
pmMeasurements[iPM][2] = int(calib * data.PM_AE_UG_10_0);
1371-
#elif defined DUSTSENSOR_SDS011_21
1372-
#ifdef ARDUINO_ARCH_ESP8266
1373-
PmResult SDSdata = sds.queryPm();
1374-
delay(1000);
1375-
if (SDSdata.isOk()) {
1376-
pmMeasurements[iPM][0] = int(calib * 0);
1377-
pmMeasurements[iPM][1] = int(calib * SDSdata.pm25);
1378-
pmMeasurements[iPM][2] = int(calib * SDSdata.pm10);
1379-
} else {
1380-
Serial.println("\nCould not read values from SDS sensor :( ");
1381-
}
1382-
#elif defined ARDUINO_ARCH_ESP32
1383-
err = my_sds.read(&SDSpm25, &SDSpm10);
1384-
if (!err) {
1385-
pmMeasurements[iPM][0] = int(calib * 0);
1386-
pmMeasurements[iPM][1] = int(calib * SDSpm25);
1387-
pmMeasurements[iPM][2] = int(calib * SDSpm10);
1388-
} else {
1389-
Serial.println("\nCould not read values from SDS sensor :( ");
1390-
}
1391-
#endif
1392-
#elif defined DUSTSENSOR_HPMA115S0
1393-
if (hpma115S0.ReadParticleMeasurement(&hpma115S0_pm25, &hpma115S0_pm10)) {
1394-
if (hpma115S0_pm25 == 0 and hpma115S0_pm10 == 0) {
1395-
delay(100);
1396-
hpma115S0.ReadParticleMeasurement(&hpma115S0_pm25, &hpma115S0_pm10);
1397-
pmMeasurements[iPM][0] = int(calib * 0);
1398-
pmMeasurements[iPM][1] = int(calib * hpma115S0_pm25);
1399-
pmMeasurements[iPM][2] = int(calib * hpma115S0_pm10);
1400-
} else {
1401-
pmMeasurements[iPM][0] = int(calib * 0);
1402-
pmMeasurements[iPM][1] = int(calib * hpma115S0_pm25);
1403-
pmMeasurements[iPM][2] = int(calib * hpma115S0_pm10);
1404-
}
1405-
}
1406-
#elif defined DUSTSENSOR_SPS30
1407-
read_sps30_data();
1408-
14091349
pmMeasurements[iPM][0] = int(calib * SPS30_PM1);
14101350
pmMeasurements[iPM][1] = int(calib * SPS30_PM25);
14111351
pmMeasurements[iPM][2] = int(calib * SPS30_PM10);
@@ -1450,7 +1390,6 @@ void takeSleepPMMeasurements() {
14501390
#ifndef ASYNC_WEBSERVER_ON
14511391
WebServer.handleClient();
14521392
#endif
1453-
14541393
previous_2sec_Millis = millis();
14551394
}
14561395
previous_2sec_Millis = 0;
@@ -1466,6 +1405,7 @@ void takeSleepPMMeasurements() {
14661405
takeNormalnPMMeasurements();
14671406
counterNM1++;
14681407
}
1408+
14691409
previous_2sec_Millis = millis();
14701410
}
14711411
#ifndef ASYNC_WEBSERVER_ON
@@ -1544,7 +1484,6 @@ void takeSleepPMMeasurements() {
15441484
unsigned long current_2sec_Millis = millis();
15451485
previous_2sec_Millis = millis();
15461486
while (previous_2sec_Millis - current_2sec_Millis <= TwoSec_interval * 8) {
1547-
15481487
#ifndef ASYNC_WEBSERVER_ON
15491488
WebServer.handleClient();
15501489
#endif
@@ -1564,7 +1503,6 @@ void takeSleepPMMeasurements() {
15641503
}
15651504
previous_2sec_Millis = millis();
15661505
}
1567-
15681506
#ifndef ASYNC_WEBSERVER_ON
15691507
WebServer.handleClient();
15701508
#endif
@@ -1588,7 +1526,6 @@ void takeSleepPMMeasurements() {
15881526
unsigned long current_2sec_Millis = millis();
15891527
previous_2sec_Millis = millis();
15901528
while (previous_2sec_Millis - current_2sec_Millis <= TwoSec_interval * 8) {
1591-
15921529
#ifndef ASYNC_WEBSERVER_ON
15931530
WebServer.handleClient();
15941531
#endif

defaultConfig.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int THINGSPEAK_CHANNEL_ID = 0;
2929
char THINGSPEAK_READ_API_KEY[32] = "READ_API_KEY";
3030

3131
bool INFLUXDB_ON = false;
32-
char INFLUXDB_VERSION[16] = "1"; // 1 (for 1.x version) or 2 for 2.0 or later
32+
char INFLUXDB_VERSION[16] = "1"; // 1 (for 1.x version) or 2 for 2.0 or later
3333
char INFLUXDB_HOST[128] = "INFLUXDB_ADRESS";
3434
uint16_t INFLUXDB_PORT = 8086;
3535
char INFLUXDB_DATABASE[64] = "mydb";
@@ -60,10 +60,6 @@ bool AQI_ECO_ON = false;
6060
char AQI_ECO_HOST[128] = "???.aqi.eco";
6161
char AQI_ECO_PATH[64] = "/u/???";
6262

63-
bool AQI_ECO_ON = false;
64-
char AQI_ECO_HOST[255] = "???.aqi.eco";
65-
char AQI_ECO_PATH[255] = "/u/???";
66-
6763
int SENDING_FREQUENCY = 3;
6864
int SENDING_DB_FREQUENCY = 3;
6965
bool DEEPSLEEP_ON = false;

src/config.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,6 @@ extern bool AQI_ECO_ON;
6060
extern char AQI_ECO_HOST[128];
6161
extern char AQI_ECO_PATH[64];
6262

63-
extern bool AQI_ECO_ON;
64-
extern char AQI_ECO_HOST[255];
65-
extern char AQI_ECO_PATH[255];
66-
6763
extern int SENDING_FREQUENCY;
6864
extern int SENDING_DB_FREQUENCY;
6965
extern bool DEEPSLEEP_ON;
@@ -97,5 +93,4 @@ const char HARDWAREVERSION[] = "1.0 - ESP8266";
9793
#elif defined(ARDUINO_ARCH_ESP32)
9894
const char SOFTWAREVERSION[] = "2.7.5 build " __TIME__ " " __DATE__;
9995
const char HARDWAREVERSION[] = "2.0 - ESP32";
100-
10196
#endif

0 commit comments

Comments
 (0)