diff --git a/doc/NODEMCU_DEVKIT_V1.0.PDF b/doc/NODEMCU_DEVKIT_V1.0.PDF new file mode 100755 index 0000000..280f185 Binary files /dev/null and b/doc/NODEMCU_DEVKIT_V1.0.PDF differ diff --git a/firmware/config.h b/firmware/config.h old mode 100644 new mode 100755 index 50ffc2b..5ace793 --- a/firmware/config.h +++ b/firmware/config.h @@ -43,4 +43,4 @@ #define INITIAL_WEBSERVER_TIME 20 -#endif +#endif diff --git a/firmware/firmware.ino b/firmware/firmware.ino index cc3695e..12ec53f 100755 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -1,3 +1,5 @@ + + // Standard ESP8266 libs #include #include @@ -68,11 +70,6 @@ String localIP = "127.0.0.1"; void setup() { -#ifdef BOARD_NODEMCU - // on nodemcu v0.1 (aliexpress) the delay is required to prevent a endless reboot bug - delay(100); -#endif - // Erase WiFi Credentials (maybe this will work ...) //WiFi.disconnect(true); //delay(2000); @@ -151,6 +148,9 @@ void setup() { WiFi.mode(WIFI_OFF); WiFi.forceSleepBegin(); +#ifdef DEBUG + Serial.println("deep sleep"); +#endif // the ESP.deepSleep requires microseconds as input, after the sleep the system will run into the setup routine ESP.deepSleep(POWERSAVING_SLEEP_S * 1000000, WAKE_RF_DEFAULT); delay(100); diff --git a/firmware/sensors.ino b/firmware/sensors.ino index 9643226..7a4fcdc 100755 --- a/firmware/sensors.ino +++ b/firmware/sensors.ino @@ -63,16 +63,16 @@ float getBatteryVoltage() { } float isBatCharging() { - if (LOW == digitalRead(BAT_CHARGED_PIN)) - { - return BAT_CHARGE_STATE_CHARGED; - } else if (LOW == digitalRead(BAT_CHARGING_PIN)) + if (LOW == digitalRead(BAT_CHARGING_PIN)) { return BAT_CHARGE_STATE_CHARGING; + } else if (LOW == digitalRead(BAT_CHARGED_PIN)) + { + return BAT_CHARGE_STATE_CHARGED; } return BAT_CHARGE_STATE_NOTCHARGING; } #endif - +