feature/InfluxDB-Connection-Update #1
3 changed files with 15 additions and 7 deletions
14
firmware/config_user.h.example
Normal file → Executable file
14
firmware/config_user.h.example
Normal file → Executable file
|
@ -9,18 +9,25 @@
|
|||
|
||||
// Enable/Disable features
|
||||
//#define WEBUPDATER_FEATURE
|
||||
#define INFLUXDB_FEATURE
|
||||
//#define INFLUXDB_FEATURE
|
||||
#define SERIAL_FEATURE
|
||||
#define BATTERY_POWERED
|
||||
#define SENSOR_WIND
|
||||
//#define BATTERY_POWERED
|
||||
//#define SENSOR_WIND
|
||||
#define SENSOR_APDS9960
|
||||
//#define SENSOR_APDS9930
|
||||
#define SENSOR_BME280
|
||||
#define SENSOR_BATTERY
|
||||
//#define BAT_PINS_D34
|
||||
// only possible if webupdater is also enabled
|
||||
//#define HOMEBRIDGE_WEBSTAT
|
||||
// retries to connect after 5 seconds or starts the wifimanager
|
||||
//#define SLEEP_IF_NO_WLAN_CONNECTION
|
||||
// Restarts the firmware every n seconds
|
||||
//#define RESET_ESP_TIMEINTERVAL
|
||||
|
||||
const float HUMIDITY_FACTOR = 1.0;
|
||||
const float LIGHT_FACTOR = 1.0;
|
||||
const float TEMP_FACTOR = 1.0;
|
||||
|
||||
// InfluxDB credentials
|
||||
const char *INFLUXDB_HOST = "hostname";
|
||||
|
@ -35,3 +42,4 @@ const char *INFLUXDB_PASS = "password";
|
|||
String DEVICE_NAME = "devicename";
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -67,10 +67,10 @@ void setup()
|
|||
// the time in seconds to wait for the user to configure the device
|
||||
wifiManager.setTimeout(WIFI_CONFIG_PORTAL_TIMEOUT_S);
|
||||
|
||||
#ifdef SLEEP_IF_NO_WLAN_CONNECTION
|
||||
#ifndef SLEEP_IF_NO_WLAN_CONNECTION
|
||||
while
|
||||
#endif
|
||||
#ifndef SLEEP_IF_NO_WLAN_CONNECTION
|
||||
#if def SLEEP_IF_NO_WLAN_CONNECTION
|
||||
if
|
||||
#endif
|
||||
(!wifiManager.autoConnect(wifiName.c_str(), "DEADBEEF"))
|
||||
|
|
4
firmware/sensor_bme280.ino
Executable file → Normal file
4
firmware/sensor_bme280.ino
Executable file → Normal file
|
@ -14,11 +14,11 @@ bool sensor_bme280_begin(uint8_t addr) {
|
|||
}
|
||||
|
||||
float bme280_temperature() {
|
||||
return _sensor_bme280.readTemperature();
|
||||
return _sensor_bme280.readTemperature() * TEMP_FACTOR;
|
||||
}
|
||||
float bme280_pressure() {
|
||||
return _sensor_bme280.readPressure() / 100.0F;
|
||||
}
|
||||
float bme280_humidity() {
|
||||
return _sensor_bme280.readHumidity() * HUMIDITY_FACTOR;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue