diff --git a/firmware/config.h b/firmware/config.h index fc7d436..b25c5ad 100755 --- a/firmware/config.h +++ b/firmware/config.h @@ -27,4 +27,4 @@ const char *INFLUXDB_USER = "oko"; const char *INFLUXDB_PASS = "de1873a0d2f8f21f17cf4d8db4f65c59"; String DEVICE_NAME = "klaute"; - + diff --git a/firmware/firmware.ino b/firmware/firmware.ino index 404234e..68ff60e 100755 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -11,6 +11,7 @@ #include "config.h" /** +<<<<<<< HEAD Whishlist: - Webserver for /metrics endpoint (Prometheus) - Show current sensor values over simple webpage @@ -25,6 +26,22 @@ - https://sminghub.github.io/Sming/about/ - https://github.com/marvinroger/homie-esp8266 */ +======= + * Whishlist: + * - Webserver for /metrics endpoint (Prometheus) + * - Show current sensor values over simple webpage + * - Push sensor values to various 3rd party services (https://openweathermap.org/) + * - MQTT? + * + * - Buffer sensor values if there is no WIFI connection + * - Configure weather station over http webinterface + * - OTA firmware update + * + * TODO: + * - https://sminghub.github.io/Sming/about/ + * - https://github.com/marvinroger/homie-esp8266 + */ +>>>>>>> d5aee1ca54127dd46df8934c2512bcf1b9cc1bfa float currentSensorData[5] = {0.0, 0.0, 0.0, 0.0, 0.0}; @@ -44,7 +61,7 @@ void setup() { // Pin settings pinMode(STATUS_LED_PIN, OUTPUT); - pinMode(ANEMOMETER_PIN, INPUT_PULLUP); + //pinMode(ANEMOMETER_PIN, INPUT_PULLUP); // Establish WiFi connection String wifiName = "oko-weather-" + String(ESP.getChipId()); @@ -86,6 +103,7 @@ void loop() { digitalWrite(STATUS_LED_PIN, HIGH); #endif currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature(); +<<<<<<< HEAD currentSensorData[SENSOR_HUMIDITY] = fetchHumidity(); currentSensorData[SENSOR_LIGHT] = fetchLight(); currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed(); @@ -106,3 +124,29 @@ void loop() { delay(UPDATE_INTERVAL * 1000); } +======= + Serial.print("*"); + currentSensorData[SENSOR_HUMIDITY] = fetchHumidity(); + Serial.print("*"); + currentSensorData[SENSOR_LIGHT] = fetchLight(); + Serial.print("*"); + currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed(); + Serial.print("*"); + currentSensorData[SENSOR_PRESSURE] = fetchPressure(); + Serial.println("*"); + + #ifdef DEBUG + Serial.println(""); + Serial.println("Current readings:"); + Serial.println("Temperature: " + String(currentSensorData[SENSOR_TEMPERATURE]) + " °C"); + Serial.println("Humidity: " + String(currentSensorData[SENSOR_HUMIDITY]) + " %"); + Serial.println("Light: " + String(currentSensorData[SENSOR_LIGHT]) + " Lumen"); + Serial.println("Windspeed: " + String(currentSensorData[SENSOR_WINDSPEED]) + " Km/h"); + Serial.println("Pressure: " + String(currentSensorData[SENSOR_PRESSURE]) + " hPa"); + #endif + + pushToInfluxDB(DEVICE_NAME, currentSensorData); + + delay(UPDATE_INTERVAL*1000); +} +>>>>>>> d5aee1ca54127dd46df8934c2512bcf1b9cc1bfa diff --git a/schematics/oko-weatherstation.bak b/schematics/oko-weatherstation.bak index 8b829fb..8c2ad7a 100644 --- a/schematics/oko-weatherstation.bak +++ b/schematics/oko-weatherstation.bak @@ -1 +1,119 @@ EESchema Schematic File Version 2 +LIBS:power +LIBS:device +LIBS:switches +LIBS:relays +LIBS:motors +LIBS:transistors +LIBS:conn +LIBS:linear +LIBS:regul +LIBS:74xx +LIBS:cmos4000 +LIBS:adc-dac +LIBS:memory +LIBS:xilinx +LIBS:microcontrollers +LIBS:dsp +LIBS:microchip +LIBS:analog_switches +LIBS:motorola +LIBS:texas +LIBS:intel +LIBS:audio +LIBS:interface +LIBS:digital-audio +LIBS:philips +LIBS:display +LIBS:cypress +LIBS:siliconi +LIBS:opto +LIBS:atmel +LIBS:contrib +LIBS:valves +LIBS:wemos_mini +EELAYER 25 0 +EELAYER END +$Descr A4 11693 8268 +encoding utf-8 +Sheet 1 1 +Title "" +Date "" +Rev "" +Comp "" +Comment1 "" +Comment2 "" +Comment3 "" +Comment4 "" +$EndDescr +$Comp +L WeMos_mini U? +U 1 1 5A08AD5D +P 5450 3350 +F 0 "U?" H 5450 3850 60 0000 C CNN +F 1 "WeMos_mini" H 5450 2850 60 0000 C CNN +F 2 "" H 6000 2650 60 0000 C CNN +F 3 "" H 6000 2650 60 0000 C CNN + 1 5450 3350 + 1 0 0 -1 +$EndComp +$Comp +L R R? +U 1 1 5A08AF61 +P 4350 3100 +F 0 "R?" V 4300 3250 50 0000 C CNN +F 1 "10k" V 4350 3100 50 0000 C CNN +F 2 "" V 4280 3100 50 0001 C CNN +F 3 "" H 4350 3100 50 0001 C CNN + 1 4350 3100 + 0 1 1 0 +$EndComp +$Comp +L C C? +U 1 1 5A08B052 +P 4350 2950 +F 0 "C?" V 4400 3050 50 0000 L CNN +F 1 "100n" V 4400 2700 50 0000 L CNN +F 2 "" V 4388 2800 50 0001 C CNN +F 3 "" H 4350 2950 50 0001 C CNN + 1 4350 2950 + 0 -1 -1 0 +$EndComp +$Comp +L SW_DPST_x2 SW? +U 1 1 5A08B23D +P 3800 3100 +F 0 "SW?" H 3800 3050 50 0000 C CNN +F 1 "Anemometer" H 3800 3200 50 0000 C CNN +F 2 "" H 3800 3100 50 0001 C CNN +F 3 "" H 3800 3100 50 0001 C CNN + 1 3800 3100 + 1 0 0 -1 +$EndComp +Wire Wire Line + 4500 3100 4950 3100 +Wire Wire Line + 4600 3100 4600 2950 +Connection ~ 4600 3100 +Wire Wire Line + 4000 3100 4200 3100 +Wire Wire Line + 4100 2950 4200 2950 +Wire Wire Line + 4100 2950 4100 3200 +Connection ~ 4100 3100 +Wire Wire Line + 4100 3200 4950 3200 +Wire Wire Line + 3600 3100 3550 3100 +Wire Wire Line + 3550 3100 3550 2800 +Wire Wire Line + 3550 2800 6000 2800 +Wire Wire Line + 6000 2800 6000 3000 +Wire Wire Line + 6000 3000 5950 3000 +Wire Wire Line + 4600 2950 4500 2950 +$EndSCHEMATC diff --git a/schematics/oko-weatherstation.sch b/schematics/oko-weatherstation.sch index 8c2ad7a..17e512e 100644 --- a/schematics/oko-weatherstation.sch +++ b/schematics/oko-weatherstation.sch @@ -31,7 +31,7 @@ LIBS:opto LIBS:atmel LIBS:contrib LIBS:valves -LIBS:wemos_mini +LIBS:oko-weatherstation-cache EELAYER 25 0 EELAYER END $Descr A4 11693 8268 @@ -99,11 +99,9 @@ Wire Wire Line 4000 3100 4200 3100 Wire Wire Line 4100 2950 4200 2950 -Wire Wire Line - 4100 2950 4100 3200 Connection ~ 4100 3100 Wire Wire Line - 4100 3200 4950 3200 + 5950 3200 6850 3200 Wire Wire Line 3600 3100 3550 3100 Wire Wire Line @@ -116,4 +114,67 @@ Wire Wire Line 6000 3000 5950 3000 Wire Wire Line 4600 2950 4500 2950 +Connection ~ 4100 2950 +Wire Wire Line + 4200 3500 4950 3500 +Wire Wire Line + 4950 3400 4200 3400 +Wire Wire Line + 4950 3300 4200 3300 +Text Label 4250 3500 0 60 ~ 0 +SCL +Text Label 4250 3400 0 60 ~ 0 +SDA +Text Notes 7300 2100 0 60 ~ 0 +Light APDS9960 +Wire Wire Line + 7350 2350 7950 2350 +Wire Wire Line + 7350 2500 7950 2500 +Wire Wire Line + 7350 2650 7950 2650 +Wire Wire Line + 7350 2850 7950 2850 +Text Label 7400 2350 0 60 ~ 0 +SCL +Text Label 7400 2500 0 60 ~ 0 +SDA +Text Label 7400 2650 0 60 ~ 0 +VCC +Text Label 7400 2850 0 60 ~ 0 +GND +Wire Wire Line + 7350 2200 7950 2200 +Wire Wire Line + 7350 3000 7950 3000 +Text Notes 7350 3600 0 60 ~ 0 +BME280 +Wire Wire Line + 7350 3750 8000 3750 +Wire Wire Line + 7350 3950 8000 3950 +Wire Wire Line + 7350 4150 8000 4150 +Wire Wire Line + 7350 4350 8000 4350 +Wire Wire Line + 7350 4550 8000 4550 +Text Label 5250 2800 0 60 ~ 0 +VCC +Text Label 7400 3750 0 60 ~ 0 +VCC +Text Label 7400 3950 0 60 ~ 0 +SCL +Text Label 7400 4150 0 60 ~ 0 +SDA +Wire Wire Line + 4100 2950 4100 4050 +Wire Wire Line + 4100 4050 6850 4050 +Wire Wire Line + 6850 4050 6850 3200 +Text Label 7400 4350 0 60 ~ 0 +GND +Text Label 7400 4550 0 60 ~ 0 +??? $EndSCHEMATC