From 75f1d2a26dbe3a2f0c71b24fcb3ea3a4be3e0e92 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sat, 13 Mar 2021 15:48:38 +0100 Subject: [PATCH 1/9] Phase 2 of new Tasmota32 build variants --- .github/workflows/CI_github_ESP32.yml | 40 ----- .github/workflows/Tasmota_build.yml | 42 ----- .github/workflows/Tasmota_build_master.yml | 42 ----- platformio_override_sample.ini | 2 - platformio_tasmota32.ini | 2 - platformio_tasmota_env32.ini | 10 -- tasmota/tasmota.h | 1 + tasmota/tasmota_configurations.h | 9 + tasmota/tasmota_configurations_ESP32.h | 188 ++++++++++++++++++++- tasmota/user_config_override_sample.h | 3 + 10 files changed, 200 insertions(+), 139 deletions(-) diff --git a/.github/workflows/CI_github_ESP32.yml b/.github/workflows/CI_github_ESP32.yml index 849316beb..2a576e40d 100644 --- a/.github/workflows/CI_github_ESP32.yml +++ b/.github/workflows/CI_github_ESP32.yml @@ -104,46 +104,6 @@ jobs: name: firmware path: ./build_output - tasmota32-knx: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -U platformio - platformio upgrade --dev - platformio update - - name: Run PlatformIO - run: | - platformio run -e tasmota32-knx - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32-sensors: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -U platformio - platformio upgrade --dev - platformio update - - name: Run PlatformIO - run: | - platformio run -e tasmota32-sensors - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - tasmota32-display: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/Tasmota_build.yml b/.github/workflows/Tasmota_build.yml index dc595d978..40fd060ba 100644 --- a/.github/workflows/Tasmota_build.yml +++ b/.github/workflows/Tasmota_build.yml @@ -804,46 +804,6 @@ jobs: path: ./build_output - tasmota32-knx: - needs: tasmota_pull - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-knx - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-sensors: - needs: tasmota_pull - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-sensors - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32-display: needs: tasmota_pull runs-on: ubuntu-latest @@ -1434,14 +1394,12 @@ jobs: [ ! -f ./mv_firmware/firmware/tasmota-knx.* ] || mv ./mv_firmware/firmware/tasmota-knx.* ./firmware/tasmota/ [ ! -f ./mv_firmware/firmware/tasmota-zbbridge.* ] || mv ./mv_firmware/firmware/tasmota-zbbridge.* ./firmware/tasmota/ [ ! -f ./mv_firmware/firmware/tasmota32.* ] || mv ./mv_firmware/firmware/tasmota32.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-sensors.* ] || mv ./mv_firmware/firmware/tasmota32-sensors.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-ir*.* ] || mv ./mv_firmware/firmware/tasmota32-ir*.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-display.* ] || mv ./mv_firmware/firmware/tasmota32-display.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-web*.* ] || mv ./mv_firmware/firmware/tasmota32-web*.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-odroidgo.* ] || mv ./mv_firmware/firmware/tasmota32-odroidgo.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-core2.* ] || mv ./mv_firmware/firmware/tasmota32-core2.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-bluetooth.* ] || mv ./mv_firmware/firmware/tasmota32-bluetooth.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-knx.* ] || mv ./mv_firmware/firmware/tasmota32-knx.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32* ] || mv ./mv_firmware/firmware/tasmota32* ./firmware/tasmota32/languages/ [ ! -f ./mv_firmware/firmware/* ] || mv ./mv_firmware/firmware/* ./firmware/tasmota/languages/ [ ! -f ./tools/Esptool/ESP32/*.* ] || mv ./tools/Esptool/ESP32/*.* ./firmware/tasmota32/ESP32_needed_files/ diff --git a/.github/workflows/Tasmota_build_master.yml b/.github/workflows/Tasmota_build_master.yml index 4735d702e..4bef7a371 100644 --- a/.github/workflows/Tasmota_build_master.yml +++ b/.github/workflows/Tasmota_build_master.yml @@ -804,46 +804,6 @@ jobs: path: ./build_output - tasmota32-knx: - needs: tasmota_pull - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-knx - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - - tasmota32-sensors: - needs: tasmota_pull - runs-on: ubuntu-latest - continue-on-error: true - steps: - - uses: actions/checkout@v1 - - name: Set up Python - uses: actions/setup-python@v1 - - name: Install dependencies - run: | - pip install -U platformio - - name: Run PlatformIO - run: | - platformio run -e tasmota32-sensors - - uses: actions/upload-artifact@v2 - with: - name: firmware - path: ./build_output - - tasmota32-display: needs: tasmota_pull runs-on: ubuntu-latest @@ -1434,14 +1394,12 @@ jobs: [ ! -f ./mv_firmware/firmware/tasmota-knx.* ] || mv ./mv_firmware/firmware/tasmota-knx.* ./firmware/tasmota/ [ ! -f ./mv_firmware/firmware/tasmota-zbbridge.* ] || mv ./mv_firmware/firmware/tasmota-zbbridge.* ./firmware/tasmota/ [ ! -f ./mv_firmware/firmware/tasmota32.* ] || mv ./mv_firmware/firmware/tasmota32.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-sensors.* ] || mv ./mv_firmware/firmware/tasmota32-sensors.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-ir*.* ] || mv ./mv_firmware/firmware/tasmota32-ir*.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-display.* ] || mv ./mv_firmware/firmware/tasmota32-display.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-web*.* ] || mv ./mv_firmware/firmware/tasmota32-web*.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-odroidgo.* ] || mv ./mv_firmware/firmware/tasmota32-odroidgo.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-core2.* ] || mv ./mv_firmware/firmware/tasmota32-core2.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32-bluetooth.* ] || mv ./mv_firmware/firmware/tasmota32-bluetooth.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32-knx.* ] || mv ./mv_firmware/firmware/tasmota32-knx.* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/tasmota32* ] || mv ./mv_firmware/firmware/tasmota32* ./firmware/tasmota32/languages/ [ ! -f ./mv_firmware/firmware/* ] || mv ./mv_firmware/firmware/* ./firmware/tasmota/languages/ [ ! -f ./tools/Esptool/ESP32/*.* ] || mv ./tools/Esptool/ESP32/*.* ./firmware/tasmota32/ESP32_needed_files/ diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index 380145cd6..da565a651 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -29,8 +29,6 @@ default_envs = ; tasmota32 ; tasmota32-bluetooth ; tasmota32-webcam -; tasmota32-knx -; tasmota32-sensors ; tasmota32-display ; tasmota32-ir ; tasmota32-ircustom diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index 3eb8047da..1a69eec5d 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -11,8 +11,6 @@ default_envs = ${build_envs.default_envs} ; tasmota32-webcam ; tasmota32-odroidgo ; tasmota32-core2 -; tasmota32-knx -; tasmota32-sensors ; tasmota32-display ; tasmota32-ir ; tasmota32-ircustom diff --git a/platformio_tasmota_env32.ini b/platformio_tasmota_env32.ini index bcd391b62..29e8d69a5 100644 --- a/platformio_tasmota_env32.ini +++ b/platformio_tasmota_env32.ini @@ -66,16 +66,6 @@ extends = env:tasmota32 build_flags = ${common32.build_flags} -DFIRMWARE_BLUETOOTH lib_extra_dirs = lib/libesp32, lib/libesp32_div, lib/lib_basic, lib/lib_i2c, lib/lib_ssl -[env:tasmota32-knx] -extends = env:tasmota32 -build_flags = ${common32.build_flags} -DFIRMWARE_KNX_NO_EMULATION -lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_div - -[env:tasmota32-sensors] -extends = env:tasmota32 -build_flags = ${common32.build_flags} -DFIRMWARE_SENSORS -lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_i2c, lib/lib_rf, lib/lib_div, lib/lib_ssl - [env:tasmota32-display] extends = env:tasmota32 build_flags = ${common32.build_flags} -DFIRMWARE_DISPLAYS diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index 87e5f01b3..6c3f2c7db 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -31,6 +31,7 @@ \*********************************************************************************************/ #define CODE_IMAGE_STR "tasmota" +#define FLAG_VARIANT_TASMOTA32 #define USE_LIGHT // Enable light control #define USE_ENERGY_SENSOR // Use energy sensors (+14k code) diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index c4956bdbd..beefe4d8b 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -29,6 +29,8 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "sensors" +#undef FLAG_VARIANT_TASMOTA32 + #undef USE_DISCOVERY // Disable mDNS (+8k code or +23.5k code with core 2_5_x, +0.3k mem) @@ -231,6 +233,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "knx" +#undef FLAG_VARIANT_TASMOTA32 #ifndef USE_KNX #define USE_KNX // Enable KNX IP Protocol Support (+23k code, +3k3 mem) @@ -257,6 +260,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "display" +#undef FLAG_VARIANT_TASMOTA32 #undef USE_EMULATION // Disable Belkin WeMo and Hue Bridge emulation for Alexa (-16k code, -2k mem) #undef USE_EMULATION_HUE // Disable Hue Bridge emulation for Alexa (+14k code, +2k mem common) @@ -338,6 +342,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "ir" +#undef FLAG_VARIANT_TASMOTA32 #undef USE_EMULATION #undef USE_EMULATION_HUE // Disable Hue emulation - only for lights and relays @@ -463,6 +468,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "zbbridge" +#undef FLAG_VARIANT_TASMOTA32 #undef MODULE #define MODULE SONOFF_ZB_BRIDGE // [Module] Select default module from tasmota_template.h @@ -620,6 +626,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "lite" +#undef FLAG_VARIANT_TASMOTA32 #undef APP_SLEEP #define APP_SLEEP 1 // Default to sleep = 1 for FIRMWARE_LITE @@ -752,6 +759,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "minimal" +#undef FLAG_VARIANT_TASMOTA32 #undef FIRMWARE_LITE // Disable tasmota-lite with no sensors #undef FIRMWARE_SENSORS // Disable tasmota-sensors with useful sensors enabled @@ -899,6 +907,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "mini-custom" +#undef FLAG_VARIANT_TASMOTA32 #undef FIRMWARE_LITE // Disable tasmota-lite with no sensors #undef FIRMWARE_SENSORS // Disable tasmota-sensors with useful sensors enabled diff --git a/tasmota/tasmota_configurations_ESP32.h b/tasmota/tasmota_configurations_ESP32.h index 951d63e41..990d95edc 100644 --- a/tasmota/tasmota_configurations_ESP32.h +++ b/tasmota/tasmota_configurations_ESP32.h @@ -31,6 +31,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "webcam" +#undef FLAG_VARIANT_TASMOTA32 #define USE_WEBCAM #undef USE_MI_ESP32 // (ESP32 only) Disable support for ESP32 as a BLE-bridge (+9k2 mem, +292k flash) @@ -45,6 +46,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "odroid-go" +#undef FLAG_VARIANT_TASMOTA32 #undef MODULE #define MODULE ODROID_GO // [Module] Select default module from tasmota_template.h @@ -72,6 +74,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "core2" +#undef FLAG_VARIANT_TASMOTA32 #undef MODULE #define MODULE M5STACK_CORE2 // [Module] Select default module from tasmota_template.h @@ -126,6 +129,7 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "bluetooth" +#undef FLAG_VARIANT_TASMOTA32 #undef MODULE #define MODULE WEMOS // [Module] Select default module from tasmota_template.h @@ -140,6 +144,188 @@ #define USE_MI_ESP32 // (ESP32 only) Add support for ESP32 as a BLE-bridge (+9k2 mem, +292k flash) #endif // FIRMWARE_BLUETOOTH -#endif // ESP32 +/*********************************************************************************************\ + * [tasmota32.bin] + * Provide an image which includes KNX and Sensors +\*********************************************************************************************/ +// FLAG_VARIANT_TASMOTA32 is set for variant "Tasmota32" -> tasmota.h +// for all other Tasmota build variants this flag needs to be undefined!! + +#ifdef FLAG_VARIANT_TASMOTA32 + +#define USE_ENHANCED_GUI_WIFI_SCAN + +#define ROTARY_V1 // Add support for Rotary Encoder as used in MI Desk Lamp + +#define USE_TUYA_MCU // Add support for Tuya Serial MCU +#ifndef TUYA_DIMMER_ID + #define TUYA_DIMMER_ID 0 // Default dimmer Id +#endif +#undef USE_ARMTRONIX_DIMMERS // Disable support for Armtronix Dimmers (+1k4 code) +//#undef USE_PS_16_DZ // Disable support for PS-16-DZ Dimmer (+2k code) +#undef USE_SONOFF_IFAN // Disable support for Sonoff iFan02 and iFan03 (+2k code) +#define USE_BUZZER // Add support for a buzzer (+0k6 code) +//#undef USE_ARILUX_RF // Disable support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0)) +#define USE_DEEPSLEEP // Add support for deepsleep (+1k code) +#undef USE_EXS_DIMMER // Disable support for EX-Store WiFi Dimmer +//#define USE_HOTPLUG // Add support for sensor HotPlug +//#undef USE_DEVICE_GROUPS // Disable support for device groups (+5k6 code) +#undef USE_PWM_DIMMER // Disable support for MJ-SD01/acenx/NTONPOWER PWM dimmers (+4k5 code) +#undef USE_KEELOQ // Disable support for Jarolift rollers by Keeloq algorithm (+4k5 code) +#undef USE_SONOFF_D1 // Disable support for Sonoff D1 Dimmer (+0k7 code) +#undef USE_SHELLY_DIMMER // Disable support for Shelly Dimmer (+3k code) + +#define USE_LIGHT_PALETTE // Add support for color palette (+0k9 code) + +#define USE_DS18x20 // Add support for DS18x20 sensors with id sort, single scan and read retry (+1k3 code) + +#define USE_I2C // I2C using library wire (+10k code, 0k2 mem, 124 iram) +#define USE_SHT // [I2cDriver8] Enable SHT1X sensor (+1k4 code) +#define USE_HTU // [I2cDriver9] Enable HTU21/SI7013/SI7020/SI7021 sensor (I2C address 0x40) (+1k5 code) +#define USE_BMP // [I2cDriver10] Enable BMP085/BMP180/BMP280/BME280 sensors (I2C addresses 0x76 and 0x77) (+4k4 code) + #define USE_BME680 // Enable support for BME680 sensor using Bosch BME680 library (+4k code) +#define USE_BH1750 // [I2cDriver11] Enable BH1750 sensor (I2C address 0x23 or 0x5C) (+0k5 code) +#define USE_VEML6070 // [I2cDriver12] Enable VEML6070 sensor (I2C addresses 0x38 and 0x39) (+1k5 code) +//#define USE_VEML6075 // [I2cDriver49] Enable VEML6075 UVA/UVB/UVINDEX Sensor (I2C address 0x10) (+2k1 code) +//#define USE_VEML7700 // [I2cDriver50] Enable VEML7700 Ambient Light sensor (I2C addresses 0x10) (+4k5 code) +#define USE_ADS1115 // [I2cDriver13] Enable ADS1115 16 bit A/D converter (I2C address 0x48, 0x49, 0x4A or 0x4B) based on Adafruit ADS1x15 library (no library needed) (+0k7 code) +#define USE_INA219 // [I2cDriver14] Enable INA219 (I2C address 0x40, 0x41 0x44 or 0x45) Low voltage and current sensor (+1k code) +//#define USE_INA226 // [I2cDriver35] Enable INA226 (I2C address 0x40, 0x41 0x44 or 0x45) Low voltage and current sensor (+2k3 code) +#define USE_SHT3X // [I2cDriver15] Enable SHT3x (I2C address 0x44 or 0x45) or SHTC3 (I2C address 0x70) sensor (+0k7 code) +#define USE_TSL2561 // [I2cDriver16] Enable TSL2561 sensor (I2C address 0x29, 0x39 or 0x49) using library Joba_Tsl2561 (+2k3 code) +//#define USE_TSL2591 // [I2cDriver40] Enable TSL2591 sensor (I2C address 0x29) using library Adafruit_TSL2591 (+1k6 code) +#define USE_MGS // [I2cDriver17] Enable Xadow and Grove Mutichannel Gas sensor using library Multichannel_Gas_Sensor (+10k code) +#define USE_SGP30 // [I2cDriver18] Enable SGP30 sensor (I2C address 0x58) (+1k1 code) +//#define USE_SI1145 // [I2cDriver19] Enable SI1145/46/47 sensor (I2C address 0x60) (+1k code) +#define USE_LM75AD // [I2cDriver20] Enable LM75AD sensor (I2C addresses 0x48 - 0x4F) (+0k5 code) +//#define USE_APDS9960 // [I2cDriver21] Enable APDS9960 Proximity Sensor (I2C address 0x39). Disables SHT and VEML6070 (+4k7 code) +//#define USE_MCP230xx // [I2cDriver22] Enable MCP23008/MCP23017 - Must define I2C Address in #define USE_MCP230xx_ADDR below - range 0x20 - 0x27 (+4k7 code) +//#define USE_PCA9685 // [I2cDriver1] Enable PCA9685 I2C HW PWM Driver - Must define I2C Address in #define USE_PCA9685_ADDR below - range 0x40 - 0x47 (+1k4 code) +//#define USE_MPR121 // [I2cDriver23] Enable MPR121 controller (I2C addresses 0x5A, 0x5B, 0x5C and 0x5D) in input mode for touch buttons (+1k3 code) +#define USE_CCS811 // [I2cDriver24] Enable CCS811 sensor (I2C address 0x5A) (+2k2 code) +//#define USE_MPU6050 // [I2cDriver25] Enable MPU6050 sensor (I2C address 0x68 AD0 low or 0x69 AD0 high) (+3K3 of code and 188 Bytes of RAM) +//#define USE_DS3231 // [I2cDriver26] Enable DS3231 external RTC in case no Wifi is avaliable. See docs in the source file (+1k2 code) +//#define USE_MGC3130 // [I2cDriver27] Enable MGC3130 Electric Field Effect Sensor (I2C address 0x42) (+2k7 code, 0k3 mem) +//#define USE_MAX44009 // [I2cDriver28] Enable MAX44009 Ambient Light sensor (I2C addresses 0x4A and 0x4B) (+0k8 code) +#define USE_SCD30 // [I2cDriver29] Enable Sensiron SCd30 CO2 sensor (I2C address 0x61) (+3k3 code) +//#define USE_SPS30 // [I2cDriver30] Enable Sensiron SPS30 particle sensor (I2C address 0x69) (+1.7 code) +#define USE_ADE7953 // [I2cDriver7] Enable ADE7953 Energy monitor as used on Shelly 2.5 (I2C address 0x38) (+1k5) +//#define USE_VL53L0X // [I2cDriver31] Enable VL53L0x time of flight sensor (I2C address 0x29) (+4k code) +//#define USE_VL53L1X // [I2cDriver54] Enable VL53L1X time of flight sensor (I2C address 0x29) using Pololu VL53L1X library (+2k9 code) +//#define USE_TOF10120 // [I2cDriver57] Enable TOF10120 time of flight sensor (I2C address 0x52) (+0k6 code) +//#define USE_MLX90614 // [I2cDriver32] Enable MLX90614 ir temp sensor (I2C address 0x5a) (+0.6k code) +//#define USE_CHIRP // [I2cDriver33] Enable CHIRP soil moisture sensor (variable I2C address, default 0x20) +//#define USE_PAJ7620 // [I2cDriver34] Enable PAJ7620 gesture sensor (I2C address 0x73) (+2.5k code) +//#define USE_PCF8574 // [I2cDriver2] Enable PCF8574 I/O Expander (I2C addresses 0x20 - 0x26 and 0x39 - 0x3F) (+1k9 code) +#define USE_HIH6 // [I2cDriver36] Enable Honeywell HIH Humidity and Temperature sensor (I2C address 0x27) (+0k6) +#define USE_DHT12 // [I2cDriver41] Enable DHT12 humidity and temperature sensor (I2C address 0x5C) (+0k7 code) +#define USE_DS1624 // [I2cDriver42] Enable DS1624, DS1621 temperature sensor (I2C addresses 0x48 - 0x4F) (+1k2 code) +//#define USE_AHT1x // [I2cDriver43] Enable AHT10/15 humidity and temperature sensor (I2C address 0x38, 0x39) (+0k8 code) +// #define USE_AHT2x // [I2cDriver43] Enable AHT20 instead of AHT1x humidity and temperature sensor (I2C address 0x38) (+0k8 code) +#define USE_WEMOS_MOTOR_V1 // [I2cDriver44] Enable Wemos motor driver V1 (I2C addresses 0x2D - 0x30) (+0k7 code) + #define WEMOS_MOTOR_V1_ADDR 0x30 // Default I2C address 0x30 + #define WEMOS_MOTOR_V1_FREQ 1000 // Default frequency +//#define USE_HDC1080 // [I2cDriver45] Enable HDC1080 temperature/humidity sensor (I2C address 0x40) (+1k5 code) +#define USE_IAQ // [I2cDriver46] Enable iAQ-core air quality sensor (I2C address 0x5a) (+0k6 code) +#define USE_AS3935 // [I2cDriver48] Enable AS3935 Franklin Lightning Sensor (I2C address 0x03) (+5k4 code) +//#define USE_MCP9808 // [I2cDriver51] Enable MCP9808 temperature sensor (I2C addresses 0x18 - 0x1F) (+0k9 code) +//#define USE_HP303B // [I2cDriver52] Enable HP303B temperature and pressure sensor (I2C address 0x76 or 0x77) (+6k2 code) +//#define USE_MLX90640 // [I2cDriver53] Enable MLX90640 IR array temperature sensor (I2C address 0x33) (+20k code) +//#define USE_EZOPH // [I2cDriver55] Enable support for EZO's pH sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZOORP // [I2cDriver55] Enable support for EZO's ORP sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZORTD // [I2cDriver55] Enable support for EZO's RTD sensor (+0k2 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZOHUM // [I2cDriver55] Enable support for EZO's HUM sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZOEC // [I2cDriver55] Enable support for EZO's EC sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZOCO2 // [I2cDriver55] Enable support for EZO's CO2 sensor (+0k2 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZOO2 // [I2cDriver55] Enable support for EZO's O2 sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZOPRS // [I2cDriver55] Enable support for EZO's PRS sensor (+0k7 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZOFLO // [I2cDriver55] Enable support for EZO's FLO sensor (+0k4 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZODO // [I2cDriver55] Enable support for EZO's DO sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZORGB // [I2cDriver55] Enable support for EZO's RGB sensor (+0k5 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_EZOPMP // [I2cDriver55] Enable support for EZO's PMP sensor (+0k3 code) - Shared EZO code required for any EZO device (+1k2 code) +//#define USE_SEESAW_SOIL // [I2cDriver56] Enable Capacitice Soil Moisture & Temperature Sensor (I2C addresses 0x36 - 0x39) (+1k3 code) + +//#define USE_SPI // Hardware SPI using GPIO12(MISO), GPIO13(MOSI) and GPIO14(CLK) in addition to two user selectable GPIOs(CS and DC) +//#define USE_RC522 // Add support for MFRC522 13.56Mhz Rfid reader (+6k code) + +#define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+2k code) +#define USE_SENSEAIR // Add support for SenseAir K30, K70 and S8 CO2 sensor (+2k3 code) +#ifndef CO2_LOW + #define CO2_LOW 800 // Below this CO2 value show green light (needs PWM or WS2812 RG(B) led and enable with SetOption18 1) +#endif +#ifndef CO2_HIGH + #define CO2_HIGH 1200 // Above this CO2 value show red light (needs PWM or WS2812 RG(B) led and enable with SetOption18 1) +#endif +#define USE_PMS5003 // Add support for PMS5003 and PMS7003 particle concentration sensor (+1k3 code) + //#define PMS_MODEL_PMS3003 // Enable support of PMS3003 instead of PMS5003/PMS7003 (needs the USE_PMS5003 above) +#define USE_NOVA_SDS // Add support for SDS011 and SDS021 particle concentration sensor (+0k7 code) +#define USE_HPMA // Add support for Honeywell HPMA115S0 particle concentration sensor +#define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code) +//#define USE_DYP // Add support for DYP ME-007 ultrasonic distance sensor, serial port version (+0k5 code) +#define USE_SERIAL_BRIDGE // Add support for software Serial Bridge (+0k8 code) +#define USE_MP3_PLAYER // Use of the DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop + #define MP3_VOLUME 10 // Set the startup volume on init, the range can be 0..30(max) +//#define USE_AZ7798 // Add support for AZ-Instrument 7798 CO2 datalogger +#define USE_PN532_HSU // Add support for PN532 using HSU (Serial) interface (+1k8 code, 140 bytes mem) +//#define USE_ZIGBEE // Enable serial communication with Zigbee CC2530 flashed with ZNP +#define USE_RDM6300 // Add support for RDM6300 125kHz RFID Reader (+0k8) +#define USE_IBEACON // Add support for bluetooth LE passive scan of ibeacon devices (uses HM17 module) +//#define USE_GPS // Add support for GPS and NTP Server for becoming Stratus 1 Time Source (+ 3.1kb flash, +132 bytes RAM) + +//#define USE_BLE_ESP32 // (ESP32 only) Add support for native BLE on ESP32 - use new driver +//#define USE_MI_ESP32 // (ESP32 only) Add support for ESP32 as a BLE-bridge (+9k2 mem, +292k flash) + +#define USE_HRXL // Add support for MaxBotix HRXL-MaxSonar ultrasonic range finders (+0k7) +//#define USE_TASMOTA_CLIENT // Add support for Arduino Uno/Pro Mini via serial interface including flashing (+2k3 code, 44 mem) +//#define USE_OPENTHERM // Add support for OpenTherm (+15k code) +//#define USE_MIEL_HVAC // Add support for Mitsubishi Electric HVAC serial interface (+5k code) +//#define USE_PROJECTOR_CTRL // Add support for LCD/DLP Projector serial control interface (+2k code) +// #define USE_PROJECTOR_CTRL_NEC // Use codes for NEC +// #define USE_PROJECTOR_CTRL_OPTOMA // Use codes for OPTOMA +//#define USE_AS608 // Add support for AS608 optical and R503 capacitive fingerprint sensor (+3k4 code) + +#define USE_ENERGY_SENSOR // Add energy sensors (-14k code) +#define USE_PZEM004T // Add support for PZEM004T Energy monitor (+2k code) +#define USE_PZEM_AC // Add support for PZEM014,016 Energy monitor (+1k1 code) +#define USE_PZEM_DC // Add support for PZEM003,017 Energy monitor (+1k1 code) +#define USE_MCP39F501 // Add support for MCP39F501 Energy monitor as used in Shelly 2 (+3k1 code) +#define USE_SDM72 // Add support for Eastron SDM72-Modbus energy monitor (+0k3 code) +#define USE_SDM120 // Add support for Eastron SDM120-Modbus energy monitor (+1k1 code) +#define USE_SDM630 // Add support for Eastron SDM630-Modbus energy monitor (+0k6 code) +#define USE_DDS2382 // Add support for Hiking DDS2382 Modbus energy monitor (+0k6 code) +#define USE_DDSU666 // Add support for Chint DDSU666 Modbus energy monitor (+0k6 code) +//#define USE_SOLAX_X1 // Add support for Solax X1 series Modbus log info (+3k1 code) +//#define USE_LE01MR // Add support for F&F LE-01MR modbus energy meter (+2k code) +//#define USE_TELEINFO // Add support for French Energy Provider metering telemetry (+5k2 code, +168 RAM + SmartMeter LinkedList Values RAM) +//#define USE_WE517 // Add support for Orno WE517-Modbus energy monitor (+1k code) + +#define USE_DHT // Add support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor +#define USE_MAX31855 // Add support for MAX31855 K-Type thermocouple sensor using softSPI +//#define USE_MAX31865 // Add support for MAX31865 RTD sensors using softSPI +#define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram) + #define USE_IR_RECEIVE // Support for IR receiver (+5k5 code, 264 iram) +#define USE_LMT01 // Add support for TI LMT01 temperature sensor, count pulses on single GPIO (+0k5 code) +//#define USE_WIEGAND // Add support for 24/26/32/34 bit RFID Wiegand interface (D0/D1) (+1k7 code) +#define USE_TM1638 // Add support for TM1638 switches copying Switch1 .. Switch8 (+1k code) +#define USE_HX711 // Add support for HX711 load cell (+1k5 code) +//#define USE_HX711_GUI // Add optional web GUI to HX711 as scale (+1k8 code) +//#define USE_TX20_WIND_SENSOR // Add support for La Crosse TX20 anemometer (+2k6/0k8 code) +//#define USE_TX23_WIND_SENSOR // Add support for La Crosse TX23 anemometer (+2k7/1k code) +//#define USE_WINDMETER // Add support for analog anemometer (+2k2 code) +#define USE_RC_SWITCH // Add support for RF transceiver using library RcSwitch (+2k7 code, 460 iram) +#define USE_RF_SENSOR // Add support for RF sensor receiver (434MHz or 868MHz) (+0k8 code) +// #define USE_THEO_V2 // Add support for decoding Theo V2 sensors as documented on https://sidweb.nl using 434MHz RF sensor receiver (+1k4 code) + #define USE_ALECTO_V2 // Add support for decoding Alecto V2 sensors like ACH2010, WS3000 and DKW2012 using 868MHz RF sensor receiver (+1k7 code) +#define USE_HRE // Add support for Badger HR-E Water Meter (+1k4 code) +//#define USE_A4988_STEPPER // Add support for A4988/DRV8825 stepper-motor-driver-circuit (+10k5 code) +//#define USE_THERMOSTAT // Add support for Thermostat + +#ifndef USE_KNX +#define USE_KNX // Enable KNX IP Protocol Support (+23k code, +3k3 mem) +#endif + +#endif // FLAG_VARIANT_TASMOTA32 + +#endif // ESP32 #endif // _TASMOTA_CONFIGURATIONS_ESP32_H_ diff --git a/tasmota/user_config_override_sample.h b/tasmota/user_config_override_sample.h index ae434bb9c..369585717 100644 --- a/tasmota/user_config_override_sample.h +++ b/tasmota/user_config_override_sample.h @@ -20,6 +20,9 @@ #ifndef _USER_CONFIG_OVERRIDE_H_ #define _USER_CONFIG_OVERRIDE_H_ +// this flag needs to be unset otherwise settings from build variant Tasmota32 are included +#undef FLAG_VARIANT_TASMOTA32 + // force the compiler to show a warning to confirm that this file is included #warning **** user_config_override.h: Using Settings from this File **** From eed2c67744bc83f66795d6808e46349c1745a725 Mon Sep 17 00:00:00 2001 From: Paul C Diem Date: Sat, 13 Mar 2021 14:10:32 -0600 Subject: [PATCH 2/9] Range check item before storing in value array --- tasmota/support_device_groups.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasmota/support_device_groups.ino b/tasmota/support_device_groups.ino index f85b801a5..19112567a 100644 --- a/tasmota/support_device_groups.ino +++ b/tasmota/support_device_groups.ino @@ -344,18 +344,18 @@ void SendReceiveDeviceGroupMessage(struct device_group * device_group, struct de value |= *message_ptr++ << 16; value |= *message_ptr++ << 24; #ifdef USE_DEVICE_GROUPS_SEND - device_group->values_32bit[item - DGR_ITEM_MAX_16BIT - 1] = (item == DGR_ITEM_POWER ? value & 0xffffff : value); + if (item < DGR_ITEM_LAST_32BIT) device_group->values_32bit[item - DGR_ITEM_MAX_16BIT - 1] = (item == DGR_ITEM_POWER ? value & 0xffffff : value); #endif // USE_DEVICE_GROUPS_SEND } #ifdef USE_DEVICE_GROUPS_SEND else { - device_group->values_16bit[item - DGR_ITEM_MAX_8BIT - 1] = value; + if (item < DGR_ITEM_LAST_16BIT) device_group->values_16bit[item - DGR_ITEM_MAX_8BIT - 1] = value; } #endif // USE_DEVICE_GROUPS_SEND } #ifdef USE_DEVICE_GROUPS_SEND else { - device_group->values_8bit[item] = value; + if (item < DGR_ITEM_LAST_8BIT) device_group->values_8bit[item] = value; } #endif // USE_DEVICE_GROUPS_SEND log_length = snprintf(log_ptr, log_remaining, PSTR("%u"), value); From ecd78bfd96c6693f0358f0a0636a3a3c2f1cb713 Mon Sep 17 00:00:00 2001 From: Paul C Diem Date: Sat, 13 Mar 2021 14:13:44 -0600 Subject: [PATCH 3/9] Use SO32 for power button hold time --- tasmota/xdrv_35_pwm_dimmer.ino | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/tasmota/xdrv_35_pwm_dimmer.ino b/tasmota/xdrv_35_pwm_dimmer.ino index 555ec1a67..d30e7cba1 100644 --- a/tasmota/xdrv_35_pwm_dimmer.ino +++ b/tasmota/xdrv_35_pwm_dimmer.ino @@ -755,21 +755,8 @@ bool Xdrv35(uint8_t function) // If the button is pressed, ... if (!XdrvMailbox.payload) { - // If the button was just pressed, flag the button as pressed, set the hold time and - // increment the buttons pressed count. + // If the button was just pressed, ... if (!button_pressed[button_index]) { - button_pressed[button_index] = true; - uint32_t hold_delay = 250; - if (button_index == power_button_index) { -#ifdef USE_PWM_DIMMER_REMOTE - if (!(active_remote_pwm_dimmer ? active_remote_pwm_dimmer->power_on : TasmotaGlobal.power)) hold_delay = 500; -#else // USE_PWM_DIMMER_REMOTE - if (!TasmotaGlobal.power) hold_delay = 500; -#endif // USE_PWM_DIMMER_REMOTE - } - button_hold_time[button_index] = now + hold_delay; - buttons_pressed++; - if (buttons_pressed > 1) multibutton_in_progress = true; #ifdef USE_PWM_DIMMER_REMOTE // If there are no other buttons pressed right now and remote mode is enabled, make the @@ -785,7 +772,7 @@ bool Xdrv35(uint8_t function) // Top 0 1 1 0 // Middle 1 2 15 0 // Bottom 15 3 15 1 - if (buttons_pressed == 1 && Settings.flag4.multiple_device_groups) { + if (!buttons_pressed && Settings.flag4.multiple_device_groups) { power_button_index = button_index; down_button_index = (Pin(GPIO_KEY1, power_button_index) == 15 ? TasmotaGlobal.gpio_pin[1] : TasmotaGlobal.gpio_pin[15]) - 32; active_remote_pwm_dimmer = nullptr; @@ -793,9 +780,17 @@ bool Xdrv35(uint8_t function) active_remote_pwm_dimmer = &remote_pwm_dimmers[power_button_index]; } #endif // USE_PWM_DIMMER_REMOTE + + // Flag the button as pressed, increment the buttons pressed count and set the hold time. + button_pressed[button_index] = true; + buttons_pressed++; + if (buttons_pressed > 1) multibutton_in_progress = true; + uint32_t hold_delay = 250; + if (button_index == power_button_index) hold_delay = Settings.param[P_HOLD_TIME] * 10; + button_hold_time[button_index] = now + hold_delay; } - // If hold time has arrived and a rule is enabled that handles the button hold, handle it. + // If hold time has arrived and no rule is enabled that handles the button hold, handle it. else if (button_hold_time[button_index] <= now) { #ifdef USE_RULES sprintf(TasmotaGlobal.mqtt_data, PSTR("{\"Button%u\":{\"State\":3}}"), button_index + 1); From 3be135cb1c1ba1df98f9a0d5d92d712f2a7a609c Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 14 Mar 2021 11:21:55 +0100 Subject: [PATCH 4/9] Tasmota32 with env --- platformio_override_sample.ini | 2 + platformio_tasmota_env32.ini | 70 ++++++++++++++------------ tasmota/tasmota.h | 1 - tasmota/tasmota_configurations.h | 9 ---- tasmota/tasmota_configurations_ESP32.h | 11 +--- 5 files changed, 41 insertions(+), 52 deletions(-) diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index da565a651..380145cd6 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -29,6 +29,8 @@ default_envs = ; tasmota32 ; tasmota32-bluetooth ; tasmota32-webcam +; tasmota32-knx +; tasmota32-sensors ; tasmota32-display ; tasmota32-ir ; tasmota32-ircustom diff --git a/platformio_tasmota_env32.ini b/platformio_tasmota_env32.ini index 29e8d69a5..219776576 100644 --- a/platformio_tasmota_env32.ini +++ b/platformio_tasmota_env32.ini @@ -1,4 +1,4 @@ -[env:tasmota32] +[env:tasmota32_base] framework = ${common.framework} platform = ${common32.platform} platform_packages = ${common32.platform_packages} @@ -30,8 +30,12 @@ lib_ignore = ; Disable next if you want to use ArduinoOTA in Tasmota32 (default disabled) ArduinoOTA +[env:tasmota32] +extends = env:tasmota32_base +build_flags = ${common32.build_flags} -DFIRMWARE_TASMOTA32 + [env:tasmota32-webcam] -extends = env:tasmota32 +extends = env:tasmota32_base board = esp32cam board_build.f_cpu = 240000000L board_build.flash_mode = qio @@ -40,7 +44,7 @@ build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32- lib_extra_dirs = lib/libesp32, lib/lib_basic [env:tasmota32-odroidgo] -extends = env:tasmota32 +extends = env:tasmota32_base board = odroid_esp32 board_build.f_cpu = 240000000L board_build.flash_mode = qio @@ -51,7 +55,7 @@ build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32- lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_i2c, lib/lib_rf, lib/lib_div, lib/lib_ssl, lib/lib_display [env:tasmota32-core2] -extends = env:tasmota32 +extends = env:tasmota32_base board = odroid_esp32 board_build.f_cpu = 240000000L board_build.flash_mode = qio @@ -62,120 +66,120 @@ build_flags = ${common32.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32- lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_i2c, lib/lib_rf, lib/lib_div, lib/lib_ssl, lib/lib_display, lib/lib_audio [env:tasmota32-bluetooth] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DFIRMWARE_BLUETOOTH lib_extra_dirs = lib/libesp32, lib/libesp32_div, lib/lib_basic, lib/lib_i2c, lib/lib_ssl [env:tasmota32-display] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DFIRMWARE_DISPLAYS lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_display [env:tasmota32-ir] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} ${irremoteesp_full.build_flags} -DFIRMWARE_IR lib_extra_dirs = lib/libesp32, lib/lib_basic [env:tasmota32-ircustom] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} ${irremoteesp_full.build_flags} -DFIRMWARE_IR_CUSTOM [env:tasmota32-AF] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=af_AF [env:tasmota32-BG] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=bg_BG [env:tasmota32-BR] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=pt_BR [env:tasmota32-CN] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=zh_CN [env:tasmota32-CZ] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=cs_CZ [env:tasmota32-DE] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=de_DE [env:tasmota32-ES] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=es_ES [env:tasmota32-FR] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=fr_FR [env:tasmota32-FY] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=fy_NL [env:tasmota32-GR] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=el_GR [env:tasmota32-HE] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=he_HE [env:tasmota32-HU] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=hu_HU [env:tasmota32-IT] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=it_IT [env:tasmota32-KO] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=ko_KO [env:tasmota32-NL] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=nl_NL [env:tasmota32-PL] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=pl_PL [env:tasmota32-PT] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=pt_PT [env:tasmota32-RO] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=ro_RO [env:tasmota32-RU] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=ru_RU [env:tasmota32-SE] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=sv_SE [env:tasmota32-SK] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=sk_SK [env:tasmota32-TR] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=tr_TR [env:tasmota32-TW] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=zh_TW [env:tasmota32-UK] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=uk_UA [env:tasmota32-VN] -extends = env:tasmota32 +extends = env:tasmota32_base build_flags = ${common32.build_flags} -DMY_LANGUAGE=vi_VN diff --git a/tasmota/tasmota.h b/tasmota/tasmota.h index 6c3f2c7db..87e5f01b3 100644 --- a/tasmota/tasmota.h +++ b/tasmota/tasmota.h @@ -31,7 +31,6 @@ \*********************************************************************************************/ #define CODE_IMAGE_STR "tasmota" -#define FLAG_VARIANT_TASMOTA32 #define USE_LIGHT // Enable light control #define USE_ENERGY_SENSOR // Use energy sensors (+14k code) diff --git a/tasmota/tasmota_configurations.h b/tasmota/tasmota_configurations.h index beefe4d8b..c4956bdbd 100644 --- a/tasmota/tasmota_configurations.h +++ b/tasmota/tasmota_configurations.h @@ -29,8 +29,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "sensors" -#undef FLAG_VARIANT_TASMOTA32 - #undef USE_DISCOVERY // Disable mDNS (+8k code or +23.5k code with core 2_5_x, +0.3k mem) @@ -233,7 +231,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "knx" -#undef FLAG_VARIANT_TASMOTA32 #ifndef USE_KNX #define USE_KNX // Enable KNX IP Protocol Support (+23k code, +3k3 mem) @@ -260,7 +257,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "display" -#undef FLAG_VARIANT_TASMOTA32 #undef USE_EMULATION // Disable Belkin WeMo and Hue Bridge emulation for Alexa (-16k code, -2k mem) #undef USE_EMULATION_HUE // Disable Hue Bridge emulation for Alexa (+14k code, +2k mem common) @@ -342,7 +338,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "ir" -#undef FLAG_VARIANT_TASMOTA32 #undef USE_EMULATION #undef USE_EMULATION_HUE // Disable Hue emulation - only for lights and relays @@ -468,7 +463,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "zbbridge" -#undef FLAG_VARIANT_TASMOTA32 #undef MODULE #define MODULE SONOFF_ZB_BRIDGE // [Module] Select default module from tasmota_template.h @@ -626,7 +620,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "lite" -#undef FLAG_VARIANT_TASMOTA32 #undef APP_SLEEP #define APP_SLEEP 1 // Default to sleep = 1 for FIRMWARE_LITE @@ -759,7 +752,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "minimal" -#undef FLAG_VARIANT_TASMOTA32 #undef FIRMWARE_LITE // Disable tasmota-lite with no sensors #undef FIRMWARE_SENSORS // Disable tasmota-sensors with useful sensors enabled @@ -907,7 +899,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "mini-custom" -#undef FLAG_VARIANT_TASMOTA32 #undef FIRMWARE_LITE // Disable tasmota-lite with no sensors #undef FIRMWARE_SENSORS // Disable tasmota-sensors with useful sensors enabled diff --git a/tasmota/tasmota_configurations_ESP32.h b/tasmota/tasmota_configurations_ESP32.h index 990d95edc..3b0f969a4 100644 --- a/tasmota/tasmota_configurations_ESP32.h +++ b/tasmota/tasmota_configurations_ESP32.h @@ -31,7 +31,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "webcam" -#undef FLAG_VARIANT_TASMOTA32 #define USE_WEBCAM #undef USE_MI_ESP32 // (ESP32 only) Disable support for ESP32 as a BLE-bridge (+9k2 mem, +292k flash) @@ -46,7 +45,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "odroid-go" -#undef FLAG_VARIANT_TASMOTA32 #undef MODULE #define MODULE ODROID_GO // [Module] Select default module from tasmota_template.h @@ -74,7 +72,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "core2" -#undef FLAG_VARIANT_TASMOTA32 #undef MODULE #define MODULE M5STACK_CORE2 // [Module] Select default module from tasmota_template.h @@ -129,7 +126,6 @@ #undef CODE_IMAGE_STR #define CODE_IMAGE_STR "bluetooth" -#undef FLAG_VARIANT_TASMOTA32 #undef MODULE #define MODULE WEMOS // [Module] Select default module from tasmota_template.h @@ -149,10 +145,7 @@ * Provide an image which includes KNX and Sensors \*********************************************************************************************/ -// FLAG_VARIANT_TASMOTA32 is set for variant "Tasmota32" -> tasmota.h -// for all other Tasmota build variants this flag needs to be undefined!! - -#ifdef FLAG_VARIANT_TASMOTA32 +#ifdef FIRMWARE_TASMOTA32 #define USE_ENHANCED_GUI_WIFI_SCAN @@ -325,7 +318,7 @@ #define USE_KNX // Enable KNX IP Protocol Support (+23k code, +3k3 mem) #endif -#endif // FLAG_VARIANT_TASMOTA32 +#endif // FIRMWARE_TASMOTA32 #endif // ESP32 #endif // _TASMOTA_CONFIGURATIONS_ESP32_H_ From 328c8a3204e962cce35005b6a85a9803da5806c7 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 14 Mar 2021 11:24:39 +0100 Subject: [PATCH 5/9] no change --- tasmota/user_config_override_sample.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/tasmota/user_config_override_sample.h b/tasmota/user_config_override_sample.h index 369585717..ae434bb9c 100644 --- a/tasmota/user_config_override_sample.h +++ b/tasmota/user_config_override_sample.h @@ -20,9 +20,6 @@ #ifndef _USER_CONFIG_OVERRIDE_H_ #define _USER_CONFIG_OVERRIDE_H_ -// this flag needs to be unset otherwise settings from build variant Tasmota32 are included -#undef FLAG_VARIANT_TASMOTA32 - // force the compiler to show a warning to confirm that this file is included #warning **** user_config_override.h: Using Settings from this File **** From be4a1294409145f05dfda2d6dd0f868b1126da0c Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 14 Mar 2021 11:31:21 +0100 Subject: [PATCH 6/9] env:tasmota32_base --- platformio_override_sample.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index 380145cd6..283c4405f 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -161,7 +161,7 @@ lib_extra_dirs = ; *** EXPERIMENTAL Tasmota version for ESP32solo1 (used in some Xiaomi devices) [env:tasmota32solo1] -extends = env:tasmota32 +extends = env:tasmota32_base platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/raw/framework-arduinoespressif32/framework-arduinoespressif32-release_v3.3-solo1-bd65eb8d1.tar.gz platformio/tool-mklittlefs @ ~1.203.200522 platformio/tool-esptoolpy @ ~1.30000.0 @@ -170,7 +170,7 @@ build_flags = ${common32.build_flags} ; *** EXPERIMENTAL Tasmota version for ESP32-S2 [env:tasmota32s2] -extends = env:tasmota32 +extends = env:tasmota32_base board = esp32s2 board_build.flash_mode = qio platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/arduino-esp32/releases/download/s2-1.0.5-rc6/esp32-s2-1.0.5-rc6.zip @@ -191,7 +191,7 @@ build_flags = ${esp82xx_defaults.build_flags} ; -Wstack-usage=300 [env:tasmota32-debug] -extends = env:tasmota32 +extends = env:tasmota32_base build_type = debug build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} From bd791db7159aad921acd3801a2638b3feebe2c40 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Sun, 14 Mar 2021 11:37:54 +0100 Subject: [PATCH 7/9] missing -DFIRMWARE_TASMOTA32 --- platformio_tasmota_env32.ini | 50 ++++++++++++++++++------------------ 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/platformio_tasmota_env32.ini b/platformio_tasmota_env32.ini index 219776576..f0b85e60b 100644 --- a/platformio_tasmota_env32.ini +++ b/platformio_tasmota_env32.ini @@ -86,100 +86,100 @@ build_flags = ${common32.build_flags} ${irremoteesp_full.build_flags [env:tasmota32-AF] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=af_AF +build_flags = ${common32.build_flags} -DMY_LANGUAGE=af_AF -DFIRMWARE_TASMOTA32 [env:tasmota32-BG] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=bg_BG +build_flags = ${common32.build_flags} -DMY_LANGUAGE=bg_BG -DFIRMWARE_TASMOTA32 [env:tasmota32-BR] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=pt_BR +build_flags = ${common32.build_flags} -DMY_LANGUAGE=pt_BR -DFIRMWARE_TASMOTA32 [env:tasmota32-CN] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=zh_CN +build_flags = ${common32.build_flags} -DMY_LANGUAGE=zh_CN -DFIRMWARE_TASMOTA32 [env:tasmota32-CZ] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=cs_CZ +build_flags = ${common32.build_flags} -DMY_LANGUAGE=cs_CZ -DFIRMWARE_TASMOTA32 [env:tasmota32-DE] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=de_DE +build_flags = ${common32.build_flags} -DMY_LANGUAGE=de_DE -DFIRMWARE_TASMOTA32 [env:tasmota32-ES] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=es_ES +build_flags = ${common32.build_flags} -DMY_LANGUAGE=es_ES -DFIRMWARE_TASMOTA32 [env:tasmota32-FR] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=fr_FR +build_flags = ${common32.build_flags} -DMY_LANGUAGE=fr_FR -DFIRMWARE_TASMOTA32 [env:tasmota32-FY] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=fy_NL +build_flags = ${common32.build_flags} -DMY_LANGUAGE=fy_NL -DFIRMWARE_TASMOTA32 [env:tasmota32-GR] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=el_GR +build_flags = ${common32.build_flags} -DMY_LANGUAGE=el_GR -DFIRMWARE_TASMOTA32 [env:tasmota32-HE] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=he_HE +build_flags = ${common32.build_flags} -DMY_LANGUAGE=he_HE -DFIRMWARE_TASMOTA32 [env:tasmota32-HU] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=hu_HU +build_flags = ${common32.build_flags} -DMY_LANGUAGE=hu_HU -DFIRMWARE_TASMOTA32 [env:tasmota32-IT] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=it_IT +build_flags = ${common32.build_flags} -DMY_LANGUAGE=it_IT -DFIRMWARE_TASMOTA32 [env:tasmota32-KO] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=ko_KO +build_flags = ${common32.build_flags} -DMY_LANGUAGE=ko_KO -DFIRMWARE_TASMOTA32 [env:tasmota32-NL] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=nl_NL +build_flags = ${common32.build_flags} -DMY_LANGUAGE=nl_NL -DFIRMWARE_TASMOTA32 [env:tasmota32-PL] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=pl_PL +build_flags = ${common32.build_flags} -DMY_LANGUAGE=pl_PL -DFIRMWARE_TASMOTA32 [env:tasmota32-PT] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=pt_PT +build_flags = ${common32.build_flags} -DMY_LANGUAGE=pt_PT -DFIRMWARE_TASMOTA32 [env:tasmota32-RO] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=ro_RO +build_flags = ${common32.build_flags} -DMY_LANGUAGE=ro_RO -DFIRMWARE_TASMOTA32 [env:tasmota32-RU] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=ru_RU +build_flags = ${common32.build_flags} -DMY_LANGUAGE=ru_RU -DFIRMWARE_TASMOTA32 [env:tasmota32-SE] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=sv_SE +build_flags = ${common32.build_flags} -DMY_LANGUAGE=sv_SE -DFIRMWARE_TASMOTA32 [env:tasmota32-SK] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=sk_SK +build_flags = ${common32.build_flags} -DMY_LANGUAGE=sk_SK -DFIRMWARE_TASMOTA32 [env:tasmota32-TR] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=tr_TR +build_flags = ${common32.build_flags} -DMY_LANGUAGE=tr_TR -DFIRMWARE_TASMOTA32 [env:tasmota32-TW] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=zh_TW +build_flags = ${common32.build_flags} -DMY_LANGUAGE=zh_TW -DFIRMWARE_TASMOTA32 [env:tasmota32-UK] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=uk_UA +build_flags = ${common32.build_flags} -DMY_LANGUAGE=uk_UA -DFIRMWARE_TASMOTA32 [env:tasmota32-VN] extends = env:tasmota32_base -build_flags = ${common32.build_flags} -DMY_LANGUAGE=vi_VN +build_flags = ${common32.build_flags} -DMY_LANGUAGE=vi_VN -DFIRMWARE_TASMOTA32 From 9645f3008eef1e88c49dc95d2b1b2774673d9c92 Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 15 Mar 2021 14:45:09 +0100 Subject: [PATCH 8/9] Fix string length overflow Fix string length overflow (#11347) --- tasmota/xdrv_12_home_assistant.ino | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tasmota/xdrv_12_home_assistant.ino b/tasmota/xdrv_12_home_assistant.ino index 3280c8cb0..617ec2e39 100644 --- a/tasmota/xdrv_12_home_assistant.ino +++ b/tasmota/xdrv_12_home_assistant.ino @@ -270,10 +270,10 @@ void NewHAssDiscovery(void) char stopic[TOPSZ]; char stemp1[TOPSZ]; char stemp2[200]; - char stemp3[TOPSZ]; - char stemp4[TOPSZ]; - char stemp5[TOPSZ]; - char stemp6[TOPSZ]; + char switch_mode[90]; + char switch_name[300]; + char stemp5[90]; + char stemp6[90]; char unique_id[30]; char relays[TOPSZ]; char *state_topic = stemp1; @@ -297,14 +297,14 @@ void NewHAssDiscovery(void) snprintf_P(stemp2, sizeof(stemp2), PSTR("%s%s%s"), stemp2, (i > 0 ? "," : ""), (i < maxfn) ? fname : PSTR("null")); } - stemp3[0] = '\0'; - stemp4[0] = '\0'; + switch_mode[0] = '\0'; + switch_name[0] = '\0'; // Enable Discovery for Switches only if SetOption114 is enabled for (uint32_t i = 0; i < MAX_SWITCHES; i++) { char sname[TOPSZ]; snprintf_P(sname, sizeof(sname), PSTR("\"%s\""), GetSwitchText(i).c_str()); - snprintf_P(stemp3, sizeof(stemp3), PSTR("%s%s%d"), stemp3, (i > 0 ? "," : ""), (PinUsed(GPIO_SWT1, i) & Settings.flag5.mqtt_switches) ? Settings.switchmode[i] : -1); - snprintf_P(stemp4, sizeof(stemp4), PSTR("%s%s%s"), stemp4, (i > 0 ? "," : ""), (PinUsed(GPIO_SWT1, i) & Settings.flag5.mqtt_switches) ? sname : PSTR("null")); + snprintf_P(switch_mode, sizeof(switch_mode), PSTR("%s%s%d"), switch_mode, (i > 0 ? "," : ""), (PinUsed(GPIO_SWT1, i) & Settings.flag5.mqtt_switches) ? Settings.switchmode[i] : -1); + snprintf_P(switch_name, sizeof(switch_name), PSTR("%s%s%s"), switch_name, (i > 0 ? "," : ""), (PinUsed(GPIO_SWT1, i) & Settings.flag5.mqtt_switches) ? sname : PSTR("null")); } stemp5[0] = '\0'; @@ -338,7 +338,7 @@ void NewHAssDiscovery(void) if (!Settings.flag.hass_discovery) { // HassDiscoveryRelays(relays) Response_P(HASS_DISCOVER_DEVICE, (uint32_t)WiFi.localIP(), SettingsText(SET_DEVICENAME), stemp2, TasmotaGlobal.hostname, unique_id, ModuleName().c_str(), TuyaMod, iFanMod, GetStateText(0), GetStateText(1), GetStateText(2), GetStateText(3), - TasmotaGlobal.version, TasmotaGlobal.mqtt_topic, SettingsText(SET_MQTT_FULLTOPIC), PSTR(SUB_PREFIX), PSTR(PUB_PREFIX), PSTR(PUB_PREFIX2), Hass.RelLst, stemp3, stemp4, + TasmotaGlobal.version, TasmotaGlobal.mqtt_topic, SettingsText(SET_MQTT_FULLTOPIC), PSTR(SUB_PREFIX), PSTR(PUB_PREFIX), PSTR(PUB_PREFIX2), Hass.RelLst, switch_mode, switch_name, stemp5, Settings.flag.mqtt_response, Settings.flag.button_swap, Settings.flag.button_single, Settings.flag.decimal_text, Settings.flag.not_power_linked, Settings.flag.hass_light, Settings.flag3.pwm_multi_channels, Settings.flag3.mqtt_buttons, Settings.flag4.alexa_ct_range, Settings.flag5.mqtt_switches, Settings.flag5.fade_fixed_duration, light_controller.isCTRGBLinked(), Light.subtype, stemp6); From 3555b9e5f9753ead0ab95389044ccde6c4f11ecb Mon Sep 17 00:00:00 2001 From: Theo Arends <11044339+arendst@users.noreply.github.com> Date: Mon, 15 Mar 2021 15:51:31 +0100 Subject: [PATCH 9/9] Init RTC sooner --- tasmota/tasmota.ino | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tasmota/tasmota.ino b/tasmota/tasmota.ino index 54db9ae17..c24b8733a 100644 --- a/tasmota/tasmota.ino +++ b/tasmota/tasmota.ino @@ -338,6 +338,8 @@ void setup(void) { snprintf_P(TasmotaGlobal.hostname, sizeof(TasmotaGlobal.hostname)-1, SettingsText(SET_HOSTNAME)); } + RtcInit(); + GpioInit(); WifiConnect(); @@ -350,7 +352,7 @@ void setup(void) { AddLog(LOG_LEVEL_INFO, PSTR(D_WARNING_MINIMAL_VERSION)); #endif // FIRMWARE_MINIMAL - RtcInit(); +// RtcInit(); #ifdef USE_ARDUINO_OTA ArduinoOTAInit();