mirror of
https://github.com/IoTManagerProject/IoTManager.git
synced 2026-03-26 22:22:16 +03:00
Возможность быстрого переключения прошивок
This commit is contained in:
@@ -3,8 +3,8 @@
|
|||||||
"chipID": "",
|
"chipID": "",
|
||||||
"apssid": "IoTmanager",
|
"apssid": "IoTmanager",
|
||||||
"appass": "",
|
"appass": "",
|
||||||
"routerssid": "rise",
|
"routerssid": "WLAN1-Y1GYEF",
|
||||||
"routerpass": "hostel3333",
|
"routerpass": "2egY69YTA8DDR7En",
|
||||||
"timezone": 1,
|
"timezone": 1,
|
||||||
"ntp": "pool.ntp.org",
|
"ntp": "pool.ntp.org",
|
||||||
"mqttServer": "91.204.228.124",
|
"mqttServer": "91.204.228.124",
|
||||||
|
|||||||
@@ -1,18 +1,31 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
//===========Firmware=============================================================================================================================================
|
|
||||||
#define FIRMWARE_VERSION 274
|
#define FIRMWARE_VERSION 274
|
||||||
#define USE_OTA false
|
|
||||||
//===========FileSystem==============================================================================================================================================
|
#ifdef esp8266_4mb
|
||||||
|
#define FIRMWARE_NAME "esp8266_4mb"
|
||||||
#define USE_LITTLEFS true
|
#define USE_LITTLEFS true
|
||||||
//==================================================================================================================================================================
|
#define USE_OTA true
|
||||||
#define NUM_BUTTONS 6
|
|
||||||
#define LED_PIN 2
|
#define LED_PIN 2
|
||||||
//===========MQTT=================================================================================================================================================
|
#endif
|
||||||
|
|
||||||
|
#ifdef esp8266_1mb
|
||||||
|
#define FIRMWARE_NAME "esp8266_1mb"
|
||||||
|
#define USE_LITTLEFS false
|
||||||
|
#define USE_OTA false
|
||||||
|
#define LED_PIN 2
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef esp32_4mb
|
||||||
|
#define FIRMWARE_NAME "esp32_4mb"
|
||||||
|
#define USE_LITTLEFS false
|
||||||
|
#define USE_OTA true
|
||||||
|
#define LED_PIN 22
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#define NUM_BUTTONS 6
|
||||||
#define MQTT_RECONNECT_INTERVAL 20000
|
#define MQTT_RECONNECT_INTERVAL 20000
|
||||||
//==========Telemetry=============================================================================================================================================
|
|
||||||
#define TELEMETRY_UPDATE_INTERVAL_MIN 60
|
#define TELEMETRY_UPDATE_INTERVAL_MIN 60
|
||||||
//=========Configuration==========================================================================================================================================
|
|
||||||
#define DEVICE_CONFIG_FILE "s.conf.csv"
|
#define DEVICE_CONFIG_FILE "s.conf.csv"
|
||||||
#define DEVICE_SCENARIO_FILE "s.scen.txt"
|
#define DEVICE_SCENARIO_FILE "s.scen.txt"
|
||||||
//=========System parts===========================================================================================================================================
|
//=========System parts===========================================================================================================================================
|
||||||
@@ -22,28 +35,16 @@
|
|||||||
//#define LAYOUT_IN_RAM
|
//#define LAYOUT_IN_RAM
|
||||||
//#define UDP_ENABLED
|
//#define UDP_ENABLED
|
||||||
//#define SSDP_ENABLED
|
//#define SSDP_ENABLED
|
||||||
//=========Sensors enable/disable=================================================================================================================================
|
|
||||||
#define SensorBme280Enabled
|
#define SensorBme280Enabled
|
||||||
#define SensorBmp280Enabled
|
#define SensorBmp280Enabled
|
||||||
#define SensorDhtEnabled
|
#define SensorDhtEnabled
|
||||||
#define PwmOutEnable
|
#define PwmOutEnable
|
||||||
//=========Features=================================================================================================================================
|
|
||||||
#define telegramEnable
|
#define telegramEnable
|
||||||
#define uartEnable
|
#define uartEnable
|
||||||
|
|
||||||
#ifdef ESP8266
|
|
||||||
#ifdef USE_OTA
|
|
||||||
#define FIRMWARE_NAME "esp8266-1mb"
|
|
||||||
#else
|
|
||||||
#define FIRMWARE_NAME "esp8266"
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef ESP32
|
|
||||||
#define FIRMWARE_NAME "esp32"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//================================================================================================================================================================
|
//================================================================================================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum TimerTask_t { WIFI_SCAN,
|
enum TimerTask_t { WIFI_SCAN,
|
||||||
WIFI_MQTT_CONNECTION_CHECK,
|
WIFI_MQTT_CONNECTION_CHECK,
|
||||||
TIME,
|
TIME,
|
||||||
@@ -79,6 +80,27 @@ enum ConfigType_t {
|
|||||||
CT_CONFIG,
|
CT_CONFIG,
|
||||||
CT_SCENARIO
|
CT_SCENARIO
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//history
|
//history
|
||||||
//07.11.2020 (SSDP OFF, UDP OFF)
|
//07.11.2020 (SSDP OFF, UDP OFF)
|
||||||
//RAM: [===== ] 46.8% (used 38376 bytes from 81920 bytes)
|
//RAM: [===== ] 46.8% (used 38376 bytes from 81920 bytes)
|
||||||
|
|||||||
7
include/Macro.h
Normal file
7
include/Macro.h
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
//#pragma once
|
||||||
|
//#define ST(A) #A
|
||||||
|
//#define STR(A) ST(A)
|
||||||
|
//
|
||||||
|
//#ifdef esp32_4mb
|
||||||
|
//#pragma message STR(esp32_4mb)
|
||||||
|
//#endif
|
||||||
@@ -8,8 +8,12 @@
|
|||||||
; Please visit documentation for the other options and examples
|
; Please visit documentation for the other options and examples
|
||||||
; https://docs.platformio.org/page/projectconf.html
|
; https://docs.platformio.org/page/projectconf.html
|
||||||
|
|
||||||
|
;Please use one of definition:
|
||||||
|
;esp8266_1mb , esp8266_4mb , esp32_4mb
|
||||||
[platformio]
|
[platformio]
|
||||||
default_envs = esp32
|
default_envs = esp32_4mb
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[common_env_data]
|
[common_env_data]
|
||||||
lib_deps_external =
|
lib_deps_external =
|
||||||
@@ -25,42 +29,10 @@ lib_deps_internal =
|
|||||||
GyverFilters
|
GyverFilters
|
||||||
OneWire
|
OneWire
|
||||||
|
|
||||||
[env:esp32]
|
|
||||||
framework = arduino
|
|
||||||
board = esp32dev
|
|
||||||
;board_build.ldscript = eagle.flash.4m2m.ld
|
|
||||||
platform = https://github.com/platformio/platform-espressif32.git
|
|
||||||
lib_deps =
|
|
||||||
${common_env_data.lib_deps_external}
|
|
||||||
${common_env_data.lib_deps_internal}
|
|
||||||
AsyncTCP
|
|
||||||
madhephaestus/ESP32Servo
|
|
||||||
luc-github/ESP32SSDP
|
|
||||||
CTBot
|
|
||||||
EspSoftwareSerial
|
|
||||||
monitor_filters = esp32_exception_decoder
|
|
||||||
upload_speed = 921600
|
|
||||||
monitor_speed = 115200
|
|
||||||
;board_build.filesystem = littlefs
|
|
||||||
;extra_scripts = ./tools/littlefsbuilder.py
|
|
||||||
|
|
||||||
[env:esp8266_01_1m]
|
|
||||||
framework = arduino
|
|
||||||
board = nodemcuv2
|
|
||||||
board_build.ldscript = eagle.flash.1m256.ld
|
|
||||||
platform = https://github.com/platformio/platform-espressif8266.git
|
|
||||||
lib_deps =
|
|
||||||
${common_env_data.lib_deps_external}
|
|
||||||
${common_env_data.lib_deps_internal}
|
|
||||||
ESPAsyncTCP
|
|
||||||
ESPAsyncUDP
|
|
||||||
EspSoftwareSerial
|
|
||||||
CTBot
|
|
||||||
monitor_filters = esp8266_exception_decoder
|
|
||||||
upload_speed = 921600
|
|
||||||
monitor_speed = 115200
|
|
||||||
|
|
||||||
[env:esp8266]
|
[env:esp8266_4mb]
|
||||||
|
build_flags = -Desp8266_1mb="esp8266_4mb"
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board = nodemcuv2
|
board = nodemcuv2
|
||||||
board_build.ldscript = eagle.flash.4m1m.ld
|
board_build.ldscript = eagle.flash.4m1m.ld
|
||||||
@@ -76,3 +48,48 @@ monitor_filters = esp8266_exception_decoder
|
|||||||
upload_speed = 921600
|
upload_speed = 921600
|
||||||
monitor_speed = 115200
|
monitor_speed = 115200
|
||||||
board_build.filesystem = littlefs
|
board_build.filesystem = littlefs
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[env:esp8266_1mb]
|
||||||
|
build_flags = -Desp8266_1mb="esp8266_1mb"
|
||||||
|
framework = arduino
|
||||||
|
board = nodemcuv2
|
||||||
|
board_build.ldscript = eagle.flash.1m256.ld
|
||||||
|
platform = https://github.com/platformio/platform-espressif8266.git
|
||||||
|
lib_deps =
|
||||||
|
${common_env_data.lib_deps_external}
|
||||||
|
${common_env_data.lib_deps_internal}
|
||||||
|
ESPAsyncTCP
|
||||||
|
ESPAsyncUDP
|
||||||
|
EspSoftwareSerial
|
||||||
|
CTBot
|
||||||
|
monitor_filters = esp8266_exception_decoder
|
||||||
|
upload_speed = 921600
|
||||||
|
monitor_speed = 115200
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
[env:esp32_4mb]
|
||||||
|
build_flags = -Desp32_4mb="esp32_4mb"
|
||||||
|
framework = arduino
|
||||||
|
board = esp32dev
|
||||||
|
platform = https://github.com/platformio/platform-espressif32.git
|
||||||
|
lib_deps =
|
||||||
|
${common_env_data.lib_deps_external}
|
||||||
|
${common_env_data.lib_deps_internal}
|
||||||
|
AsyncTCP
|
||||||
|
madhephaestus/ESP32Servo
|
||||||
|
luc-github/ESP32SSDP
|
||||||
|
CTBot
|
||||||
|
EspSoftwareSerial
|
||||||
|
monitor_filters = esp32_exception_decoder
|
||||||
|
upload_speed = 921600
|
||||||
|
monitor_speed = 115200
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
#include "Tests.h"
|
#include "Tests.h"
|
||||||
|
#include "Macro.h"
|
||||||
#include "Global.h"
|
#include "Global.h"
|
||||||
#include "ItemsList.h"
|
#include "ItemsList.h"
|
||||||
|
|
||||||
void testsPerform() {
|
void testsPerform() {
|
||||||
Serial.println("====some tests section====");
|
Serial.println("====some tests section====");
|
||||||
|
|
||||||
|
#ifdef esp32_4mb
|
||||||
|
Serial.println("esp32_4mb defined");
|
||||||
|
#endif
|
||||||
|
#ifdef esp8266_1mb
|
||||||
|
Serial.println("esp32_4mb defined");
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//Serial.println(STR(esp32_4mb));
|
||||||
|
|
||||||
Serial.println("==========end============");
|
Serial.println("==========end============");
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user