arendst / Tasmota

Alternative firmware for ESP8266 and ESP32 based devices with easy configuration using webUI, OTA updates, automation using timers or rules, expandability and entirely local control over MQTT, HTTP, Serial or KNX. Full documentation at
https://tasmota.github.io/docs
GNU General Public License v3.0
22.04k stars 4.78k forks source link

Sonoff reboots every 10 Mins constantly with exception #3385

Closed andreaslink-de closed 6 years ago

andreaslink-de commented 6 years ago

Hej, I've installed/tested several versions from GitHub and am finally running Tasmota with v6.1.1c. I nearly deactivated all packages beside web-server, MQTT and ws2812b support as I want to switch on an 20A power supply with a Sonoff Basic which is driving a WS2812B led stripe. GPIO 14 is via 220Ohm connected to the Data-IN pin of the stripe. Currently the stripe is unplugged and only the power supply is connected to the output of my Sonoff Basic. WiFi connection works immediately and also a connection to my local broker (mosquitto) is successful.

Then I realized the relais flickering from time to time and via MQTT and corresponding I can see these (slightly varying) RestartReasons:

RestartReason":"Fatal exception:0 flag:2 (EXCEPTION) epc1:0x227b3a22 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000"

RestartReason":"Fatal exception:0 flag:2 (EXCEPTION) epc1:0x73756168 epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000"}

So there is for sure something wrong, which cannot be identified, so I turned the relais off and monitored the same exception (mainly the first one).

I finally added a date/time to the cycles to measure the timeslots between the exceptions and reconnections and realized, it's more or less exactly 10 minutes, which indicates a watchdog or some other processing running into a limit, but I have no clue what this could be?

Between these 10 minute slots everything is fine and I can use everything pretty fast and responsive, also toggle relais on and off multiple times, so no issues at all.

Anyone an idea, what makes my device "reboot" or at least "reconnect" every 10 minutes? As it's so constant there must be something triggering this, which leads to the reboot exception.

Please find an extract of my logged monitoring here:

2018-07-31 00:24:54.286 sonoff/ws2812b/LWT offline
2018-07-31 00:25:03.225 sonoff/ws2812b/LWT online
2018-07-31 00:35:11.507 sonoff/ws2812b/LWT offline
2018-07-31 00:35:20.404 sonoff/ws2812b/LWT online
2018-07-31 00:45:28.696 sonoff/ws2812b/LWT offline
2018-07-31 00:45:35.643 sonoff/ws2812b/LWT online
2018-07-31 00:55:43.973 sonoff/ws2812b/LWT offline
2018-07-31 00:55:50.867 sonoff/ws2812b/LWT online
2018-07-31 01:05:59.191 sonoff/ws2812b/LWT offline
2018-07-31 01:06:08.145 sonoff/ws2812b/LWT online
2018-07-31 01:16:16.438 sonoff/ws2812b/LWT offline
2018-07-31 01:16:23.416 sonoff/ws2812b/LWT online
2018-07-31 01:26:31.786 sonoff/ws2812b/LWT offline
2018-07-31 01:26:38.729 sonoff/ws2812b/LWT online
2018-07-31 01:36:47.035 sonoff/ws2812b/LWT offline
2018-07-31 01:36:53.964 sonoff/ws2812b/LWT online
2018-07-31 01:47:02.281 sonoff/ws2812b/LWT offline
2018-07-31 01:47:11.216 sonoff/ws2812b/LWT online
2018-07-31 01:57:19.554 sonoff/ws2812b/LWT offline
2018-07-31 01:57:28.526 sonoff/ws2812b/LWT online
2018-07-31 02:07:36.841 sonoff/ws2812b/LWT offline
2018-07-31 02:07:43.784 sonoff/ws2812b/LWT online
2018-07-31 02:17:52.100 sonoff/ws2812b/LWT offline
2018-07-31 02:17:58.998 sonoff/ws2812b/LWT online
2018-07-31 02:28:07.360 sonoff/ws2812b/LWT offline
2018-07-31 02:28:14.262 sonoff/ws2812b/LWT online
2018-07-31 02:38:22.589 sonoff/ws2812b/LWT offline
2018-07-31 02:38:31.562 sonoff/ws2812b/LWT online
2018-07-31 02:48:39.857 sonoff/ws2812b/LWT offline
2018-07-31 02:48:48.801 sonoff/ws2812b/LWT online
2018-07-31 02:58:57.157 sonoff/ws2812b/LWT offline
2018-07-31 02:59:04.038 sonoff/ws2812b/LWT online
2018-07-31 03:09:12.377 sonoff/ws2812b/LWT offline
2018-07-31 03:09:19.306 sonoff/ws2812b/LWT online
2018-07-31 03:19:27.636 sonoff/ws2812b/LWT offline
2018-07-31 03:19:36.573 sonoff/ws2812b/LWT online
2018-07-31 03:29:44.885 sonoff/ws2812b/LWT offline
2018-07-31 03:29:51.843 sonoff/ws2812b/LWT online
2018-07-31 03:40:00.179 sonoff/ws2812b/LWT offline
2018-07-31 03:40:07.119 sonoff/ws2812b/LWT online
2018-07-31 03:50:15.436 sonoff/ws2812b/LWT offline
2018-07-31 03:50:22.388 sonoff/ws2812b/LWT online
2018-07-31 04:00:30.729 sonoff/ws2812b/LWT offline
2018-07-31 04:00:39.659 sonoff/ws2812b/LWT online
2018-07-31 04:10:47.982 sonoff/ws2812b/LWT offline
2018-07-31 04:10:56.939 sonoff/ws2812b/LWT online
2018-07-31 04:21:05.244 sonoff/ws2812b/LWT offline
2018-07-31 04:21:12.125 sonoff/ws2812b/LWT online
2018-07-31 04:31:20.445 sonoff/ws2812b/LWT offline
2018-07-31 04:31:29.332 sonoff/ws2812b/LWT online
2018-07-31 04:41:37.646 sonoff/ws2812b/LWT offline
2018-07-31 04:41:44.636 sonoff/ws2812b/LWT online
2018-07-31 04:51:52.986 sonoff/ws2812b/LWT offline
2018-07-31 04:51:59.938 sonoff/ws2812b/LWT online
2018-07-31 05:02:08.245 sonoff/ws2812b/LWT offline
2018-07-31 05:02:17.189 sonoff/ws2812b/LWT online
2018-07-31 05:12:25.488 sonoff/ws2812b/LWT offline
2018-07-31 05:12:32.438 sonoff/ws2812b/LWT online
2018-07-31 05:22:40.734 sonoff/ws2812b/LWT offline
2018-07-31 05:22:49.709 sonoff/ws2812b/LWT online
2018-07-31 05:32:58.009 sonoff/ws2812b/LWT offline
2018-07-31 05:33:06.962 sonoff/ws2812b/LWT online
2018-07-31 05:43:15.250 sonoff/ws2812b/LWT offline
2018-07-31 05:43:24.138 sonoff/ws2812b/LWT online
2018-07-31 05:53:32.436 sonoff/ws2812b/LWT offline
2018-07-31 05:53:39.369 sonoff/ws2812b/LWT online
2018-07-31 06:03:47.691 sonoff/ws2812b/LWT offline
2018-07-31 06:03:56.576 sonoff/ws2812b/LWT online
2018-07-31 06:14:04.846 sonoff/ws2812b/LWT offline
2018-07-31 06:14:11.791 sonoff/ws2812b/LWT online
2018-07-31 06:24:20.081 sonoff/ws2812b/LWT offline
2018-07-31 06:24:29.020 sonoff/ws2812b/LWT online
2018-07-31 06:34:37.322 sonoff/ws2812b/LWT offline
2018-07-31 06:34:44.277 sonoff/ws2812b/LWT online
2018-07-31 06:44:52.625 sonoff/ws2812b/LWT offline
2018-07-31 06:44:59.608 sonoff/ws2812b/LWT online
2018-07-31 06:55:07.912 sonoff/ws2812b/LWT offline
2018-07-31 06:55:16.858 sonoff/ws2812b/LWT online
2018-07-31 07:05:25.140 sonoff/ws2812b/LWT offline
2018-07-31 07:05:34.015 sonoff/ws2812b/LWT online
2018-07-31 07:15:42.310 sonoff/ws2812b/LWT offline
2018-07-31 07:15:51.237 sonoff/ws2812b/LWT online
2018-07-31 07:25:59.559 sonoff/ws2812b/LWT offline
2018-07-31 07:26:08.439 sonoff/ws2812b/LWT online
2018-07-31 07:36:16.761 sonoff/ws2812b/LWT offline
2018-07-31 07:36:23.706 sonoff/ws2812b/LWT online
2018-07-31 07:46:32.000 sonoff/ws2812b/LWT offline
2018-07-31 07:46:38.949 sonoff/ws2812b/LWT online
2018-07-31 07:56:47.298 sonoff/ws2812b/LWT offline
2018-07-31 07:56:56.250 sonoff/ws2812b/LWT online
2018-07-31 08:07:04.600 sonoff/ws2812b/LWT offline
2018-07-31 08:07:11.576 sonoff/ws2812b/LWT online
2018-07-31 08:17:19.877 sonoff/ws2812b/LWT offline
2018-07-31 08:17:26.831 sonoff/ws2812b/LWT online
2018-07-31 08:27:35.139 sonoff/ws2812b/LWT offline
2018-07-31 08:27:42.072 sonoff/ws2812b/LWT online
2018-07-31 08:37:50.398 sonoff/ws2812b/LWT offline
2018-07-31 08:37:57.340 sonoff/ws2812b/LWT online
2018-07-31 08:48:05.649 sonoff/ws2812b/LWT offline
2018-07-31 08:48:12.535 sonoff/ws2812b/LWT online
2018-07-31 08:58:20.887 sonoff/ws2812b/LWT offline
2018-07-31 08:58:27.836 sonoff/ws2812b/LWT online
2018-07-31 09:08:36.189 sonoff/ws2812b/LWT offline
2018-07-31 09:08:43.094 sonoff/ws2812b/LWT online
2018-07-31 09:18:51.424 sonoff/ws2812b/LWT offline
2018-07-31 09:19:00.373 sonoff/ws2812b/LWT online
2018-07-31 09:29:08.698 sonoff/ws2812b/LWT offline
2018-07-31 09:29:17.667 sonoff/ws2812b/LWT online
2018-07-31 09:39:25.982 sonoff/ws2812b/LWT offline
2018-07-31 09:39:32.935 sonoff/ws2812b/LWT online
2018-07-31 09:49:41.251 sonoff/ws2812b/LWT offline
2018-07-31 09:49:48.183 sonoff/ws2812b/LWT online
2018-07-31 09:59:56.477 sonoff/ws2812b/LWT offline
2018-07-31 10:00:03.403 sonoff/ws2812b/LWT online
2018-07-31 10:10:11.714 sonoff/ws2812b/LWT offline
2018-07-31 10:10:18.653 sonoff/ws2812b/LWT online
2018-07-31 10:20:26.995 sonoff/ws2812b/LWT offline
2018-07-31 10:20:33.943 sonoff/ws2812b/LWT online
2018-07-31 10:30:42.193 sonoff/ws2812b/LWT offline
2018-07-31 10:30:49.137 sonoff/ws2812b/LWT online
2018-07-31 10:40:57.435 sonoff/ws2812b/LWT offline
2018-07-31 10:41:04.379 sonoff/ws2812b/LWT online
2018-07-31 10:51:12.699 sonoff/ws2812b/LWT offline
2018-07-31 10:51:22.675 sonoff/ws2812b/LWT online
2018-07-31 11:01:30.976 sonoff/ws2812b/LWT offline
2018-07-31 11:01:37.932 sonoff/ws2812b/LWT online
2018-07-31 11:11:46.228 sonoff/ws2812b/LWT offline
2018-07-31 11:11:55.162 sonoff/ws2812b/LWT online
2018-07-31 11:22:03.490 sonoff/ws2812b/LWT offline
2018-07-31 11:22:10.430 sonoff/ws2812b/LWT online
2018-07-31 11:32:18.724 sonoff/ws2812b/LWT offline
2018-07-31 11:32:25.657 sonoff/ws2812b/LWT online
2018-07-31 11:42:33.983 sonoff/ws2812b/LWT offline
2018-07-31 11:42:42.933 sonoff/ws2812b/LWT online
2018-07-31 11:52:51.225 sonoff/ws2812b/LWT offline
2018-07-31 11:53:01.172 sonoff/ws2812b/LWT online
2018-07-31 12:03:09.435 sonoff/ws2812b/LWT offline
2018-07-31 12:03:16.330 sonoff/ws2812b/LWT online
2018-07-31 12:13:24.636 sonoff/ws2812b/LWT offline
2018-07-31 12:13:31.609 sonoff/ws2812b/LWT online
2018-07-31 12:23:39.957 sonoff/ws2812b/LWT offline
2018-07-31 12:23:46.905 sonoff/ws2812b/LWT online
2018-07-31 12:33:55.199 sonoff/ws2812b/LWT offline
2018-07-31 12:34:02.129 sonoff/ws2812b/LWT online
2018-07-31 12:44:10.442 sonoff/ws2812b/LWT offline
2018-07-31 12:44:18.330 sonoff/ws2812b/LWT online
2018-07-31 12:54:26.619 sonoff/ws2812b/LWT offline
2018-07-31 12:54:33.510 sonoff/ws2812b/LWT online

Provide the output of command status 0 :

sonoff/ws2812b/command/status 0
sonoff/ws2812b/STATUS {"Status":{"Module":1,"FriendlyName":["Kinderhaus-Relais","Kinderhaus-WS2812B"],"Topic":"sonoff-kinderhaus-led","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"SaveData":1,"SaveState":1,"ButtonRetain":0,"PowerRetain":0}}

sonoff/ws2812b/STATUS1 {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://192.168.0.253/arduino/firmware/esp8266/tasmota/sonoff.bin","RestartReason":"Exception","Uptime":"0T00:09:52","StartupUTC":"2018-07-29T17:49:36","Sleep":0,"BootCount":148,"SaveCount":204,"SaveAddress":"FA000"}}

sonoff/ws2812b/STATUS2 {"StatusFWR":{"Version":"6.1.1c","BuildDateTime":"2018.07.29 00:31:55","Boot":31,"Core":"2_4_1","SDK":"2.2.1(cfd48f3)"}}

sonoff/ws2812b/STATUS3 {"StatusLOG":{"SerialLog":2,"WebLog":2,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["MyPersonalWiFi",""],"TelePeriod":300,"SetOption":["00008089","55A18000","00000001"]}}

sonoff/ws2812b/STATUS4 {"StatusMEM":{"ProgramSize":428,"Free":572,"Heap":20,"ProgramFlashSize":1024,"FlashSize":1024,"FlashMode":3,"Features":["00000407","0000A7B0","00000000","00000096","00000000"]}}

sonoff/ws2812b/STATUS5 {"StatusNET":{"Hostname":"Kinderhaus-WS2812B","IPAddress":"192.168.0.152","Gateway":"192.168.0.254","Subnetmask":"255.255.255.0","DNSServer":"192.168.0.253","Mac":"5C:CF:7F:57:85:0A","Webserver":2,"WifiConfig":2}}

sonoff/ws2812b/STATUS6 {"StatusMQT":{"MqttHost":"192.168.0.253","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_57850A","MqttUser":"","MqttType":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}}

sonoff/ws2812b/STATUS7 {"StatusTIM":{"UTC":"Sun Jul 29 17:59:28 2018","Local":"Sun Jul 29 18:59:28 2018","StartDST":"Sun Mar 25 02:00:00 2018","EndDST":"Sun Oct 28 03:00:00 2018","Timezone":1}}

sonoff/ws2812b/STATUS10 {"StatusSNS":{"Time":"2018-07-29T18:59:28"}}

sonoff/ws2812b/STATUS11 {"StatusSTS":{"Time":"2018-07-29T18:59:28","Uptime":"0T00:09:52","Vcc":3.475,"POWER1":"OFF","POWER2":"OFF","Dimmer":26,"Color":"424242","HSBColor":"0,0,26","Channel":[26,26,26],"Scheme":0,"Width":1,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"MyPersonalWiFi","RSSI":78,"APMac":"8A:8A:20:4C:C0:15"}}}

/Andreas

Jason2866 commented 6 years ago

Did you erase the flash completly before you flashed Tasmota? -> Esptool erase_flash Fragments left can make trouble. If this didnt help change the module. Could simply be defect. I had bad experience with arduino core 2.4.0 and 2.4.1. For reliable setups there is just one choice Arduino core 2.3.0

andreaslink-de commented 6 years ago

Thanks for the fast response, and yes I fully cleared it before flashing (using Arduino IDE and "All Flash contents"). I read somewhere else of downgrading to 2.3.0 in relation to WiFi issues, but I cannot believe this might trigger these issues? Everything is fine and stable between the reboots, so no issues at all, which makes it so weird.

Jason2866 commented 6 years ago

Try 2.3.0 😎 I am pretty sure your problems will left. 2.4.1 makes funny problems especially wifi.

Jason2866 commented 6 years ago

Just my 2 cents. For bigger projects like Tasmota Arduino IDE is a pain... Try Platformio or Visual Studio Code. Setting up both for Tasmota is described in wiki. You will never use Arduino for Tasmota and other projects with more source files...

andreaslink-de commented 6 years ago

Thanks again @Jason2866 with your input I could not have slept without having given v2.3.0 a try :-). So I downgraded, rebuild, manually erased flash and uploaded exact same version on my Sonoff Basic.

WiFi connected a little faster, this was at least my impression, but I could be wrong. But I get exactly the same behavior right after 10 minutes. But this time, there was no exception for the first fail, instead it fails with "RestartReason":"Hardware Watchdog". Is that probably an indicator? Is there a hardware watchdog in Tasmota that needs to be served (yield)?

But second time I got the same Exception again:

"RestartReason":"Fatal exception:0 flag:2 (EXCEPTION) epc1:0x7265646e epc2:0x00000000 epc3:0x00000000 excvaddr:0x00000000 depc:0x00000000"

See my current log including status 0 output:

sonoff/ws2812b/LWT online
sonoff/ws2812b/command/POWER (null)
sonoff/ws2812b/INFO1 {"Module":"Sonoff Basic","Version":"6.1.1c","FallbackTopic":"DVES_57850A","GroupTopic":"sonoffs"}
sonoff/ws2812b/INFO2 {"WebServerMode":"Admin","Hostname":"Kinderhaus-WS2812B","IPAddress":"192.168.0.152"}
sonoff/ws2812b/INFO3 {"RestartReason":"Hardware Watchdog"}
sonoff/ws2812b/RESULT {"POWER1":"OFF"}
sonoff/ws2812b/POWER1 OFF
sonoff/ws2812b/RESULT {"POWER2":"OFF"}
sonoff/ws2812b/POWER2 OFF
sonoff/ws2812b/STATE {"Time":"2018-07-31T22:03:18","Uptime":"0T00:00:13","Vcc":3.148,"POWER1":"OFF","POWER2":"OFF","Dimmer":10,"Color":"191919","HSBColor":"0,0,10","Channel":[10,10,10],"Scheme":0,"Width":1,"Fade":"OFF","Speed":1,"LedTable":"OFF","Wifi":{"AP":1,"SSId":"MyPersonalWiFi","RSSI":84,"APMac":"8A:8A:20:4C:C0:15"}}

sonoff/ws2812b/command/status 0
sonoff/ws2812b/STATUS {"Status":{"Module":1,"FriendlyName":["Kinderhaus-Relais","Kinderhaus-WS2812B"],"Topic":"sonoff-kinderhaus-led","ButtonTopic":"0","Power":0,"PowerOnState":3,"LedState":1,"SaveData":1,"SaveState":1,"ButtonRetain":0,"PowerRetain":0}}
sonoff/ws2812b/STATUS1 {"StatusPRM":{"Baudrate":115200,"GroupTopic":"sonoffs","OtaUrl":"http://192.168.0.253/arduino/firmware/esp8266/tasmota/sonoff.bin","RestartReason":"Hardware Watchdog","Uptime":"0T00:00:17","StartupUTC":"2018-07-31T21:03:05","Sleep":0,"BootCount":7,"SaveCount":10,"SaveAddress":"FA000"}}
sonoff/ws2812b/STATUS2 {"StatusFWR":{"Version":"6.1.1c","BuildDateTime":"2018.07.31 22:48:30","Boot":31,"Core":"2_3_0","SDK":"1.5.3(aec24ac9)"}}
sonoff/ws2812b/STATUS3 {"StatusLOG":{"SerialLog":2,"WebLog":2,"SysLog":0,"LogHost":"","LogPort":514,"SSId":["MyPersonalWiFi",""],"TelePeriod":300,"SetOption":["00008089","55A18000","00000000"]}}
sonoff/ws2812b/STATUS4 {"StatusMEM":{"ProgramSize":396,"Free":604,"Heap":20,"ProgramFlashSize":1024,"FlashSize":1024,"FlashMode":3,"Features":["00000407","0000A7B0","00000000","00000096","00000000"]}}
sonoff/ws2812b/STATUS5 {"StatusNET":{"Hostname":"Kinderhaus-WS2812B","IPAddress":"192.168.0.152","Gateway":"192.168.0.254","Subnetmask":"255.255.255.0","DNSServer":"192.168.0.253","Mac":"5C:CF:7F:57:85:0A","Webserver":2,"WifiConfig":5}}
sonoff/ws2812b/STATUS6 {"StatusMQT":{"MqttHost":"192.168.0.253","MqttPort":1883,"MqttClientMask":"DVES_%06X","MqttClient":"DVES_57850A","MqttUser":"","MqttType":1,"MAX_PACKET_SIZE":1000,"KEEPALIVE":15}}
sonoff/ws2812b/STATUS7 {"StatusTIM":{"UTC":"Tue Jul 31 21:03:23 2018","Local":"Tue Jul 31 22:03:23 2018","StartDST":"Sun Mar 25 02:00:00 2018","EndDST":"Sun Oct 28 03:00:00 2018","Timezone":1}}
sonoff/ws2812b/STATUS10 {"StatusSNS":{"Time":"2018-07-31T22:03:23"}}

So as 2.3.0 shows exactly the same behavior, I'll go back to the newest 2.4.1, there are quite some fixes included and my WiFi was fine with both versions, so I think it's worth moving forward instead of trying with the old stuff. So this was not a fix, but a good hint anyway!

Regarding your Arduino IDE comment, I gave Platform IO a try and I simply don't like it; I run plenty of Arduino projects with lots of libraries on different boards and I'm really happy especially because of the easy board and library management tools in the Arduino IDE. VS Code I also use, but for different projects, non Arduino stuff. So I'm happy so far :-).

andreaslink-de commented 6 years ago

I think, I identified the issue now. Being back on v2.4.1, WiFi connect takes longer, but finally connects, so there is no problem. I just flashed it and did not do any changes to the setup, so in the current setup, there is no specific GPIO14 setup done. When I keep it as it is, it runs stable for at least have an hour now, so no 10 minute crashes anymore, which is interesting.

BUT the moment I activate this setup and set WS2812 for GPIO 14, which triggers a reboot...

2018-07-31_sonoffbasic_ws2812-setup

...I get the typical static every 10 minutes reboots/resets. So could there something be wrong with that library? Is a watchdog ignored, when this library is activated and what could be wrong? Could anyone else test his in his setup?

This is how I chose the modules in "user_config.h", before compiling:

[...]
/*********************************************************************************************\
 * END OF SECTION 1
 *
 * SECTION 2
 * - Enable a feature by removing both // in front of it
 * - Disable a feature by preceding it with //
\*********************************************************************************************/

// -- Localization --------------------------------
  // If non selected the default en-GB will be used
//#define MY_LANGUAGE            bg-BG           // Bulgarian in Bulgaria
//#define MY_LANGUAGE            cs-CZ           // Czech in Czech
#define MY_LANGUAGE            de-DE           // German in Germany
//#define MY_LANGUAGE            el-GR           // Greek in Greece
//#define MY_LANGUAGE            en-GB           // English in Great Britain. Enabled by Default
//#define MY_LANGUAGE            es-AR           // Spanish in Argentina
//#define MY_LANGUAGE            fr-FR           // French in France
//#define MY_LANGUAGE            hu-HU           // Hungarian in Hungary
//#define MY_LANGUAGE            it-IT           // Italian in Italy
//#define MY_LANGUAGE            nl-NL           // Dutch in the Netherlands
//#define MY_LANGUAGE            pl-PL           // Polish in Poland
//#define MY_LANGUAGE            pt-BR           // Portuguese in Brazil
//#define MY_LANGUAGE            pt-PT           // Portuguese in Portugal
//#define MY_LANGUAGE            ru-RU           // Russian in Russia
//#define MY_LANGUAGE            uk-UK           // Ukrainian in Ukrain
//#define MY_LANGUAGE            zh-CN           // Chinese (Simplified) in China
//#define MY_LANGUAGE            zh-TW           // Chinese (Traditional) in Taiwan

// -- Wifi Config tools ---------------------------
//#define USE_WPS                                  // Add support for WPS as initial wifi configuration tool (+33k code, 1k mem (5k mem with core v2.4.2+))
//#define USE_SMARTCONFIG                          // Add support for Wifi SmartConfig as initial wifi configuration tool (+23k code, +0.6k mem)

// -- OTA -----------------------------------------
#define USE_ARDUINO_OTA                          // Add optional support for Arduino OTA (+13k code)

/*-------------------------------------------------------------------------------------------*\
 * Select ONE of possible three MQTT library types below
\*-------------------------------------------------------------------------------------------*/
  // Default MQTT driver for both non-TLS and TLS connections. Blocks network if MQTT server is unavailable.
#define MQTT_LIBRARY_TYPE      MQTT_PUBSUBCLIENT   // Use PubSubClient library
  // Alternative MQTT driver does not block network when MQTT server is unavailable. No TLS support
//#define MQTT_LIBRARY_TYPE      MQTT_TASMOTAMQTT    // Use TasmotaMqtt library (+4k4 code, +4k mem) - non-TLS only
  // Alternative MQTT driver does not block network when MQTT server is unavailable. No TLS support
//#define MQTT_LIBRARY_TYPE      MQTT_ESPMQTTARDUINO // Use (patched) esp-mqtt-arduino library (+4k8 code, +4k mem) - non-TLS only

// -- MQTT ----------------------------------------
#define MQTT_TELE_RETAIN     0                   // Tele messages may send retain flag (0 = off, 1 = on)

// -- MQTT - Domoticz -----------------------------
//#define USE_DOMOTICZ                             // Enable Domoticz (+6k code, +0.3k mem)
  #define DOMOTICZ_IN_TOPIC    "domoticz/in"     // Domoticz Input Topic
  #define DOMOTICZ_OUT_TOPIC   "domoticz/out"    // Domoticz Output Topic

// -- MQTT - Home Assistant Discovery -------------
//#define USE_HOME_ASSISTANT                       // Enable Home Assistant Discovery Support (+2k code)
  #define HOME_ASSISTANT_DISCOVERY_PREFIX "homeassistant"  // Home Assistant discovery prefix

// -- MQTT - TLS ----------------------------------
  // !!! TLS uses a LOT OF MEMORY so be careful to enable other options at the same time !!!
//#define USE_MQTT_TLS                             // Use TLS for MQTT connection (+53k code, +15k mem)

// -- KNX IP Protocol -----------------------------
//#define USE_KNX                                  // Enable KNX IP Protocol Support (+9.4k code, +3k7 mem)
  #define USE_KNX_WEB_MENU                       // Enable KNX WEB MENU (+8.3k code, +144 mem)

// -- HTTP ----------------------------------------
#define USE_WEBSERVER                            // Enable web server and Wifi Manager (+66k code, +8k mem)
  #define WEB_PORT             80                // Web server Port for User and Admin mode
  #define WEB_USERNAME         "admin"           // Web server Admin mode user name
  #define USE_EMULATION                          // Enable Belkin WeMo and Hue Bridge emulation for Alexa (+16k code, +2k mem)

// -- mDNS ----------------------------------------
//#define USE_DISCOVERY                            // Enable mDNS for the following services (+8k code, +0.3k mem)
  #define WEBSERVER_ADVERTISE                    // Provide access to webserver by name <Hostname>.local/
  #define MQTT_HOST_DISCOVERY                    // Find MQTT host server (overrides MQTT_HOST if found)

// -- 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 ----------------------------
                                                 // WARNING: Select none for default one DS18B20 sensor or enable one of the following two options for multiple sensors
//#define USE_DS18x20                              // Optional for more than one DS18x20 sensors with id sort, single scan and read retry (+1k3 code)
//#define USE_DS18x20_LEGACY                       // Optional for more than one DS18x20 sensors with dynamic scan using library OneWire (+1k5 code)

// -- I2C sensors ---------------------------------
//#define USE_I2C                                  // I2C using library wire (+10k code, 0k2 mem, 124 iram)
#ifdef USE_I2C
  #define USE_SHT                                // Enable SHT1X sensor (+1k4 code)
  #define USE_HTU                                // Enable HTU21/SI7013/SI7020/SI7021 sensor (I2C address 0x40) (+1k5 code)
  #define USE_BMP                                // Enable BMP085/BMP180/BMP280/BME280 sensor (I2C address 0x76 or 0x77) (+4k code)
    #define USE_BME680                           // Enable support for BME680 sensor using Bosch BME680 library (+4k code)
  #define USE_BH1750                             // Enable BH1750 sensor (I2C address 0x23 or 0x5C) (+0k5 code)
//  #define USE_VEML6070                           // Enable VEML6070 sensor (I2C addresses 0x38 and 0x39) (+0k5 code)
//  #define USE_ADS1115                            // 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_ADS1115_I2CDEV                     // Enable ADS1115 16 bit A/D converter (I2C address 0x48, 0x49, 0x4A or 0x4B) using library i2cdevlib-Core and i2cdevlib-ADS1115 (+2k code)
//  #define USE_INA219                             // Enable INA219 (I2C address 0x40, 0x41 0x44 or 0x45) Low voltage and current sensor (+1k code)
  #define USE_SHT3X                              // Enable SHT3x (I2C address 0x44 or 0x45) or SHTC3 (I2C address 0x70) sensor (+0k7 code)
//  #define USE_TSL2561                            // Enable TSL2561 sensor (I2C address 0x29, 0x39 or 0x49) using library Joba_Tsl2561 (+2k3 code)
//  #define USE_MGS                                // Enable Xadow and Grove Mutichannel Gas sensor using library Multichannel_Gas_Sensor (+10k code)
    #define MGS_SENSOR_ADDR    0x04              // Default Mutichannel Gas sensor i2c address
  #define USE_SGP30                              // Enable SGP30 sensor (I2C address 0x58) (+1k1 code)
//  #define USE_SI1145                             // Enable SI1145/46/47 sensor (I2C address 0x60) (+1k code)
  #define USE_LM75AD                             // Enable LM75AD sensor (I2C addresses 0x48 - 0x4F) (+0k5 code)
//  #define USE_APDS9960                           // Enable APDS9960 Proximity Sensor (I2C address 0x39). Disables SHT and VEML6070 (+4k7 code)
//  #define USE_MCP230xx                           // Enable MCP23008/MCP23017 for GP INPUT ONLY (I2C addresses 0x20 - 0x27) providing command Sensor29 for configuration (+2k2 code)
//  #define USE_MPR121                             // Enable MPR121 controller (I2C addresses 0x5A, 0x5B, 0x5C and 0x5D) in input mode for touch buttons (+1k3 code)
//  #define USE_CCS811                             // Enable CCS811 sensor (I2C address 0x5A) (+2k2 code)
#endif  // USE_I2C

// -- SPI sensors ---------------------------------
//#define USE_SPI                                  // SPI using default library
#ifdef USE_SPI

#endif  // USE_SPI

// -- Serial sensors ------------------------------
//#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)
  #define CO2_LOW              800               // Below this CO2 value show green light (needs PWM or WS2812 RG(B) led and enable with SetOption18 1)
  #define CO2_HIGH             1200              // Above this CO2 value show red light (needs PWM or WS2812 RG(B) led and enable with SetOption18 1)
//#define USE_PMS5003                              // Add support for PMS5003 and PMS7003 particle concentration sensor (+1k3 code)
//#define USE_NOVA_SDS                             // Add support for SDS011 and SDS021 particle concentration sensor (+0k7 code)
//#define USE_PZEM004T                             // Add support for PZEM004T Energy monitor (+2k code)
//#define USE_SERIAL_BRIDGE                        // Add support for software Serial Bridge (+0k8 code)
//#define USE_SDM120                               // Add support for Eastron SDM120-Modbus energy meter (+1k7 code)
//  #define SDM120_SPEED         9600              // SDM120-Modbus RS485 serial speed (default: 2400 baud)
//#define USE_SDM630                               // Add support for Eastron SDM630-Modbus energy meter (+2k code)
//  #define SDM630_SPEED         9600              // SDM630-Modbus RS485 serial speed (default: 9600 baud)

// -- Low level interface devices -----------------
//#define USE_IR_REMOTE                            // Send IR remote commands using library IRremoteESP8266 and ArduinoJson (+4k code, 0k3 mem, 48 iram)
//  #define USE_IR_HVAC                            // Support for HVAC system using IR (+2k code)
//  #define USE_IR_RECEIVE                         // Support for IR receiver (+5k5 code, 264 iram)

#define USE_WS2812                               // WS2812 Led string using library NeoPixelBus (+5k code, +1k mem, 232 iram) - Disable by //
  #define USE_WS2812_CTYPE     NEO_GRB           // WS2812 Color type (NEO_RGB, NEO_GRB, NEO_BRG, NEO_RBG, NEO_RGBW, NEO_GRBW)
//  #define USE_WS2812_DMA                         // DMA supports only GPIO03 (= Serial RXD) (+1k mem). When USE_WS2812_DMA is enabled expect Exceptions on Pow

//#define USE_ARILUX_RF                            // 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)

//#define USE_TM1638                               // Add support for TM1638 switches copying Switch1 .. Switch8 (+1k code)

//#define USE_RF_FLASH                             // Add support for flashing the EFM8BB1 chip on the Sonoff RF Bridge. C2CK must be connected to GPIO4, C2D to GPIO5 on the PCB (+3k code)

/*********************************************************************************************\
 * Debug features are only supported in development branch
\*********************************************************************************************/

//#define USE_DEBUG_DRIVER                         // Use xdrv_99_debug.ino providing commands CpuChk, CfgXor, CfgDump, CfgPeek and CfgPoke

/*********************************************************************************************\
 * Select features and sensors enabled in previous version saving space
\*********************************************************************************************/

//#define USE_CLASSIC                              // Create sonoff-classic (See sonoff_post.h for selected features)

/*********************************************************************************************\
 * Select all sensors - overrides above undefines!!
\*********************************************************************************************/

//#define USE_ALL_SENSORS                          // Create sonoff-allsensors with all sensors enabled (See sonoff_post.h for selected sensors)

/*********************************************************************************************\
 * Select KNX without Emulation to save space
\*********************************************************************************************/

//#define USE_KNX_NO_EMULATION                     // Create sonoff-knx with KNX but without Emulation (See sonoff_post.h)

/*********************************************************************************************\
 * Compile a minimal version if upgrade memory gets tight ONLY TO BE USED FOR UPGRADE STEP 1!
 *   To be used as step 1 during upgrade.
 *   Step 2 is re-compile with option BE_MINIMAL commented out.
\*********************************************************************************************/

//#define BE_MINIMAL                               // Minimal version if upgrade memory gets tight (-45k code, -2k mem)

/*********************************************************************************************\
 * No user configurable items below
\*********************************************************************************************/

#if defined(USE_MQTT_TLS) && defined(USE_WEBSERVER)
  #error "Select either USE_MQTT_TLS or USE_WEBSERVER as there is just not enough memory to play with"
#endif

#endif  // _USER_CONFIG_H_
Frogmore42 commented 6 years ago

How are you powering your led strip?

I have a NodeMCU board that probably has a defective voltage regulator. It reboots all the time. Sometimes it will stay up for 175 hours, at other time it can't even stay up for an hour.

Jason2866 commented 6 years ago

I am with @Frogmore42 Change the module, it is defect I have a WS2812 Strip running on a wemos mini without any restarts since last update to 6.1.1b (16 days)

andreaslink-de commented 6 years ago

Hmm, as I said I use a 20A power supply for the LEDs, but currently nothing of it is attached during my tests. I've only my naked Sonoff Basic, flashed via Arduino according to the setup as posted above. It is stable until I set "WS2812" for GPIO14 and I'm pretty confident, this is a software issue as it's so strict and precise with the 10 minutes reboot slots and only triggered, when this setup is changed.

It would be great if @arendst might give a hint here, I've seen some watchdog handling in the code, but it's pretty complex tied into the code. Could there be some requirement I need in relation to the used WS2812 library?

Never the less, I can also flash it on another new one, I should have another one lying around. Probably I can give a try today in the evening.

Jason2866 commented 6 years ago

@andreaslink-de Good idea to change hardware.

Frogmore42 commented 6 years ago

I would suggest trying one of the released binaries and capturing the complete serial log from the device. You said you removed lots of things. It is possible that you removed too much by changing flags in a way that no one else has tried before. I usually use the all sensors or its equivalent. That way I can use the same firmware on all my devices and don't have to make and keep track of several versions.

You are correct that if it is exactly at 10min that is probably a soft/firmware issue.

But, I know many people are using the WS2812 library and I have not heard of anyone else having this issue.

So, try the released version and see if it has the same issue. It should be pretty easy to tell, since the failure seems consistent.

andreaslink-de commented 6 years ago

You said you removed lots of things. It is possible that you removed too much by changing flags in a way that no one else has tried before.

And here I fully agree, this is also my major concern. I removed a lot as the Sonoff Basic only has 1M of flash and I wanted to be below 500kB in total just to be sure, to be able to deploy OTA updates later. But based on the instability and probably unforseen dependencies between modules, it's not that wise to go that way. So just put everything in and live without future OTA updates. I'll consider this approach as a possible solution.

But never the less I would be interested in, where and what the root cause is being responsible for the 10 min reboot :-).

Jason2866 commented 6 years ago

@andreaslink-de I fired up my wemos mini with the 24 pixel ring running scheme 11 (latest 6.1.1c dev with core 2.3.0) my user_config_override.h

#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.
\*****************************************************************************************************/

// -- Master parameter control --------------------
#undef  CFG_HOLDER
#define CFG_HOLDER        4617                   // [Reset 1] Change this value to load SECTION1 configuration parameters to flash

#undef  SERIAL_LOG_LEVEL
#define SERIAL_LOG_LEVEL       LOG_LEVEL_NONE    // [SerialLog] (LOG_LEVEL_NONE, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, LOG_LEVEL_DEBUG, LOG_LEVEL_DEBUG_MORE)

#undef  OTA_URL
#define OTA_URL                "http://192.168.2.20/web/tasmota/sonoff.bin"  // [OtaUrl]

// -- Setup your own Wifi settings  ---------------
#undef  STA_SSID1
#define STA_SSID1         "SSID"     // [Ssid1] Wifi SSID
//#define STA_SSID1         "gkkxXh"     // [Ssid1] Wifi SSID

#undef  STA_PASS1
#define STA_PASS1         "Password"         // [Password1] Wifi password
//#define STA_PASS1         "4WPgRjFk"         // [Password1] Wifi password

#undef  WIFI_CONFIG_NO_SSID                                                 
#define WIFI_CONFIG_NO_SSID    WIFI_SERIAL       // Default tool if wifi fails to connect and no SSID is configured
                                                 //   (WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_SERIAL)
                                                 //   *** NOTE: When WPS is disabled by USE_WPS below, WIFI_WPSCONFIG will execute WIFI_MANAGER ***
                                                 //   *** NOTE: When WIFI_MANAGER is disabled by USE_WEBSERVER below, WIFI_MANAGER will execute WIFI_SMARTCONFIG ***
                                                 //   *** NOTE: When WIFI_SMARTCONFIG is disabled by USE_SMARTCONFIG below, WIFI_SMARTCONFIG will execute WIFI_SERIAL ***

#undef  WIFI_CONFIG_TOOL
#define WIFI_CONFIG_TOOL  WIFI_WAIT             // [WifiConfig] Default tool if wifi fails to connect
                                                //   (WIFI_RESTART, WIFI_SMARTCONFIG, WIFI_MANAGER, WIFI_WPSCONFIG, WIFI_RETRY, WIFI_WAIT, WIFI_SERIAL)
// -- Wifi Config tools ---------------------------
#undef  USE_WPS                                  // Add support for WPS as initial wifi configuration tool (+33k code, 1k mem (5k mem with core v2.4.2+))
#undef  USE_SMARTCONFIG                          // Add support for Wifi SmartConfig as initial wifi configuration tool (+23k code, +0.6k mem)
//#define USE_WPS                                  // Add support for WPS as initial wifi configuration tool (+33k code, 1k mem (5k mem with core v2.4.2+))
//#define USE_SMARTCONFIG                          // Add support for Wifi SmartConfig as initial wifi configuration tool (+23k code, +0.6k mem)

// -- OTA -----------------------------------------
#undef  USE_ARDUINO_OTA                          // Add optional support for Arduino OTA (+13k code)

#undef  WIFI_IP_ADDRESS
#define WIFI_IP_ADDRESS   "0.0.0.0"             // Set to 0.0.0.0 for using DHCP or IP address

#undef  WIFI_SUBNETMASK
#define WIFI_SUBNETMASK   "255.255.255.0"       // [IpAddress3] If not using DHCP set Network mask

#undef  WIFI_GATEWAY
#define WIFI_GATEWAY      "192.168.2.1"         // if not using DHCP set Gateway IP address

#undef  WIFI_DNS
#define WIFI_DNS          "192.168.2.1"         // If not using DHCP set DNS IP address (might be equal to WIFI_GATEWAY)

// -- Setup your own MQTT settings  ---------------
#undef  MQTT_HOST
#define MQTT_HOST         "192.168.2.114"       // [MqttHost]

#undef  MQTT_PORT
#define MQTT_PORT         1883                   // [MqttPort] MQTT port (10123 on CloudMQTT)

#undef  MQTT_USER
#define MQTT_USER         "openhabian"         // [MqttUser] Optional user

#undef  MQTT_PASS
#define MQTT_PASS         "openhabian"         // [MqttPassword] Optional password

#undef  EMULATION
#define EMULATION         EMUL_HUE          // [Emulation] Select Belkin WeMo (single relay/light) or Hue Bridge emulation (multi relay/light) (EMUL_NONE, EMUL_WEMO or EMUL_HUE)

#undef  NTP_SERVER1
#define NTP_SERVER1       "ptbtime1.ptb.de"  // [NtpServer1] Select first NTP server by name or IP address (129.250.35.250)

#undef  LATITUDE
#define LATITUDE          48.xxxx         // [Latitude] Your location to be used with sunrise and sunset

#undef  LONGITUDE
#define LONGITUDE         11.xxxxx         // [Longitude] Your location to be used with sunrise and sunset

#undef  APP_TIMEZONE
#define APP_TIMEZONE           99                // [Timezone] +1 hour (Amsterdam) (-13 .. 14 = hours from UTC, 99 = use TIME_DST/TIME_STD)

#undef  APP_SLEEP
#define APP_SLEEP              1                 // [Sleep] Sleep time to lower energy consumption (0 = Off, 1 - 250 mSec)

#undef  WS2812_LEDS
#define WS2812_LEDS            24                // [Pixels] Number of WS2812 LEDs to start with (max is 512)

#undef  MQTT_LIBRARY_TYPE
#define MQTT_LIBRARY_TYPE      MQTT_PUBSUBCLIENT   // Use PubSubClient library
//#define MQTT_LIBRARY_TYPE      MQTT_TASMOTAMQTT    // Use TasmotaMqtt library (+4k4 code, +4k mem) - non-TLS only

#undef  USE_DOMOTICZ                           // Enable Domoticz (+6k code, +0.3k mem)
#undef  USE_HOME_ASSISTANT                     // Enable Home Assistant Discovery Support (+2k code)
#undef  USE_KNX                                // Enable KNX IP Protocol Support (+23k code, +3k3 mem)

#undef  USE_DISCOVERY                          // Enable mDNS for the following services (+8k code, +0.3k mem)

#define USE_I2C                                // I2C using library wire (+10k code, 0k2 mem, 124 iram)

#undef  USE_SHT                                // Add I2C emulating code for SHT1X sensor (+1k4 code)
#undef  USE_SHT3X                              // Add I2C code for SHT3x or SHTC3 sensor (+0k7 code)
#undef  USE_HTU                                // Add I2C code for HTU21/SI7013/SI7020/SI7021 sensor (+1k5 code)
#undef  USE_LM75AD                             // Add I2C code for LM75AD sensor (+0k5 code)
#undef  USE_SGP30                              // Add I2C code for SGP30 sensor (+1k1 code)
#undef  USE_BH1750                             // Add I2C code for BH1750 sensor (+0k5 code)
#define USE_TSL2561                            // Add I2C code for TSL2561 sensor using library Joba_Tsl2561 (+2k3 code)
//#undef  USE_MHZ19                              // Add support for MH-Z19 CO2 sensor (+2k code)
#undef  USE_SENSEAIR                           // Add support for SenseAir K30, K70 and S8 CO2 sensor (+2k3 code)
#undef  USE_PMS5003                            // Add support for PMS5003 and PMS7003 particle concentration sensor (+1k3 code)
#undef  USE_NOVA_SDS                           // Add support for SDS011 and SDS021 particle concentration sensor (+0k7 code)
#undef  USE_PZEM004T                           // Add support for PZEM004T Energy monitor (+2k code)
#undef  USE_SDM120                             // Add support for Eastron SDM120-Modbus energy meter (+1k7 code)
#undef  USE_SDM630                             // Add support for Eastron SDM630-Modbus energy meter (+2k code)
#undef  USE_BME680
#undef  USE_LM75AD                             // Enable LM75AD sensor (I2C addresses 0x48 - 0x4F) (+0k5 code)
#define USE_APDS9960                           // Enable APDS9960 Proximity Sensor (I2C address 0x39). Disables SHT and VEML6070 (+4k7 code)

#undef  USE_ARILUX_RF                          // Add support for Arilux RF remote controller (+0k8 code, 252 iram (non 2.3.0))
#undef  USE_IR_HVAC                            // Support for HVAC system using IR (+2k code)
#undef  USE_SR04                               // Add support for HC-SR04 ultrasonic devices (+1k code)

#define USE_TM1638                             // Add support for TM1638 switches copying Switch1 .. Switch8 (+1k code)
#define USE_MPR121                             // Enable MPR121 controller (I2C addresses 0x5A, 0x5B, 0x5C and 0x5D) in input mode for touch buttons (+1k3 code)
  #define USE_MCP230xx                           // Add I2C code for MCP23008/MCP23017 for GP INPUT ONLY providing command Sensor29 for configuration (+2k2 code)
    #define USE_MCP230xx_displaymain             // Display pin status on Tasmota main page (+0k2 code)
    #define USE_MCP230xx_webconfig               // Enable web config button and form to Tasmota web interface (+2k1 code)

//#define DISPLAY_CONFIG

#ifdef DISPLAY_CONFIG  // ****************************************************************************

#ifdef USE_I2C
  #define USE_DISPLAY                            // Add I2C Display Support for LCD, Oled and up to eigth Matrices (+19k code)
    #define MTX_ADDRESS1       0x71              // [DisplayAddress[1]] I2C address of first 8x8 matrix module
    #define MTX_ADDRESS2       0x74              // [DisplayAddress[2]] I2C address of second 8x8 matrix module
    #define MTX_ADDRESS3       0x75              // [DisplayAddress[3]] I2C address of third 8x8 matrix module
    #define MTX_ADDRESS4       0x72              // [DisplayAddress[4]] I2C address of fourth 8x8 matrix module
    #define MTX_ADDRESS5       0x73              // [DisplayAddress[5]] I2C address of fifth 8x8 matrix module
    #define MTX_ADDRESS6       0x76              // [DisplayAddress[6]] I2C address of sixth 8x8 matrix module
    #define MTX_ADDRESS7       0x00              // [DisplayAddress[7]] I2C address of seventh 8x8 matrix module
    #define MTX_ADDRESS8       0x00              // [DisplayAddress[8]] I2C address of eigth 8x8 matrix module
#endif  // USE_I2C

// -- SPI sensors ---------------------------------
#define USE_SPI                                  // SPI using library TasmotaTFT
#ifdef USE_SPI
  #ifndef USE_DISPLAY
  #define USE_DISPLAY                            // Add SPI Display support for 320x240 and 480x320 TFT
  #endif
#endif  // USE_SPI

#endif  // DISPLAY_CONFIG ****************************************************************************

#endif  // _USER_CONFIG_OVERRIDE_H_

image

andreaslink-de commented 6 years ago

Thanks @Jason2866, also great to see, how you use the _user_configoverride.h, where I was always too lazy to go that way. Is it necessary to "undef" before "define" again in here? Which modules are activated in your _userconfig.h or is that fully untouched? And having a program size of only 451kB motivates me, to go the same way. So thanks a lot, I need to get that tested asap at home.

Frogmore42 commented 6 years ago

There was a time where I worried about how big the binary was, but then Theo implemented the two step upgrade with the minimal bin. That has enough room to last a little while. I believe there will come a time when it will be necessary to make some choices about exactly which sensors I need.

The proper way (always works) is to warp the #under in a #ifdef as shown in the wiki/sample file. If you know the value is defined, because of other choices you made, you omit the #ifdef. If you omit the #undef, and try to redefine it, you will get a compiler error.

Until you try the full released binary, there is no way to know if the problem was that or really a hardware issue or possibly something else. If it is a software modules inclusion issue, it will take someone really motivated to figure out the issue. Perhaps that is you 😃.

Jason2866 commented 6 years ago

@andreaslink-de Yes, user_config.h is fully untouched. If i download a new version i just have to unpack and copy just the file user_config_override.h and change in platformio.ini the entry ; -DUSE_CONFIG_OVERRIDE to
-DUSE_CONFIG_OVERRIDE

and hit compile button. Thats it. Its done in 1 minute.

andreaslink-de commented 6 years ago

So I finally followed @Frogmore42 suggestion:

So, try the released version and see if it has the same issue. It should be pretty easy to tell, since the failure seems consistent.

And it turned out, this is the ONLY way to get rid of the 10 minutes consitently dying Sonoff :-(. So somehow a success (on the same hardware by the way), but no real explanation; I took the sonoff-DE.bin and successfully flashed it (without deleting my setup) and I have no hick ups anymore.

So I did the same on my own again, cloned the repository, did no modifications compiled and uploaded and I'm back with the continously 10 minute restarts. What the hack is going wrong? I'm fully following the suggested Arduino IDE flash recommended params. Why are my compiles or flashes different? I even copied all libraries again from the cloned repro into my lib folder.

So now I think it's an issue with my compile (running newest Arduino IDE unter Linux Mint), what could I oversee?

arendst commented 6 years ago

Just for my curiosity have a look at a hex dump of your compiled binary and check how byte alignment is being used. The below hexdump is taken almost at the end of the binary where the data table is stored.

image

The left part shows a correctly aligned binary compiled in Windows. The right part shows a mis-aligned binary compiled on Linux by Travis.

Using the mis-aligned binary users encountered difficult wifi connections and probably corrupt webpages. I guess the WS2812 routines also won't like mis-alignment...

I expect there must be a xtensa cross-compiler directive to use correctly byte alignment but as of now I don't know what it is.

Jason2866 commented 6 years ago

So everything fits together. I never had problems because i use Windows environment...

andrethomas commented 6 years ago

@Jason2866 @arendst I guess being a 32bit cpu the byte alignment should be at least 4 bytes but it may also be flash dependent.

The alignment is not specific to a variable but rather as to where the blocks defined in the linker script forms the boundaries in the binary when performing the linking process.

I had to do this when I was writing code for STM32F4 microcontrollers otherwise I would get random failures on constants defined in PROGMEM because the functions that made provision for the data to be read from F had to read the content in 4 byte blocks (e.g. 4 byte word) so having a PROGMEM start with an offset of -1 or +1 on a 4 byte read caused exceptions.

Taking a peek at the eagle.app.v6.common.ld which seems to be included from the linker script its interesting to note that some areas are 4 byte, 8 byte and even 16 byte aligned - go check the . = ALIGN (); statements added to the subsections.

A logical explanation for why the sonoff-DE.bin version worked for @andreaslink-de could be that the PROGMEM's just happen to align correctly insofar that a segmentation fault isn't created.

autofrank commented 6 years ago

I had a RFBridge (V1, no screws) that rebooted every 5 mins. A reflash of the firmware (over serial) and it solved the issue.

ascillato2 commented 6 years ago

Hi,

Any updates on this issue or we can close it?

andreaslink-de commented 6 years ago

@arendst You are fully right, I've checked your HEX example and compared it with one I've compiled on my Linux machine "as I usually do". I tried to find nearly the same section as seen on your screenshot and I can proof mine is also "slimmer" than your Windows one (spacing with two "dots" (0x00) instead of one "dot": 2018-08-22_auswahl_001

This is a major new info for me, as I always thought compiled is compiled and the OS does not influence it as I expect the Arduino IDE and "hidden" ESP8266 compiler flags and linker details to be equal over systems. That there are now differences moves everything into a fully new light and could have several other consequences on other projects I did/compiled.

So thanks for this info, that at least answers and explains my initial request - even though I need to find a solution under Linux. Probably with this learning it could be wise to add a comment either in the wiki or somewhere meaningful, so that others are pointed on this challenge with Linux or compiler/linker flags being used, do you agree?

@andrethomas your experience and suggestions with PROGMEM sounds interesting. Is there anything I can do to prove this or make somewhere changes to my linker? I did not exactly get, where I can find the ALIGN(); part? My Linux machine is running a common i7 64bit CPU.

Beside this, I guess I can close this topic now. Thank you all for your effort in analyzing this.

PS: Sorry for late response, had been ill some days in bed; this one was not forgotten :).