Browse Source

Allow user specific modifications

Aaron Fischer 1 year ago
parent
commit
169bd36c3d
3 changed files with 25 additions and 22 deletions
  1. 3
    20
      firmware/config.h
  2. 19
    0
      firmware/config_user.h.example
  3. 3
    2
      firmware/firmware.ino

+ 3
- 20
firmware/config.h View File

@@ -1,9 +1,4 @@
1 1
 
2
-//#define DEBUG 1
3
-
4
-#define BATTERY_POWERED 1
5
-#define POWERSAVING 1
6
-
7 2
 #define SENSOR_TEMPERATURE    0
8 3
 #define SENSOR_HUMIDITY       1
9 4
 #define SENSOR_LIGHT          2
@@ -23,6 +18,8 @@
23 18
 #define BAT_LOW_VOLTAGE                 3.6
24 19
 #define BAT_EMERGENCY_DEEPSLEEP_VOLTAGE 3.5
25 20
 
21
+#define SEALEVELPRESSURE_HPA (1013.25)
22
+
26 23
 #define STATUS_LED_PIN        BUILTIN_LED
27 24
 #define ANEMOMETER_PIN        D7
28 25
 
@@ -30,20 +27,6 @@
30 27
 #define BME_MISO 12
31 28
 #define BME_MOSI 11
32 29
 #define BME_CS   10
33
-
34
-#define INITIAL_WEBSERVER_TIME 20
35
-#define WEBUPDATER_FEATURE 0
36
-
37
-#define SEALEVELPRESSURE_HPA (1013.25)
38
-
39 30
 #define BME280_ADDRESS 0x76
40 31
 
41
-const char     *INFLUXDB_HOST = "influxdb.okoyono.de";
42
-//const char     *INFLUXDB_HOST = "37.59.213.225";
43
-const uint16_t  INFLUXDB_PORT = 80;
44
-const char     *INFLUXDB_DB   = "weatherstation";
45
-const char     *INFLUXDB_USER = "oko";
46
-const char     *INFLUXDB_PASS = "de1873a0d2f8f21f17cf4d8db4f65c59";
47
-
48
-String DEVICE_NAME  = "klaute";
49
-
32
+#define INITIAL_WEBSERVER_TIME 20

+ 19
- 0
firmware/config_user.h.example View File

@@ -0,0 +1,19 @@
1
+// Copy this file to config_user.h and adjust it to your needs.
2
+
3
+// Debug output on the serial console
4
+#define DEBUG 0
5
+
6
+// Enable/Disable features
7
+#define WEBUPDATER_FEATURE 0
8
+#define BATTERY_POWERED 1
9
+#define POWERSAVING 1
10
+
11
+// InfluxDB credentials
12
+const char     *INFLUXDB_HOST = "hostname";
13
+const uint16_t  INFLUXDB_PORT = 80;
14
+const char     *INFLUXDB_DB   = "database";
15
+const char     *INFLUXDB_USER = "user";
16
+const char     *INFLUXDB_PASS = "password";
17
+
18
+// Device name
19
+String          DEVICE_NAME   = "devicename";

+ 3
- 2
firmware/firmware.ino View File

@@ -7,11 +7,12 @@
7 7
 #include <ESP8266WebServer.h>
8 8
 #include <WiFiManager.h>       // WiFiManager
9 9
 #include <ESP8266Influxdb.h>   // https://github.com/hwwong/ESP8266Influxdb auchecken und den ordner in das arduino\library verzeichnis kopieren
10
-#include <Adafruit_Sensor.h>   // PAckage Adafruit Unified Sensor
10
+#include <Adafruit_Sensor.h>   // Package Adafruit Unified Sensor
11 11
 #include <Adafruit_APDS9960.h> // Adafruit APDS9960 - https://www.makerfabs.com/index.php?route=product/product&product_id=281
12 12
 #include <Adafruit_BME280.h>   // BME280 - https://www.roboter-bausatz.de/1704/bmp280-barometer-luftdrucksensor?gclid=EAIaIQobChMIlpumj8Hp2wIVFWYbCh01PgmFEAQYAyABEgIwBvD_BwE
13 13
 
14 14
 #include "config.h"
15
+#include "config_user.h"
15 16
 
16 17
 //*************************************************************************//
17 18
 
@@ -228,4 +229,4 @@ void _loop() {
228 229
 
229 230
 }
230 231
 
231
-//*************************************************************************//
232
+//*************************************************************************//

Loading…
Cancel
Save