ESP Easy and Sonoff TH16 - crash every 2 days

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
aneo
New user
Posts: 5
Joined: 16 Jan 2019, 15:36

ESP Easy and Sonoff TH16 - crash every 2 days

#1 Post by aneo » 27 Feb 2019, 09:06

Dear Friends, I have a simple termostat that operates in 4 modes
1. Automatic when it use day and night tempo specifies in Dummy device 4,3 and 4,4
2. Manual when user specify target temp in Dummy Device 4,2
3. Vacation when it only keeps minimal temp in house.
4. OFF

I crated set of rules (dont know if i achieve it in a best way as this is my first ESP rules set) that works as it should be. On Sonoff TH16 and ESP mega-20190116. The only problem is that this device crash every 1-2 days and after reboots work as intended. Also that after reboot it goes to my default settings. I'm just wondering if my code is not too much to handle by this device.

Code: Select all

// Initial Parameters
on System#Boot do
  TaskValueSet 4,1,1
  TaskValueSet 4,2,8
  TaskValueSet 4,3,21.5
  TaskValueSet 4,4,19
endon

// Manual CO Pomp Start
on button#state do
  if [button#state]=0
    gpio,12,0
    TaskValueSet 4,1,4
  else
    gpio,12,1
    TaskValueSet 4,1,2
  endif 
endon

// L1 work mode
on thsalon#temp do
  SendTo 1,event,SetTSalon=[thsalon#temp]
  if [termostat#mode]=1
    event,amode
  endif
  if [termostat#mode]=2
    event,mmode
  endif
  if [termostat#mode]=3
    event,vmode
  endif
endon

// L2 Auto mode
on amode do
  if %systime% < 06:45:00 or %systime% > 23:00:00
    TaskValueSet 4,2,[termostat#settn]
  else
    TaskValueSet 4,2,[termostat#settd]
  endif    
  
  if [thsalon#temp]<[termostat#settt]
      gpio,12,1
  else
      gpio,12,0
  endif
endon

// L2 Manual Mode
on mmode do
 if [thsalon#temp]<[termostat#settt]
  gpio,12,1
 else
  gpio,12,0
 endif
endon

// L2 Vacation Mode
on vmode do
 TaskValueSet 4,2,4
 if [thsalon#temp]<[termostat#settt]
  gpio,12,1
 else
  gpio,12,0
 endif
endon

// Events to set thermostat parameters. 
// L1 Set running mode
on setm do
 TaskValueSet 4,1,%eventvalue%
endon

// L1 Set current target temp
on sett do
 TaskValueSet 4,2,%eventvalue%
endon

// L1 Set auto day temp
on settd do
 TaskValueSet 4,3,%eventvalue%
endon

// L1 Set auto night temp
on settn do
 TaskValueSet 4,4,%eventvalue%
endon
And this is my Device settings.
ScreenShot1001.png
ScreenShot1001.png (27.8 KiB) Viewed 4219 times
Is this an issue with my code or just faulty device ? Thanks for any help.

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: ESP Easy and Sonoff TH16 - crash every 2 days

#2 Post by grovkillen » 27 Feb 2019, 10:44

You should try to monitor the system memory. Can you perhaps log it to a computer using syslog server?

I use this: http://tftpd32.jounin.net/tftpd32.html

More about logging to syslog server here: viewtopic.php?t=4032
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: ESP Easy and Sonoff TH16 - crash every 2 days

#3 Post by kimot » 28 Feb 2019, 13:52

My Wemos D1 with DS18B20 reboots randomly in hours or days interval too.
So I send configuration periodically from Domoticz, to set correct values after reboot.
_dev13 and v2.0 too.
I have number of them on one power bus and they reboot independently, so I think it is not power issue.

aneo
New user
Posts: 5
Joined: 16 Jan 2019, 15:36

Re: ESP Easy and Sonoff TH16 - crash every 2 days

#4 Post by aneo » 28 Feb 2019, 20:46

Thanks for Reply.
@grovkillen: I will use my RaspPI to collect logs that is actually a good idea. I set up same config on my 2nd TH10 and want to compare the status. So fare both are running 1 day 11 hr.

@kimot: It is an idea as well but was more curious why it is happening. And should I be worried as it now control my heating during winter :) and I dont wish to have a COLD surprises :)

kimot
Normal user
Posts: 190
Joined: 12 Oct 2017, 20:46

Re: ESP Easy and Sonoff TH16 - crash every 2 days

#5 Post by kimot » 28 Feb 2019, 22:25

@aneo

I am using them for el. floor heating too.
I send actual setpoint value, mode of control, outdoor temperature and others every minute from Domoticz to all ESP regulators.
ESP boot with some safe settings and within minute obtain correct values and works.
I am now changing my Wemos nodes to Sonoff Basic with power from mains 230V.
And this power is four times per day switched off by distributor company.
( This electricity is cheaper than the rest of the day. )
So this automatic settings after booting is necessary for me.
2nd winter now without any problem.

User avatar
ThomasB
Normal user
Posts: 1064
Joined: 17 Jun 2018, 20:41
Location: USA

Re: ESP Easy and Sonoff TH16 - crash every 2 days

#6 Post by ThomasB » 01 Mar 2019, 03:51

Random reboots have been an ongoing issue since Spring 2018. The ESP Easy developers are aware of the problem. But a solution has been elusive.

I am having good results with a test Sonoff running build ESP_Easy_mega-20181207_normal_core_241_ESP8266_1024.bin. About 32 days since last crash/reboot. See screen shot.

System Info Screen Shot
System Info Screen Shot
sonoff_espez.jpg (131.98 KiB) Viewed 4164 times

- Thomas

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 20 guests