diff --git a/WifiControlSensor/BMP180.ino b/WifiControlSensor/BMP180.ino index 7c60b2c..25d4ddc 100644 --- a/WifiControlSensor/BMP180.ino +++ b/WifiControlSensor/BMP180.ino @@ -8,11 +8,9 @@ int BMP180Setup(int sda, int scl) { bmp180Connected = bmp180.begin(sda, scl); if (!bmp180Connected){ SKETCH_DEBUG_PRINTLN("Cannot connect to BMP180"); - goto err; + return -1; } return 0; -err: - return -1; } bool BMP180IsConnected() { diff --git a/WifiControlSensor/MQTT.ino b/WifiControlSensor/MQTT.ino index 4ba3f91..a1fd2a8 100644 --- a/WifiControlSensor/MQTT.ino +++ b/WifiControlSensor/MQTT.ino @@ -87,7 +87,7 @@ int MqttBatchPublish(std::vector tab, ...) { va_start (args, tab); vsnprintf(buf, sizeof(buf), (const char *)info.topic, args); va_end(args); - SKETCH_DEBUG_PRINTF("publishing %f for %s\n", info.value, buf); +// SKETCH_DEBUG_PRINTF("publishing %f for %s\n", info.value, buf); Adafruit_MQTT_Publish client(mqtt, buf, info.qos, info.retain); if (!client.publish(info.value)) SKETCH_DEBUG_PRINTLN("Fail :("); diff --git a/WifiControlSensor/WebServer.ino b/WifiControlSensor/WebServer.ino index 6c55e6d..e00e8a7 100644 --- a/WifiControlSensor/WebServer.ino +++ b/WifiControlSensor/WebServer.ino @@ -32,12 +32,13 @@ void WebHandleRoot() { "
" "Sensors" #ifdef CONFIG_ENABLE_BMP180 - "Temperature " + String(temp, 2) + "C
" - "Pressure " + String(pressure, 2) + "mB
" + "" + (BMP180IsConnected() ? "
BMP180
Temperature " + String(temp, 2) + "C
Pressure " + String(pressure, 2) + "hPa
" : "BMP180 Disconnected" ) + "" #endif #ifdef CONFIG_ENABLE_DHT - "Temperature DHT " + String(dhtTemp, 0) + "C
" - "Humidity DHT " + String(dhtHumidity, 0) + "%
" + "" + (DHTIsConnected() ? "
DHT
Temperature " + String(dhtTemp, 0) + "C
Humidity " + String(dhtHumidity, 0) + "%
" : "DHT Disconnected" ) + "" +#endif +#ifdef CONFIG_ENABLE_BME680 + "" + (BME680IsConnected() ? "
BME680
Temperature " + String(bme680T, 2) + "C
Pressure " + String(bme680P, 2) + "hPa
Humidity " + String(bme680H, 2) + "%
Gaz " + String(bme680G, 2) + "kOhm
" : "BME680 Disconnected" ) + "" #endif #ifdef CONFIG_ENABLE_DRY_SENSOR "Dryness " + String((dryness * 100) / 1024) + "%
" @@ -47,9 +48,6 @@ void WebHandleRoot() { "Enter Setup
" "Update firmware
" + optimiseConfig + "MQTT Status: " + (MqttIsConnected() ? "Connected" : "Disconnected") + "
" -#ifdef CONFIG_ENABLE_BMP180 - "BMP 180 (Temp+Pression) Status: " + (BMP180IsConnected() ? "Connected" : "Disconnected") + "
" -#endif "Wifi Strength: " + WiFi.RSSI() + "dBm
" "Free space: " + ESP.getFreeSketchSpace() + "
" "Free heap: " + ESP.getFreeHeap() + "
"