From 729d2b8650694b9260df10704ecb9f7925495fdc Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Sat, 9 Dec 2017 18:07:46 +0100 Subject: [PATCH] Der stand geht --- firmware/config.h | 2 +- firmware/firmware.ino | 22 +++++++++++----------- firmware/influxdb.ino | 8 ++++---- firmware/sensors.ino | 8 +++++--- 4 files changed, 21 insertions(+), 19 deletions(-) diff --git a/firmware/config.h b/firmware/config.h index 811da32..fc6e477 100644 --- a/firmware/config.h +++ b/firmware/config.h @@ -1,4 +1,4 @@ -#define DEBUG +#define DEBUG 1 #define SENSOR_TEMPERATURE 0 #define SENSOR_HUMIDITY 1 diff --git a/firmware/firmware.ino b/firmware/firmware.ino index ff439f2..5f76ec3 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -62,9 +62,9 @@ void setup() { delay(2000); // Initialize and configure the sensors - apds.begin(); - apds.enableColor(true); - bme.begin(); + //apds.begin(); + //apds.enableColor(true); + //bme.begin(); delay(100); } @@ -73,19 +73,19 @@ void loop() { digitalWrite(STATUS_LED_PIN, LOW); currentSensorData[SENSOR_TEMPERATURE] = fetchTemperature(); - currentSensorData[SENSOR_HUMIDITY] = fetchHumidity(); - currentSensorData[SENSOR_LIGHT] = fetchLight(); - currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed(); - currentSensorData[SENSOR_PRESSURE] = fetchPressure(); + //currentSensorData[SENSOR_HUMIDITY] = fetchHumidity(); + //currentSensorData[SENSOR_LIGHT] = fetchLight(); + //currentSensorData[SENSOR_WINDSPEED] = fetchWindspeed(); + //currentSensorData[SENSOR_PRESSURE] = fetchPressure(); #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"); + //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); diff --git a/firmware/influxdb.ino b/firmware/influxdb.ino index 2756d63..d731789 100644 --- a/firmware/influxdb.ino +++ b/firmware/influxdb.ino @@ -1,7 +1,7 @@ void pushToInfluxDB(String device, float sensorValues[]) { influxdb.write("weather,device=" + device + " temperature=" + String(sensorValues[SENSOR_TEMPERATURE])); - influxdb.write("weather,device=" + device + " humidity=" + String(sensorValues[SENSOR_HUMIDITY])); - influxdb.write("weather,device=" + device + " light=" + String(sensorValues[SENSOR_LIGHT])); - influxdb.write("weather,device=" + device + " windspeed=" + String(sensorValues[SENSOR_WINDSPEED])); - influxdb.write("weather,device=" + device + " pressure=" + String(sensorValues[SENSOR_PRESSURE])); + //influxdb.write("weather,device=" + device + " humidity=" + String(sensorValues[SENSOR_HUMIDITY])); + //influxdb.write("weather,device=" + device + " light=" + String(sensorValues[SENSOR_LIGHT])); + //influxdb.write("weather,device=" + device + " windspeed=" + String(sensorValues[SENSOR_WINDSPEED])); + //influxdb.write("weather,device=" + device + " pressure=" + String(sensorValues[SENSOR_PRESSURE])); } diff --git a/firmware/sensors.ino b/firmware/sensors.ino index 3d5e93b..57e008a 100644 --- a/firmware/sensors.ino +++ b/firmware/sensors.ino @@ -2,15 +2,17 @@ int anemometerRotations = 0; unsigned long currentTime = 0; float fetchTemperature() { - return bme.readTemperature(); + return 10; + //return bme.readTemperature(); } float fetchPressure() { - return bme.readPressure() / 100.0F; + return 10; + //return bme.readPressure() / 100.0F; } float fetchHumidity() { - return bme.readHumidity(); + //return bme.readHumidity(); } float fetchLight() {