2019-01-27 20:14:43 +01:00
# ifndef __CONFIG_H__
# define __CONFIG_H__
2017-11-20 20:15:14 +01:00
# define SENSOR_TEMPERATURE 0
# define SENSOR_HUMIDITY 1
# define SENSOR_LIGHT 2
# define SENSOR_WINDSPEED 3
2017-11-20 20:42:02 +01:00
# define SENSOR_PRESSURE 4
2018-07-11 11:12:53 +02:00
# define SENSOR_BAT_VOLTAGE 5
2019-02-02 10:09:00 +01:00
# 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
2019-02-02 14:01:13 +01:00
# define ENERGY_SAVE_MODE_ENABLED 1.0
# define ENERGY_SAVE_MODE_DISABLED 0.0
2017-11-07 22:20:14 +01:00
2022-05-09 09:42:42 +02:00
# define WIFI_AUTOCONNECT_TIMEOUT_S 120
# define WIFI_CONFIG_PORTAL_TIMEOUT_S 120
# define UPDATE_SENSOR_INTERVAL_S 300
2022-05-16 14:27:39 +02:00
# define UPDATE_WEBSERVER_INTVERVAL_S 1 // Do not change, bigger values will prevent using webupdater webinterface
2022-05-16 13:34:33 +02:00
# define DELAY_LOOP_MS 50
2019-02-02 11:15:27 +01:00
# define POWERSAVING_SLEEP_S 600
2018-12-02 17:06:06 +01:00
# define EMERGENCY_SLEEP_S 172800 // Sleep for 2 days to recover
2022-05-22 16:35:10 +02:00
# define RESET_ESP_TIME_INTERVAL_MS 3600000
# define WIND_SENSOR_MEAS_TIME_S 15.0
2019-02-02 11:15:27 +01:00
# define ENERGY_SAVING_ITERATIONS 30
2022-05-15 22:34:36 +02:00
# define WIFI_MINIMUM_SIGNAL_QUALITY 10 // percent
2022-05-22 16:35:10 +02:00
// thingiverse anomometer settings: https://www.thingiverse.com/thing:2559929/files
2022-05-18 19:08:55 +02:00
# define ROTOR_LENGTH_CM 8.25
# define ROTOR_LENGTH_M (ROTOR_LENGTH_CM / 100.0)
2022-05-22 16:35:10 +02:00
//#define ROTOR_LENGTH_KM (ROTOR_LENGTH_M / 1000.0) // configuration example for generalization
//#define SEC_TO_HOUR_FACTOR (60.0 * 60.0) // configuration example for generalization
2022-05-21 17:46:06 +02:00
# define MPS_CORRECT_FACT 9.28
2022-05-22 16:35:10 +02:00
//#define COUNT_TO_KMH ((TWO_PI * ROTOR_LENGTH_KM / WIND_SENSOR_MEAS_TIME_S) * SEC_TO_HOUR_FACTOR) // configuration exampe for generalization
2022-05-18 19:08:55 +02:00
# define COUNT_TO_MPS (TWO_PI * ROTOR_LENGTH_M / WIND_SENSOR_MEAS_TIME_S)
2022-05-22 16:35:10 +02:00
// only this define is used for calculation, all other before are only used to describe the math v_wind = correction_factor * rotations * 2 * pi * radius / time_of_measurement_in_sec
// and if required the result has t be multiplied by another factor to convert it from m/s
2022-05-21 17:46:06 +02:00
# define WINDSPEED_FACTOR (COUNT_TO_MPS * MPS_CORRECT_FACT)
2018-07-19 20:13:08 +02:00
2022-05-22 16:35:10 +02:00
// china aliexpress anemometer settings (calculation unknown) <add link here>
//#define WINDSPEED_FACTOR 2.4
// enable HTTP_CALL_ON_WINDSPEED_EXCEED in config_user.h to enable this feature
# define HTTP_CALL_ON_WINDSPEED_EXCEED_MPS 5.0 // 5.0 m/s == 18 km/h
# define HTTP_CALL_ON_WINDSPEED_INTERVAL_S 60 // it's required to be bigger than WIND_SENSOR_MEAS_TIME_S
# define HTTP_CALL_ON_WINDSPEED_URL "http: //192.168.178.100:3001/button-windspeedexceed?event=click"
2022-05-22 08:51:24 +02:00
2018-12-02 17:06:06 +01:00
# define BAT_LOW_VOLTAGE 3.6
# define BAT_EMERGENCY_DEEPSLEEP_VOLTAGE 3.5
2017-11-07 22:20:14 +01:00
2019-01-08 22:41:24 +01:00
# define SEALEVELPRESSURE_HPA (1013.25)
2019-02-03 19:10:38 +01:00
# define STATUS_LED_PIN LED_BUILTIN
2018-06-23 21:49:11 +02:00
# define ANEMOMETER_PIN D7
2020-02-20 19:49:44 +01:00
# ifndef BAT_PINS_D34
2019-02-02 11:15:27 +01:00
# define BAT_CHARGED_PIN D6
# define BAT_CHARGING_PIN D5
2020-02-20 19:49:44 +01:00
# else
# define BAT_CHARGED_PIN D3
# define BAT_CHARGING_PIN D4
# endif
2017-11-20 20:15:14 +01:00
2018-06-23 20:13:33 +02:00
# define BME_SCK 13
2017-12-09 18:08:37 +01:00
# define BME_MISO 12
# define BME_MOSI 11
2018-06-23 20:13:33 +02:00
# define BME_CS 10
2019-02-03 19:10:38 +01:00
# define BME_ADDRESS 0x76
2017-12-09 18:08:37 +01:00
2022-05-15 22:34:36 +02:00
# define INITIAL_WEBSERVER_TIME 20
# define WEB_UPDATER_HTTP_PORT 8080
2019-01-27 20:14:43 +01:00
2022-05-09 09:42:42 +02:00
# endif