From 0b9cbb4fdcbe7057581c73d19c1e84b44053ba9c Mon Sep 17 00:00:00 2001 From: coelner Date: Wed, 1 May 2019 20:26:13 +0200 Subject: [PATCH 1/3] gitignore --- esp8266-sensor.ino | 7 +------ main.ino | 2 +- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/esp8266-sensor.ino b/esp8266-sensor.ino index 2f70af7..e6714b2 100644 --- a/esp8266-sensor.ino +++ b/esp8266-sensor.ino @@ -79,8 +79,7 @@ const bool metric = true; /************************* WiFi Client *********************************/ -#define WLAN_SSID "IoT" -#define WLAN_PASS "TF0xJJHtMz5kJUdh3dqf" +//see secrets.h const int WIFI_CONNECT_TIMEOUT = 10; // seconds - max time for wifi connect to router, if exceeded go to sleep @@ -95,11 +94,7 @@ const int FW_VERSION = 10; const char* fwUrlBase = "http://10.0.4.2/fota/"; /************************* MQTT Broker Setup *********************************/ #define name "bathroom" -const int MQTT_PORT = 1883; -const char MQTT_SERVER[] = "mqtt.koelner.dynvpn.de"; char MQTT_CLIENTID[10]; -const char MQTT_USERNAME[] = "input"; -const char MQTT_PASSWORD[] = "tFnlKJu9"; const char MQTT_WILL_TOPIC[] = "bathroom/sys/will"; const int MQTT_WILL_QOS = 0; const int MQTT_WILL_RETAIN = 0; diff --git a/main.ino b/main.ino index 5d83270..0387a3e 100644 --- a/main.ino +++ b/main.ino @@ -556,7 +556,7 @@ void setup() { // if serial is not initialized all following calls to serial end dead. #ifdef SERIAL_DEBUG Serial.flush(); - Serial.begin(115200); + Serial.begin(9600); while (!Serial) { delay(1); } // Wait From b98a54066540c5f8458a8b3dfc52b3f0cc874ac7 Mon Sep 17 00:00:00 2001 From: coelner Date: Thu, 23 May 2019 18:50:46 +0200 Subject: [PATCH 2/3] fix battery measurement --- esp8266-sensor.ino | 4 ++-- main.ino | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/esp8266-sensor.ino b/esp8266-sensor.ino index e6714b2..ff16494 100644 --- a/esp8266-sensor.ino +++ b/esp8266-sensor.ino @@ -1,7 +1,7 @@ /************************* settings *********************************/ #define SERIAL_DEBUG //#define OLED_OUTPUT -//#define BATTERY_USE +#define BATTERY_USE //#define BME2_USE //#define BME6_USE //#define BH_USE @@ -74,7 +74,7 @@ const bool metric = true; #ifdef BATTERY_USE #define SLEEP_TIME_LOW_BAT 60*SLEEP_TIME // sleep 3600s(60min) after measurement #define BATT_WARNING_VOLTAGE 270 // Voltage for Low-Bat warning in mV --rember the drop-out of the voltage regulator -- Be aware not to measure the VCC! -#define BATT_MEASUREMENT_OFFSET 20 //Meh, somewhere and somehow is something not that well... +#define BATT_MEASUREMENT_OFFSET 30 //Meh, somewhere and somehow is something not that well... #endif /************************* WiFi Client *********************************/ diff --git a/main.ino b/main.ino index 0387a3e..a11b56f 100644 --- a/main.ino +++ b/main.ino @@ -153,7 +153,7 @@ uint32_t voltageDivCorrelation(uint32_t u3) { //ToDo: Not working! adc contains millivoltage at native adc port uint32_t adc = map (u3 - offset, 0, 1023, 0 , 1000); - const uint32_t r1 = 390; + const uint32_t r1 = 395; const uint32_t r2 = 220; const uint32_t r3 = 100; uint32_t rges = r1 + r2 + r3; @@ -582,7 +582,7 @@ void setup() { Serial.print(F("ADC_measurement: \t\t\t")); Serial.println (String(adc)); Serial.print(F("VoltageDividerCorrelation in V: \t")); - Serial.println(String(voltageDivCorrelation(adc) - BATT_MEASUREMENT_OFFSET)); + Serial.println(String(voltageDivCorrelation(adc))); #endif yield(); delay(10); From 7bd2740d4d8be297e4c5f0ced0a2666be62e0558 Mon Sep 17 00:00:00 2001 From: coelner Date: Thu, 23 May 2019 18:53:32 +0200 Subject: [PATCH 3/3] gitignore added --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..96d48a8 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.bin +secrets.h