From 169bd36c3d501dab8b9b72140727daf290c8c628 Mon Sep 17 00:00:00 2001 From: Aaron Fischer Date: Tue, 8 Jan 2019 22:41:24 +0100 Subject: [PATCH] Allow user specific modifications --- firmware/config.h | 23 +++-------------------- firmware/config_user.h.example | 19 +++++++++++++++++++ firmware/firmware.ino | 5 +++-- 3 files changed, 25 insertions(+), 22 deletions(-) create mode 100644 firmware/config_user.h.example diff --git a/firmware/config.h b/firmware/config.h index 31dbdc6..783d9d2 100644 --- a/firmware/config.h +++ b/firmware/config.h @@ -1,9 +1,4 @@ -//#define DEBUG 1 - -#define BATTERY_POWERED 1 -#define POWERSAVING 1 - #define SENSOR_TEMPERATURE 0 #define SENSOR_HUMIDITY 1 #define SENSOR_LIGHT 2 @@ -23,6 +18,8 @@ #define BAT_LOW_VOLTAGE 3.6 #define BAT_EMERGENCY_DEEPSLEEP_VOLTAGE 3.5 +#define SEALEVELPRESSURE_HPA (1013.25) + #define STATUS_LED_PIN BUILTIN_LED #define ANEMOMETER_PIN D7 @@ -30,20 +27,6 @@ #define BME_MISO 12 #define BME_MOSI 11 #define BME_CS 10 - -#define INITIAL_WEBSERVER_TIME 20 -#define WEBUPDATER_FEATURE 0 - -#define SEALEVELPRESSURE_HPA (1013.25) - #define BME280_ADDRESS 0x76 -const char *INFLUXDB_HOST = "influxdb.okoyono.de"; -//const char *INFLUXDB_HOST = "37.59.213.225"; -const uint16_t INFLUXDB_PORT = 80; -const char *INFLUXDB_DB = "weatherstation"; -const char *INFLUXDB_USER = "oko"; -const char *INFLUXDB_PASS = "de1873a0d2f8f21f17cf4d8db4f65c59"; - -String DEVICE_NAME = "klaute"; - +#define INITIAL_WEBSERVER_TIME 20 diff --git a/firmware/config_user.h.example b/firmware/config_user.h.example new file mode 100644 index 0000000..87bd3d1 --- /dev/null +++ b/firmware/config_user.h.example @@ -0,0 +1,19 @@ +// Copy this file to config_user.h and adjust it to your needs. + +// Debug output on the serial console +#define DEBUG 0 + +// Enable/Disable features +#define WEBUPDATER_FEATURE 0 +#define BATTERY_POWERED 1 +#define POWERSAVING 1 + +// InfluxDB credentials +const char *INFLUXDB_HOST = "hostname"; +const uint16_t INFLUXDB_PORT = 80; +const char *INFLUXDB_DB = "database"; +const char *INFLUXDB_USER = "user"; +const char *INFLUXDB_PASS = "password"; + +// Device name +String DEVICE_NAME = "devicename"; diff --git a/firmware/firmware.ino b/firmware/firmware.ino index 1617f9d..4ef0c63 100644 --- a/firmware/firmware.ino +++ b/firmware/firmware.ino @@ -7,11 +7,12 @@ #include #include // WiFiManager #include // https://github.com/hwwong/ESP8266Influxdb auchecken und den ordner in das arduino\library verzeichnis kopieren -#include // PAckage Adafruit Unified Sensor +#include // Package Adafruit Unified Sensor #include // Adafruit APDS9960 - https://www.makerfabs.com/index.php?route=product/product&product_id=281 #include // BME280 - https://www.roboter-bausatz.de/1704/bmp280-barometer-luftdrucksensor?gclid=EAIaIQobChMIlpumj8Hp2wIVFWYbCh01PgmFEAQYAyABEgIwBvD_BwE #include "config.h" +#include "config_user.h" //*************************************************************************// @@ -228,4 +229,4 @@ void _loop() { } -//*************************************************************************// +//*************************************************************************//