The code works mostly... But i get a device reset with a "hardware watchdog" or "exception" error. This only happens when the thermostat is off, and the temperature drops below the minimum threashold. Device will restart and function as normal.
Can anyone spot the error?
var1 - Temperature
var2 - print + error
var3 - tele time snapshot
var4 - publish timer (s)
var5 - power state 1/0
Rule1
ON System#Boot DO backlog mem1 59; mem2 52; var4 60; RuleTimer1 30; Teleperiod 60 ENDON
ON Power1#Boot DO backlog Power 0; var5 0 ENDON
ON tele-DS18B20#Temperature DO backlog var1 %value%; var3 %timestamp% ENDON
ON var1#state>60 DO var2 3 ENDON
ON var1#state<60 DO event chkt=%var1% ENDON ON var2#State DO event prt=%value% ENDON
ON event#prt>1 DO POWER 0 ENDON
ON event#prt=3 DO Publish2 bb/ERROR/geyser {"ER":"High_%var1%"} BREAK
ON event#prt=2 DO Publish2 bb/ERROR/geyser {"ER":"NULL_PR"} BREAK
Rule2
ON event#chkt<%mem2% DO var2 1 ENDON
ON event#chkt>%mem1% DO var2 0 ENDON
ON event#prt<2 DO POWER1 %var2% ENDON
ON Power1#State DO backlog var5 %value%; event pubgsa; event pubpush ENDON
ON Rules#Timer=1 DO backlog event pubgsa; Ruletimer1 %var4% ENDON
Rule3
ON event#pubgs DO Publish2 bb/metrics/geyser/thermo {"POWER":"%var5%"} ENDON
ON event#pubgsa DO Publish2 bb/metrics/geyser/thermo {"Temp":"%var1%","POWER":"%var5%","HiLvl":"%mem1%","LoLvl":"%mem2%","Teletime":"%var3%"} ENDON
ON event#pubpush DO Publish bb/push/geyser/thermo {"Thermo":"%var5%"} ENDON
Any help will be appreciated.
I did an OTA reflash again 6.6.0 with Sonoff.bin, and that seems to fix the issue.
I would suggest to anyone who gets a random Hardware Watchdog reset or Exeption error reset to try reflashing OTA. I suspect the FTDI adaptors barely delivers enough power.
I will in future flash a blank, then Sonoff.bin, get setup on the network and do an OTA before anything. The OTA went flawless with first sonoff-minimal.bin, then Sonoff.bin
Never had an issue with basic R2, I think the bigger pcb on the TH16 is to blame.
FTDI are notorious for bad knock offs. Insufficient power is usually the culprit. The Tasmota wiki installation prerequisites suggest the best adapters for serial flashing.