Compare commits

...

2 Commits

Author SHA1 Message Date
Mathieu Maret cbce043f30 BME680 fix hPA unit 2022-09-07 22:58:44 +02:00
Mathieu Maret e68eec8955 Increase Wifi connection time before reconfig 2022-09-07 22:58:23 +02:00
2 changed files with 3 additions and 6 deletions

View File

@ -94,7 +94,7 @@ int BME680BSECGetMeasure(float &t, float &p, float &h, float &iaq, float &iaqAcc
{ {
if (iaqSensor.run()) { // If new data is available if (iaqSensor.run()) { // If new data is available
t = iaqSensor.temperature; t = iaqSensor.temperature;
p = iaqSensor.pressure; p = iaqSensor.pressure/100;
h = iaqSensor.humidity; h = iaqSensor.humidity;
iaq = iaqSensor.iaq; iaq = iaqSensor.iaq;
iaqAcc = iaqSensor.iaqAccuracy; iaqAcc = iaqSensor.iaqAccuracy;

View File

@ -132,10 +132,7 @@ void WifiSetup(productConfig conf) {
bssidConf = bssid; bssidConf = bssid;
} }
// WA https://github.com/esp8266/Arduino/issues/2186 SKETCH_DEBUG_PRINTF("Using channel %u (0==auto)\n", conf.channel );
WiFi.persistent(false);
WiFi.mode(WIFI_OFF); // this is a temporary line, to be removed after SDK update to 1.5.4
WiFi.mode(WIFI_STA);
WiFi.begin(conf.ssid, conf.password, conf.channel, bssidConf); WiFi.begin(conf.ssid, conf.password, conf.channel, bssidConf);
while (WiFi.status() != WL_CONNECTED) { while (WiFi.status() != WL_CONNECTED) {
delay(50); delay(50);
@ -144,7 +141,7 @@ void WifiSetup(productConfig conf) {
reconfig = 0; reconfig = 0;
return; return;
} }
if (connectionTry == 60) { if (connectionTry == 120) {
SKETCH_DEBUG_PRINTLN("Cannot connect to wifi. Try without BSSID and channel"); SKETCH_DEBUG_PRINTLN("Cannot connect to wifi. Try without BSSID and channel");
WiFi.begin(conf.ssid, conf.password); WiFi.begin(conf.ssid, conf.password);
} }