Closed majherek closed 6 years ago
compiled with Arduino IDE or Platform.io?
try the esplib 2.3.0 instead of 2.4.1 that you are using.
TLS is very RAM hungry with your experience as result. More flash doesn't solve that.
I guess this is the end of TLS as new features use more RAM even if you disable all sensors as the settings area has permanently grown by rule save area to almost 4k eaten from RAM too.
Hi @ascillato, I compile it with Arduino IDE. I will try with esplib 2.3.0, but I think I already check it (I will check it for sure today).
@arendst for me it doesn't matter -> I use LWiP v2 from long time and everything is working fine. Can you not to throw away TLS support? IMHO security is important too.
TLS support will stay in the source. Perhaps one day a low RAM version becomes available :-0
@ascillato,
for me with esplib 2.3.0 is the same.
@arendst Is there any combination of features that allows for sufficient RAM for TLS to work?
@younesmaia,
yes, I have working 5.14.0b with TLS.
In user_config.h uncomment:
#define USE_CONFIG_OVERRIDE // Uncomment to use user_config_override.h file. See README.md
and create user_config_override.h file like this (remember, to change NAMES, IP, etc.).
/*
user_config_override.h - user configuration overrides user_config.h for Sonoff-Tasmota
Copyright (C) 2018 Theo Arends
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _USER_CONFIG_OVERRIDE_H_
#define _USER_CONFIG_OVERRIDE_H_
// force the compiler to show a warning to confirm that this file is inlcuded
#warning **** user_config_override.h: Using Settings from this File ****
/*****************************************************************************************************\
* USAGE:
* To modify the stock configuration without changing the user_config.h file:
* (1) copy this file to "user_config_override.h" (It will be ignored by Git)
* (2) define your own settings below
* (3) for platformio:
* define USE_CONFIG_OVERRIDE as a build flags.
* ie1 : export PLATFORMIO_BUILD_FLAGS='-DUSE_CONFIG_OVERRIDE'
* ie2 : enable in file platformio.ini "build_flags = -Wl,-Tesp8266.flash.1m0.ld -DUSE_CONFIG_OVERRIDE"
* for Arduino IDE:
* enable define USE_CONFIG_OVERRIDE in user_config.h
******************************************************************************************************
* ATTENTION:
* - Changes to SECTION1 PARAMETER defines will only override flash settings if you change define CFG_HOLDER.
* - Expect compiler warnings when no ifdef/undef/endif sequence is used.
* - You still need to update user_config.h for major define USE_MQTT_TLS.
* - All parameters can be persistent changed online using commands via MQTT, WebConsole or Serial.
\*****************************************************************************************************/
/*
Examples :
// -- Master parameter control --------------------
#undef CFG_HOLDER
#define CFG_HOLDER 0x20161209 // [Reset 1] Change this value to load SECTION1 configuration parameters to flash
// -- Setup your own Wifi settings ---------------
#undef STA_SSID1
#define STA_SSID1 "YourSSID" // [Ssid1] Wifi SSID
#undef STA_PASS1
#define STA_PASS1 "YourWifiPassword" // [Password1] Wifi password
// -- Setup your own MQTT settings ---------------
#undef MQTT_HOST
#define MQTT_HOST "your-mqtt-server.com" // [MqttHost]
#undef MQTT_PORT
#define MQTT_PORT 1883 // [MqttPort] MQTT port (10123 on CloudMQTT)
#undef MQTT_USER
#define MQTT_USER "YourMqttUser" // [MqttUser] Optional user
#undef MQTT_PASS
#define MQTT_PASS "YourMqttPass" // [MqttPassword] Optional password
// You might even pass some parameters from the command line ----------------------------
// Ie: export PLATFORMIO_BUILD_FLAGS='-DUSE_CONFIG_OVERRIDE -DMY_IP="192.168.1.99" -DMY_GW="192.168.1.1" -DMY_DNS="192.168.1.1"'
#ifdef MY_IP
#undef WIFI_IP_ADDRESS
#define WIFI_IP_ADDRESS MY_IP // Set to 0.0.0.0 for using DHCP or IP address
#endif
#ifdef MY_GW
#undef WIFI_GATEWAY
#define WIFI_GATEWAY MY_GW // if not using DHCP set Gateway IP address
#endif
#ifdef MY_DNS
#undef WIFI_DNS
#define WIFI_DNS MY_DNS // If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)
#endif
*/
#ifdef PROJECT
#undef PROJECT
#define PROJECT "NAME" // PROJECT is used as the default topic delimiter and OTA file name
// As an IDE restriction it needs to be the same as the main .ino file
#endif
#ifdef FRIENDLY_NAME
#undef FRIENDLY_NAME
#define FRIENDLY_NAME "NAME" // [FriendlyName] Friendlyname up to 32 characters used by webpages and Alexa
#endif
#ifdef MQTT_CLIENT_ID
#undef MQTT_CLIENT_ID
#define MQTT_CLIENT_ID "NAME"
#endif
#ifdef WIFI_IP_ADDRESS
#undef WIFI_IP_ADDRESS
#define WIFI_IP_ADDRESS "IP1" // [IpAddress1] Set to 0.0.0.0 for using DHCP or IP address
#endif
#ifdef WIFI_HOSTNAME
#undef WIFI_HOSTNAME
#define WIFI_HOSTNAME "WIFI_HOSTNAME" // Expands to <MQTT_TOPIC>-<last 4 decimal chars of MAC address>
#endif
#ifdef CFG_HOLDER
#undef CFG_HOLDER
#define CFG_HOLDER 0x20180527 // [Reset 1] Change this value to load following default configuration parameters
#endif
#ifdef MODULE
#undef MODULE
#define MODULE SONOFF_BASIC
//#define MODULE WEMOS
#endif
#ifndef USE_MQTT_TLS
#define USE_MQTT_TLS
#endif
#ifdef USE_MQTT_TLS
#ifdef MQTT_HOST
#undef MQTT_HOST
#define MQTT_HOST "MQTT HOST" // [MqttHost]
#endif
#ifdef MQTT_FINGERPRINT1
#undef MQTT_FINGERPRINT1
#define MQTT_FINGERPRINT1 "B0 XX XX 18 D6 2E 04 24 E1 28 5F B7 A2 B5 44 AA 36 23 FA C8" // [MqttFingerprint]
#endif
#ifdef MQTT_FINGERPRINT2
#undef MQTT_FINGERPRINT2
#define MQTT_FINGERPRINT2 "36 71 CD XX XX 61 EE A3 41 ED 65 20 19 75 76 4D 61 83 E9 B5" // [MqttFingerprint]
#endif
#ifdef MQTT_PORT
#undef MQTT_PORT
#define MQTT_PORT 8883 // [MqttPort] MQTT TLS port
#endif
#ifdef MQTT_USER
#undef MQTT_USER
#define MQTT_USER "MQTT_USER" // [MqttUser] Mandatory user
#endif
#ifdef MQTT_PASS
#undef MQTT_PASS
#define MQTT_PASS "MQTT_PASSWORD" // [MqttPassword] Mandatory password
#endif
#endif
#ifdef NTP_SERVER2
#undef NTP_SERVER2
#define NTP_SERVER2 "0.pl.pool.ntp.org" // [NtpServer2] Select second NTP server by name or IP address (5.39.184.5)
#endif
#ifdef NTP_SERVER3
#undef NTP_SERVER3
#define NTP_SERVER3 "1.pl.pool.ntp.org" // [NtpServer3] Select third NTP server by name or IP address (93.94.224.67)
#endif
#ifdef SWITCH_MODE
#undef SWITCH_MODE
#define SWITCH_MODE TOGGLE // [SwitchMode] TOGGLE, FOLLOW, FOLLOW_INV, PUSHBUTTON, PUSHBUTTON_INV, PUSHBUTTONHOLD, PUSHBUTTONHOLD_INV, PUSHBUTTON_TOGGLE (the wall switch state)
#endif
#ifdef USE_ALL_SENSORS
#undef USE_ALL_SENSORS // Create sonoff-xxl with all sensors enabled (See sonoff_post.h for selected sensors)
#endif
// -- Wifi ----------------------------------------
#ifdef WIFI_GATEWAY
#undef WIFI_GATEWAY
#define WIFI_GATEWAY "GATEWAY" // [IpAddress2] If not using DHCP set Gateway IP address
#endif
#ifdef WIFI_SUBNETMASK
#undef WIFI_SUBNETMASK
#define WIFI_SUBNETMASK "255.255.255.0" // [IpAddress3] If not using DHCP set Network mask
#endif
#ifdef WIFI_DNS
#undef WIFI_DNS
#define WIFI_DNS "DNS" // [IpAddress4] If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)
#endif
#ifdef STA_SSID1
#undef STA_SSID1
#define STA_SSID1 "SSID1" // [Ssid1] Wifi SSID
#endif
#ifdef STA_PASS1
#undef STA_PASS1
#define STA_PASS1 "PASS1" // [Password1] Wifi password
#endif
#ifdef STA_SSID2
#undef STA_SSID2
#define STA_SSID2 "SSID2" // [Ssid1] Wifi SSID
#endif
#ifdef STA_PASS2
#undef STA_PASS2
#define STA_PASS2 "PASS2" // [Password1] Wifi password
#endif
#ifdef WIFI_CONFIG_TOOL
#undef WIFI_CONFIG_TOOL
#define WIFI_CONFIG_TOOL WIFI_RETRY // [WifiConfig] Default tool if wifi fails to connect
// (WIFI_RESTART, WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_RETRY, WIFI_WAIT)
#endif
// -- Syslog --------------------------------------
#ifdef SYS_LOG_HOST
#undef SYS_LOG_HOST
#define SYS_LOG_HOST "SYSLOG_HOST" // [LogHost] (Linux) syslog host
#endif
#ifdef SYS_LOG_LEVEL
#undef SYS_LOG_LEVEL
#define SYS_LOG_LEVEL LOG_LEVEL_INFO // [SysLog]
#endif
#ifdef WEB_LOG_LEVEL
#undef WEB_LOG_LEVEL
#define WEB_LOG_LEVEL LOG_LEVEL_NONE // [WebLog]
#endif
// -- Ota -----------------------------------------r
#ifdef OTA_URL
#undef OTA_URL
#define OTA_URL "http://OTASERVER:PORTNUMBER/api/arduino/" PROJECT ".ino.bin" // [OtaUrl]
#endif
#ifdef USE_ARDUINO_OTA
#undef USE_ARDUINO_OTA // Add optional support for Arduino OTA (+4k5 code)
#endif
#ifdef TELE_PERIOD
#undef TELE_PERIOD
#define TELE_PERIOD 60
#endif
#ifdef USE_WEBSERVER
#undef USE_WEBSERVER
#endif
#ifdef WEB_SERVER
#undef WEB_SERVER
#define WEB_SERVER 2
#endif
#ifdef USE_DISCOVERY
#undef USE_DISCOVERY
#endif
#ifdef LATITUDE
#undef LATITUDE
#define LATITUDE LA.TITUDE // [Latitude] Your location to be used with sunrise and sunset
#endif
#ifdef LONGITUDE
#undef LONGITUDE
#define LONGITUDE LO.NGITUDE // [Longitude] Your location to be used with sunrise and sunset
#endif
#ifdef USE_DOMOTICZ
#undef USE_DOMOTICZ
#endif
#ifdef USE_HOME_ASSISTANT // Enable Home Assistant Discovery Support (+2k code)
#undef USE_HOME_ASSISTANT // Enable Home Assistant Discovery Support (+2k code)
#endif
#ifdef USE_KNX
#undef USE_KNX // Enable KNX IP Protocol Support (+23k code, +3k3 mem)
#endif
#ifdef USE_DISCOVERY
#undef USE_DISCOVERY // Enable mDNS for the following services (+8k code, +0.3k mem)
#endif
// -- Time ----------------------------------------
#define USE_TIMERS // Add support for up to 16 timers (+2k2 code)
#define USE_TIMERS_WEB // Add timer webpage support (+4k5 code)
#define USE_SUNRISE // Add support for Sunrise and sunset tools (+16k)
#define SUNRISE_DAWN_ANGLE DAWN_NORMAL // Select desired Dawn Angle from (DAWN_NORMAL, DAWN_CIVIL, DAWN_NAUTIC, DAWN_ASTRONOMIC)
// -- Rules ---------------------------------------
#define USE_RULES // Add support for rules (+4k4 code)
// -- Internal Analog input -----------------------
#define USE_ADC_VCC // Display Vcc in Power status. Disable for use as Analog input on selected devices
// -- One wire sensors ----------------------------
#ifdef USE_DS18x20
#undef USE_DS18x20
#define USE_DS18x20 // Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
#endif
#ifdef USE_DS18x20_LEGACY
#undef USE_DS18x20_LEGACY
//#define USE_DS18x20_LEGACY // Optional for more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code)
#endif
// -- I2C sensors ---------------------------------
#define USE_I2C // I2C using library wire (+10k code, 0k2 mem, 124 iram)
#ifdef USE_I2C
#ifdef USE_SHT
#undef USE_SHT
#define USE_SHT // Add I2C emulating code for SHT1X sensor (+1k4 code)
#endif
#ifdef USE_SHT3X
#undef USE_SHT3X
// #define USE_SHT3X // Add I2C code for SHT3x or SHTC3 sensor (+0k7 code)
#endif
#ifdef USE_HTU
#undef USE_HTU
#define USE_HTU // Add I2C code for HTU21/SI7013/SI7020/SI7021 sensor (+1k5 code)
#endif
#ifdef USE_BMP
#undef USE_BMP
#define USE_BMP // Add I2C code for BMP085/BMP180/BMP280/BME280 sensor (+4k code)
#endif
#ifdef USE_BME680
#undef USE_BME680
// #define USE_BME680 // Add additional support for BME680 sensor using Adafruit Sensor and BME680 libraries (+6k code)
#endif
#ifdef USE_SGP30
#undef USE_SGP30
// #define USE_SGP30 // Add I2C code for SGP30 sensor (+1k1 code)
#endif
#ifdef USE_BH1750
#undef USE_BH1750
// #define USE_BH1750 // Add I2C code for BH1750 sensor (+0k5 code)
#endif
#ifdef USE_VEML6070
#undef USE_VEML6070
// #define USE_VEML6070 // Add I2C code for VEML6070 sensor (+0k5 code)
#endif
#ifdef USE_TSL2561
#undef USE_TSL2561
// #define USE_TSL2561 // Add I2C code for TSL2561 sensor using library Joba_Tsl2561 (+2k3 code)
#endif
#ifdef USE_ADS1115
#undef USE_ADS1115
// #define USE_ADS1115 // Add I2C code for ADS1115 16 bit A/D converter based on Adafruit ADS1x15 library (no library needed) (+0k7 code)
#endif
#ifdef USE_ADS1115_I2CDEV
#undef USE_ADS1115_I2CDEV
// #define USE_ADS1115_I2CDEV // Add I2C code for ADS1115 16 bit A/D converter using library i2cdevlib-Core and i2cdevlib-ADS1115 (+2k code)
#endif
#ifdef USE_INA219
#undef USE_INA219
// #define USE_INA219 // Add I2C code for INA219 Low voltage and current sensor (+1k code)
#endif
#ifdef USE_MGS
#undef USE_MGS
// #define USE_MGS // Add I2C code for Xadow and Grove Mutichannel Gas sensor using library Multichannel_Gas_Sensor (+10k code)
#endif
#ifdef MGS_SENSOR_ADDR
#undef MGS_SENSOR_ADDR
#define MGS_SENSOR_ADDR 0x04 // Default Mutichannel Gas sensor i2c address
#endif
#endif // USE_I2C
// -- Serial sensors ------------------------------
#ifdef USE_MHZ19
#undef USE_MHZ19
//#define USE_MHZ19 // Add support for MH-Z19 CO2 sensor (+2k code)
#endif
#ifdef USE_SENSEAIR
#undef USE_SENSEAIR
//#define USE_SENSEAIR // Add support for SenseAir K30, K70 and S8 CO2 sensor (+2k3 code)
#endif
#ifdef USE_PMS5003
#undef USE_PMS5003 // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram)
//#define USE_PMS5003 // Add support for PMS5003 and PMS7003 particle concentration sensor (+1k3 code)
#endif
#ifdef USE_NOVA_SDS
#undef USE_NOVA_SDS // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram)
//#define USE_NOVA_SDS // Add support for SDS011 and SDS021 particle concentration sensor (+0k7 code)
#endif
#ifdef USE_PZEM004T
#undef USE_PZEM004T // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram)
//#define USE_PZEM004T // Add support for PZEM004T Energy monitor (+2k code)
#endif
#ifdef USE_SERIAL_BRIDGE
#undef USE_SERIAL_BRIDGE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram)
//#define USE_SERIAL_BRIDGE // Add support for software Serial Bridge (+0k8 code)
#endif
// -- Low level interface devices -----------------
#ifdef USE_IR_REMOTE
#undef USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram)
//#define USE_IR_REMOTE // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram)
#endif
#ifdef USE_WS2812
#undef USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by //
//#define USE_WS2812 // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by //
#endif
#ifdef USE_ARILUX_RF
#undef USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0))
//#define USE_ARILUX_RF // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0))
#endif
#ifdef USE_SR04
#undef USE_SR04 // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0))
#define USE_SR04 // Add support for HC-SR04 ultrasonic devices (+1k code)
#endif
#endif // _USER_CONFIG_OVERRIDE_H_
Is it correct, that you disabled the web server to get MQTT to work with TLS?
Mebus
Hi,
I found that my sonoffs basic crashed if I use STATUS 0.
And other
It happens when I use LWiP 1.4 Higher Bandwidth. The same result is on 5.12.0i and 5.13.1.
When I use LWiP 2.0 Higher Bandwidth or Lower Memory everythink is OK.
Is this normal?
I use 4MB flash in my sonoff (I replace the original one).