From a0e89926fd84c73d8581d1c12b4df2ffd1dd5ef2 Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Tue, 3 May 2022 13:21:15 +0200 Subject: [PATCH] add safemode env (#15522) * add firmware variant `SAFEMODE` * add safemode env * Update Tasmota_build_devel.yml * add safemode to CI --- .github/workflows/Tasmota_build_devel.yml | 8 +- .github/workflows/build_all_the_things.yml | 4 + platformio_tasmota_env32.ini | 47 +++++++ tasmota/tasmota_configurations_ESP32.h | 144 +++++++++++++++++++++ 4 files changed, 202 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Tasmota_build_devel.yml b/.github/workflows/Tasmota_build_devel.yml index 438d657cd..adedf4720 100644 --- a/.github/workflows/Tasmota_build_devel.yml +++ b/.github/workflows/Tasmota_build_devel.yml @@ -39,6 +39,10 @@ jobs: - tasmota32-lvgl - tasmota32c3 - tasmota32solo1 + - tasmota32-safemode + - tasmota32c3-safemode + - tasmota32s2-safemode + - tasmota32s3-safemode steps: - uses: actions/checkout@v2 with: @@ -117,7 +121,9 @@ jobs: [ ! -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/tasmota32c3*.* ] || mv ./mv_firmware/firmware/tasmota32c3*.* ./firmware/tasmota32/ - [ ! -f ./mv_firmware/firmware/tasmota32* ] || mv ./mv_firmware/firmware/tasmota32* ./firmware/tasmota32/languages/ + [ ! -f ./mv_firmware/firmware/tasmota32-safemode ] || mv ./mv_firmware/firmware/tasmota32-safemode ./firmware/tasmota32/ + [ ! -f ./mv_firmware/firmware/tasmota32-* ] || mv ./mv_firmware/firmware/tasmota32-* ./firmware/tasmota32/languages/ + [ ! -f ./mv_firmware/firmware/tasmota32* ] || mv ./mv_firmware/firmware/tasmota32* ./firmware/tasmota32/ [ ! -f ./mv_firmware/firmware/* ] || mv ./mv_firmware/firmware/* ./firmware/tasmota/languages/ - name: Display files to transfer run: ls -R ./* diff --git a/.github/workflows/build_all_the_things.yml b/.github/workflows/build_all_the_things.yml index 9259cdf50..6c9f09770 100644 --- a/.github/workflows/build_all_the_things.yml +++ b/.github/workflows/build_all_the_things.yml @@ -43,6 +43,10 @@ jobs: - tasmota32s2 - tasmota32c3 - tasmota32solo1 + - tasmota32-safemode + - tasmota32c3-safemode + - tasmota32s2-safemode + - tasmota32s3-safemode steps: - uses: actions/checkout@v2 - name: Set up Python diff --git a/platformio_tasmota_env32.ini b/platformio_tasmota_env32.ini index 7aa37c90c..16426521e 100644 --- a/platformio_tasmota_env32.ini +++ b/platformio_tasmota_env32.ini @@ -116,6 +116,53 @@ lib_ignore = Micro-RTSP epdiy +[env:tasmota32-safemode] +extends = env:tasmota32_base +build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_SAFEMODE +lib_extra_dirs = lib/lib_ssl, lib/libesp32 +lib_ignore = + TTGO TWatch Library + NimBLE-Arduino + Micro-RTSP + epdiy + +[env:tasmota32s2-safemode] +extends = env:tasmota32_base +board = esp32s2 +build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_SAFEMODE +lib_extra_dirs = lib/lib_ssl, lib/libesp32 +lib_ignore = + TTGO TWatch Library + NimBLE-Arduino + Micro-RTSP + epdiy + +[env:tasmota32s3-safemode] +extends = env:tasmota32_base +board = esp32s3 +build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_SAFEMODE +lib_extra_dirs = lib/lib_ssl, lib/libesp32 +lib_ignore = + TTGO TWatch Library + NimBLE-Arduino + Micro-RTSP + epdiy + +[env:tasmota32c3-safemode] +extends = env:tasmota32_base +board = esp32c3 +build_unflags = ${env:tasmota32_base.build_unflags} + -flto + -mtarget-align +build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_SAFEMODE + -fno-lto +lib_extra_dirs = lib/lib_ssl, lib/libesp32 +lib_ignore = + TTGO TWatch Library + NimBLE-Arduino + Micro-RTSP + epdiy + [env:tasmota32-AF] extends = env:tasmota32_base build_flags = ${env:tasmota32_base.build_flags} -DMY_LANGUAGE=af_AF -DFIRMWARE_TASMOTA32 diff --git a/tasmota/tasmota_configurations_ESP32.h b/tasmota/tasmota_configurations_ESP32.h index c79d7f287..d85b93e09 100644 --- a/tasmota/tasmota_configurations_ESP32.h +++ b/tasmota/tasmota_configurations_ESP32.h @@ -22,6 +22,150 @@ #ifdef ESP32 +/*********************************************************************************************\ + * [tasmota32x-safemode.bin] + * Provide an image with useful supported sensors enabled +\*********************************************************************************************/ + +#ifdef FIRMWARE_SAFEMODE +#define FIRMWARE_MINIMAL + +#undef CODE_IMAGE_STR +#define CODE_IMAGE_STR "safemode" + +#define USE_TLS +#define USE_WEBSERVER +#define USE_WEBCLIENT +#define USE_WEBCLIENT_HTTPS + +#undef USE_UFILESYS +#undef GUI_TRASH_FILE +#undef GUI_EDIT_FILE +#undef USE_PING +#undef USE_AUTOCONF +#undef USE_BERRY + +#undef FIRMWARE_LITE // Disable tasmota-lite with no sensors +#undef FIRMWARE_SENSORS // Disable tasmota-sensors with useful sensors enabled +#undef FIRMWARE_KNX_NO_EMULATION // Disable tasmota-knx with KNX but without Emulation +#undef FIRMWARE_DISPLAYS // Disable tasmota-display with display drivers enabled +#undef FIRMWARE_IR // Disable tasmota-ir with IR full protocols activated +#undef FIRMWARE_WEBCAM +#undef FIRMWARE_BLUETOOTH +#undef FIRMWARE_LVGL +#undef FIRMWARE_TASMOTA32 + +#undef USE_IMPROV // Disable support for IMPROV serial protocol as used by esp-web-tools (+2k code) +#undef USE_TASMESH // Disable Tasmota Mesh using ESP-NOW (+11k code) +#undef USE_ARDUINO_OTA // Disable support for Arduino OTA +#undef USE_INFLUXDB // Disable influxdb support (+5k code) +#undef USE_DOMOTICZ // Disable Domoticz +#undef USE_HOME_ASSISTANT // Disable Home Assistant +#undef USE_TASMOTA_DISCOVERY // Disable Tasmota Discovery support (+2k code) +#undef USE_TELEGRAM // Disable support for Telegram protocol (+49k code, +7.0k mem and +4.8k additional during connection handshake) +//#undef USE_MQTT_TLS // Disable TLS support won't work as the MQTTHost is not set +#undef USE_KNX // Disable KNX IP Protocol Support +//#undef USE_WEBSERVER // Disable Webserver +#undef USE_ENHANCED_GUI_WIFI_SCAN // Disable wifi scan output with BSSID (+0k5 code) +#undef USE_WEBSEND_RESPONSE // Disable command WebSend response message (+1k code) +#undef USE_EMULATION // Disable Wemo or Hue emulation +#undef USE_EMULATION_HUE // Disable Hue Bridge emulation for Alexa (+14k code, +2k mem common) +#undef USE_EMULATION_WEMO // Disable Belkin WeMo emulation for Alexa (+6k code, +2k mem common) +#undef USE_CUSTOM // Disable Custom features +#undef USE_DISCOVERY // Disable Discovery services for both MQTT and web server +#undef USE_TIMERS // Disable support for up to 16 timers +#undef USE_TIMERS_WEB // Disable support for timer webpage +#undef USE_SUNRISE // Disable support for Sunrise and sunset tools +#undef USE_PING // Disable Ping command (+2k code) +#undef USE_UNISHOX_COMPRESSION // Disable support for string compression in Rules or Scripts +#undef USE_RULES // Disable support for rules +#undef USE_SCRIPT // Disable support for script + +// -- Optional modules ---------------------------- +#undef ROTARY_V1 // Disable support for MI Desk Lamp +#undef USE_SONOFF_RF // Disable support for Sonoff Rf Bridge (+3k2 code) + #undef USE_RF_FLASH // Disable support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB +#undef USE_SONOFF_SC // Disable support for Sonoff Sc (+1k1 code) +#undef USE_TUYA_MCU // Disable support for Tuya Serial MCU +#undef USE_ARMTRONIX_DIMMERS // Disable support for Armtronix Dimmers (+1k4 code) +#undef USE_PS_16_DZ // Disable support for PS-16-DZ Dimmer and Sonoff L1 (+2k code) +#undef USE_SONOFF_IFAN // Disable support for Sonoff iFan02 and iFan03 (+2k code) +#undef USE_BUZZER // Disable support for a buzzer (+0k6 code) +#undef USE_ARILUX_RF // Disable support for Arilux RF remote controller +#undef USE_SHUTTER // Disable Shutter support for up to 4 shutter with different motortypes (+6k code) +#undef USE_DEEPSLEEP // Disable support for deepsleep (+1k code) +#undef USE_EXS_DIMMER // Disable support for EX-Store WiFi Dimmer +#undef USE_HOTPLUG // Disable support for HotPlug +#undef USE_DEVICE_GROUPS // Disable support for device groups (+3k5 code) +#undef USE_PWM_DIMMER // Disable support for MJ-SD01/acenx/NTONPOWER PWM dimmers (+4k5 code) +#undef USE_PWM_DIMMER_REMOTE // Disbale support for remote switches to PWM Dimmer +#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) + +// -- Optional light modules ---------------------- +#undef USE_LIGHT // Disable support for lights + +#undef USE_COUNTER // Disable counters +#define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices +#undef USE_DS18x20 // Disable DS18x20 sensor + +#undef USE_I2C // Disable all I2C sensors and devices +#undef USE_SPI // Disable all SPI devices +#undef USE_DISPLAY // Disable Display support + +#undef USE_MHZ19 // Disable support for MH-Z19 CO2 sensor +#undef USE_SENSEAIR // Disable support for SenseAir K30, K70 and S8 CO2 sensor +#undef USE_PMS5003 // Disable support for PMS5003 and PMS7003 particle concentration sensor +#undef USE_NOVA_SDS // Disable support for SDS011 and SDS021 particle concentration sensor +#undef USE_HPMA // Disable support for Honeywell HPMA115S0 particle concentration sensor +#undef USE_SR04 // Disable support for HC-SR04 ultrasonic devices (+1k code) +#undef USE_DYP // Disable support for DYP ME-007 ultrasonic distance sensor, serial port version (+0k5 code) +#undef USE_SERIAL_BRIDGE // Disable support for software Serial Bridge +#undef USE_TCP_BRIDGE // DIsable support for Serial to TCP bridge (+1.3k code) +#undef USE_MP3_PLAYER // Disable DFPlayer Mini MP3 Player RB-DFR-562 commands: play, volume and stop +#undef USE_AZ7798 // Disable support for AZ-Instrument 7798 CO2 datalogger +#undef USE_PN532_HSU // Disable support for PN532 using HSU (Serial) interface (+1k8 code, 140 bytes mem) +#undef USE_ZIGBEE // Disable serial communication with Zigbee CC2530 flashed with ZNP +#undef USE_RDM6300 // Disable support for RDM6300 125kHz RFID Reader (+0k8) +#undef USE_IBEACON // Disable support for bluetooth LE passive scan of ibeacon devices (uses HM17 module) +#undef USE_GPS // Disable support for GPS and NTP Server for becoming Stratus 1 Time Source (+ 3.1kb flash, +132 bytes RAM) +#undef USE_HM10 // (ESP8266 only) Disable support for HM-10 as a BLE-bridge for the LYWSD03 (+5k1 code) +#undef USE_BLE_ESP32 // (ESP32 only) Disable support for native BLE on ESP32 - use new driver +#undef USE_MI_ESP32 // (ESP32 only) Disable support for ESP32 as a BLE-bridge (+9k2 mem, +292k flash) +#undef USE_HRXL // Disable support for MaxBotix HRXL-MaxSonar ultrasonic range finders (+0k7) +#undef USE_TASMOTA_CLIENT // Disable support for Arduino Uno/Pro Mini via serial interface including flashing (+2k3 code, 44 mem) +#undef USE_OPENTHERM // Disable support for OpenTherm (+15k code) +#undef USE_MIEL_HVAC // Disable support for Mitsubishi Electric HVAC serial interface (+5k code) +#undef USE_PROJECTOR_CTRL // Disable support for LCD/DLP Projector serial control interface +#undef USE_AS608 // Disable support for AS608 optical and R503 capacitive fingerprint sensor (+3k4 code) +#undef USE_TFMINIPLUS // Disable support for TFmini Plus (TFmini, TFmini-S) LiDAR modules via UART interface (+0k8) +#undef USE_HRG15 // Disable support for Hydreon RG-15 Solid State Rain sensor (+1k5 code) +#undef USE_VINDRIKTNING // Disable support for IKEA VINDRIKTNING particle concentration sensor (+0k6 code) + +#undef USE_ENERGY_SENSOR // Disable energy sensors + +#undef USE_DHT // Disable support for DHT11, AM2301 (DHT21, DHT22, AM2302, AM2321) and SI7021 Temperature and Humidity sensor +#undef USE_MAX31855 // Disable MAX31855 K-Type thermocouple sensor using softSPI +#undef USE_MAX31865 // Disable support for MAX31865 RTD sensors using softSPI +#undef USE_LMT01 // Disable support for TI LMT01 temperature sensor, count pulses on single GPIO (+0k5 code) +#undef USE_IR_REMOTE // Disable IR driver +#undef USE_TM1638 // Disable support for TM1638 switches copying Switch1 .. Switch8 +#undef USE_HX711 // Disable support for HX711 load cell +#undef USE_TX20_WIND_SENSOR // Disable support for La Crosse TX20 anemometer +#undef USE_TX23_WIND_SENSOR // Disable support for La Crosse TX23 anemometer +#undef USE_WINDMETER // Disable support for analog anemometer (+2k2 code) +#undef USE_RC_SWITCH // Disable support for RF transceiver using library RcSwitch +#undef USE_RF_SENSOR // Disable support for RF sensor receiver (434MHz or 868MHz) (+0k8 code) +#undef USE_HRE // Disable support for Badger HR-E Water Meter (+1k4 code) +#undef USE_A4988_STEPPER // Disable support for A4988_Stepper +#undef USE_THERMOSTAT // Disable support for Thermostat +#undef USE_PROMETHEUS // Disable support for https://prometheus.io/ metrics exporting over HTTP /metrics endpoint +#undef DEBUG_THEO // Disable debug code +#undef USE_DEBUG_DRIVER // Disable debug code +#undef USE_AC_ZERO_CROSS_DIMMER // Disable support for AC_ZERO_CROSS_DIMMER +#endif // FIRMWARE_SAFEMODE + /*********************************************************************************************\ * [tasmota32-webcam.bin] * Provide an image with useful supported sensors enabled