2020-09-02 22:34:49 +03:00
|
|
|
#pragma once
|
2020-09-18 00:02:20 +03:00
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
//===========Firmware=============================================================================================================================================
|
2020-10-19 01:21:20 +03:00
|
|
|
#ifdef ESP8266
|
2020-09-06 23:00:33 +03:00
|
|
|
#define FIRMWARE_NAME "esp8266-iotm"
|
2020-11-07 01:11:32 +03:00
|
|
|
#define FIRMWARE_VERSION 267
|
2020-10-19 01:21:20 +03:00
|
|
|
#endif
|
|
|
|
|
#ifdef ESP32
|
|
|
|
|
#define FIRMWARE_NAME "esp32-iotm"
|
2020-11-07 01:11:32 +03:00
|
|
|
#define FIRMWARE_VERSION 267
|
2020-10-19 01:21:20 +03:00
|
|
|
#endif
|
2020-09-18 00:02:20 +03:00
|
|
|
#define FLASH_4MB true
|
2020-09-17 21:33:54 +03:00
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
//===========FSystem==============================================================================================================================================
|
2020-09-02 22:34:49 +03:00
|
|
|
#define NUM_BUTTONS 6
|
|
|
|
|
#define LED_PIN 2
|
|
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
//===========MQTT=================================================================================================================================================
|
2020-09-02 22:34:49 +03:00
|
|
|
#define MQTT_RECONNECT_INTERVAL 20000
|
|
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
//==========Telemetry=============================================================================================================================================
|
2020-09-07 00:36:03 +03:00
|
|
|
#define TELEMETRY_UPDATE_INTERVAL_MIN 60
|
2020-09-02 22:34:49 +03:00
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
//=========Configuration==========================================================================================================================================
|
2020-09-02 22:34:49 +03:00
|
|
|
#define DEVICE_CONFIG_FILE "s.conf.csv"
|
|
|
|
|
#define DEVICE_SCENARIO_FILE "s.scen.txt"
|
|
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
|
|
|
|
|
//=========System parts===========================================================================================================================================
|
2020-09-02 22:34:49 +03:00
|
|
|
//#define OTA_UPDATES_ENABLED
|
|
|
|
|
//#define MDNS_ENABLED
|
|
|
|
|
//#define WEBSOCKET_ENABLED
|
|
|
|
|
//#define LAYOUT_IN_RAM
|
2020-11-02 04:09:15 +03:00
|
|
|
//#define UDP_ENABLED
|
2020-11-01 04:48:35 +03:00
|
|
|
//#define SSDP_ENABLED
|
2020-09-02 22:34:49 +03:00
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
//=========Sensors enable/disable=================================================================================================================================
|
2020-09-02 22:34:49 +03:00
|
|
|
#define TANK_LEVEL_SAMPLES 10
|
|
|
|
|
#define LEVEL_ENABLED
|
|
|
|
|
#define ANALOG_ENABLED
|
|
|
|
|
#define DALLAS_ENABLED
|
|
|
|
|
#define DHT_ENABLED
|
|
|
|
|
#define BMP_ENABLED
|
|
|
|
|
#define BME_ENABLED
|
|
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
|
|
|
|
|
//=========Gears enable/disable===================================================================================================================================
|
2020-09-02 22:34:49 +03:00
|
|
|
#define STEPPER_ENABLED
|
|
|
|
|
#define SERVO_ENABLED
|
|
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
|
|
|
|
|
//========Other enable/disable====================================================================================================================================
|
2020-09-02 22:34:49 +03:00
|
|
|
#define LOGGING_ENABLED
|
|
|
|
|
#define SERIAL_ENABLED
|
|
|
|
|
#define PUSH_ENABLED
|
|
|
|
|
|
|
|
|
|
struct Time_t {
|
|
|
|
|
uint8_t second;
|
|
|
|
|
uint8_t minute;
|
|
|
|
|
uint8_t hour;
|
|
|
|
|
uint8_t day_of_week;
|
|
|
|
|
uint8_t day_of_month;
|
|
|
|
|
uint8_t month;
|
|
|
|
|
uint16_t day_of_year;
|
|
|
|
|
uint16_t year;
|
|
|
|
|
unsigned long days;
|
|
|
|
|
unsigned long valid;
|
|
|
|
|
};
|
|
|
|
|
|
2020-11-01 16:50:44 +03:00
|
|
|
//================================================================================================================================================================
|
2020-09-02 22:34:49 +03:00
|
|
|
enum TimerTask_t { WIFI_SCAN,
|
|
|
|
|
WIFI_MQTT_CONNECTION_CHECK,
|
2020-10-20 22:55:45 +03:00
|
|
|
SENSORS10SEC,
|
2020-10-20 23:58:23 +03:00
|
|
|
SENSORS30SEC,
|
2020-09-02 22:34:49 +03:00
|
|
|
TIMER_COUNTDOWN,
|
|
|
|
|
TIME,
|
|
|
|
|
TIME_SYNC,
|
|
|
|
|
STATISTICS,
|
2020-09-15 23:50:08 +03:00
|
|
|
STATISTICS_WORK,
|
2020-09-02 22:34:49 +03:00
|
|
|
UPTIME,
|
|
|
|
|
UDP,
|
|
|
|
|
UDP_DB,
|
|
|
|
|
TEST };
|
|
|
|
|
|
2020-10-18 09:52:17 +03:00
|
|
|
enum NotAsyncActions {
|
2020-09-17 21:33:54 +03:00
|
|
|
do_ZERO,
|
|
|
|
|
do_UPGRADE,
|
|
|
|
|
do_GETLASTVERSION,
|
|
|
|
|
do_UDPDATAPARSE,
|
|
|
|
|
do_MQTTUDP,
|
|
|
|
|
do_BUSSCAN,
|
|
|
|
|
do_MQTTPARAMSCHANGED,
|
2020-10-10 01:44:11 +03:00
|
|
|
do_deviceInit,
|
|
|
|
|
do_delChoosingItems,
|
2020-09-17 21:33:54 +03:00
|
|
|
do_LAST,
|
|
|
|
|
};
|
2020-09-02 22:34:49 +03:00
|
|
|
|
|
|
|
|
enum LedStatus_t {
|
|
|
|
|
LED_OFF,
|
|
|
|
|
LED_ON,
|
|
|
|
|
LED_SLOW,
|
|
|
|
|
LED_FAST
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
enum ConfigType_t {
|
|
|
|
|
CT_CONFIG,
|
|
|
|
|
CT_SCENARIO
|
2020-11-07 01:11:32 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//07.11.2020
|
|
|
|
|
//RAM: [===== ] 46.8% (used 38376 bytes from 81920 bytes)
|
|
|
|
|
//Flash: [===== ] 54.2% (used 566004 bytes from 1044464 bytes)
|