60 lines
1.8 KiB
C
60 lines
1.8 KiB
C
#ifndef __CONFIG_H__
|
|
#define __CONFIG_H__
|
|
|
|
#define SENSOR_TEMPERATURE 0
|
|
#define SENSOR_HUMIDITY 1
|
|
#define SENSOR_LIGHT 2
|
|
#define SENSOR_WINDSPEED 3
|
|
#define SENSOR_PRESSURE 4
|
|
#define SENSOR_BAT_VOLTAGE 5
|
|
#define SENSOR_ESAVEMODE 6
|
|
#define SENSOR_BATCHARGESTATE 7
|
|
|
|
#define BAT_CHARGE_STATE_CHARGED 2.0
|
|
#define BAT_CHARGE_STATE_CHARGING 1.0
|
|
#define BAT_CHARGE_STATE_NOTCHARGING 0.0
|
|
#define ENERGY_SAVE_MODE_ENABLED 1.0
|
|
#define ENERGY_SAVE_MODE_DISABLED 0.0
|
|
|
|
#define WIFI_AUTOCONNECT_TIMEOUT_S 120
|
|
#define WIFI_CONFIG_PORTAL_TIMEOUT_S 120
|
|
#define UPDATE_SENSOR_INTERVAL_S 300
|
|
#define UPDATE_WEBSERVER_INTVERVAL_S 1
|
|
#define DELAY_LOOP_MS 50
|
|
#define POWERSAVING_SLEEP_S 600
|
|
#define EMERGENCY_SLEEP_S 172800 // Sleep for 2 days to recover
|
|
#define ENERGY_SAVING_ITERATIONS 30
|
|
#define WIFI_MINIMUM_SIGNAL_QUALITY 10 // percent
|
|
#define RESET_ESP_TIME_INTERVAL_MS 3600000
|
|
|
|
#define ROTOR_LENGTH_KM 0.000105
|
|
#define WIND_SENSOR_MEAS_TIME_S 5.0
|
|
#define SEC_TO_HOUR_FACTOR (60.0 * 60.0)
|
|
#define COUNT_TO_KMH ((TWO_PI * ROTOR_LENGTH_KM / WIND_SENSOR_MEAS_TIME_S) * SEC_TO_HOUR_FACTOR)
|
|
|
|
#define BAT_LOW_VOLTAGE 3.6
|
|
#define BAT_EMERGENCY_DEEPSLEEP_VOLTAGE 3.5
|
|
|
|
#define SEALEVELPRESSURE_HPA (1013.25)
|
|
|
|
#define STATUS_LED_PIN LED_BUILTIN
|
|
#define ANEMOMETER_PIN D7
|
|
|
|
#ifndef BAT_PINS_D34
|
|
#define BAT_CHARGED_PIN D6
|
|
#define BAT_CHARGING_PIN D5
|
|
#else
|
|
#define BAT_CHARGED_PIN D3
|
|
#define BAT_CHARGING_PIN D4
|
|
#endif
|
|
|
|
#define BME_SCK 13
|
|
#define BME_MISO 12
|
|
#define BME_MOSI 11
|
|
#define BME_CS 10
|
|
#define BME_ADDRESS 0x76
|
|
|
|
#define INITIAL_WEBSERVER_TIME 20
|
|
#define WEB_UPDATER_HTTP_PORT 8080
|
|
|
|
#endif
|