Hi,I have big problems with an AC-dimming project using Blynk to dim.
Error is the ESP2866 crash and do not restart.
I have hardware working very well for about 15-20 minutes, then it crach.
I have made a very simple (cut & past from other projects), it seems working god.
My question is, why does the ESP crash. FYI, I do not change value for dimming, it’s fixed.
Is there a way to restart ESP after crach?
CODE BELOW
#include <BlynkSimpleEsp8266.h>
int dim = 128;
volatile int dimming = 128; // Dimming level (0-128) 0 = ON, 128 = OFF
volatile int dimTime;
char auth[] = "";
char ssid[] = "";
char pass[] = "";
void setup()
{
Serial.begin(115200);
Blynk.begin(auth, ssid, pass);
delay(10);
pinMode(13, OUTPUT); // Set AC Load pin as output
attachInterrupt(12, zero_crosss_int, RISING); // Choose the zero cross interrupt # from the table above
ESP.wdtDisable();
ESP.wdtEnable(WDTO_8S);
Blynk.syncAll();
}
// *******************************************************************************************
BLYNK_WRITE(V1) // button
{
dim = param.asInt();
dimming = dim;
}
// *******************************************************************************************
void zero_crosss_int() //function to be fired at the zero crossing to dim the light
{
dimTime = (75*dimming); // Value set for 50Hz
delayMicroseconds(dimTime); // Wait till firing the TRIAC
digitalWrite(13, HIGH); // Fire the TRIAC
delayMicroseconds(10); // triac On propogation delay
digitalWrite(13, LOW); // No longer trigger the TRIAC (the next zero crossing will swith it off) TRIAC
}
// *******************************************************************************************
void loop()
{
if(Blynk.connected()) // Check if still connected
{
Blynk.run();
}
ESP.wdtFeed();
}
------------------------------------------------- ESP8266 - ERROR ----------------------------------------
Exception (0):
epc1=0x4020210c epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
ctx: sys
sp: 3ffffc60 end: 3fffffb0 offset: 01a0
>>>stack>>>
3ffffe00: 40106b58 0002b9c4 0000a8c0 402265e4
3ffffe10: ffffffff 00000020 3ffed5c8 401024ec
3ffffe20: 3fff0ab0 3fff0aac 00000080 00000022
3ffffe30: 3fffc200 40106b20 3fffc258 4000050c
3ffffe40: 4000437d 00000030 00000019 ffffffff
3ffffe50: 60000200 00000008 00f8ffff 80000000
3ffffe60: 20000000 3fff0f30 80000000 2007c020
3ffffe70: 80000000 3fffc6fc 00000001 3fff0f34
3ffffe80: 000002d4 0007c020 3ffed4d0 00000030
3ffffe90: 3fff0aac 3fff0ab0 00000006 00000001
3ffffea0: 00000000 cd1a0000 3fff0aac 3fff0d88
3ffffeb0: 3fff0ab0 3fff0d2c 3fff0aac 40223f49
3ffffec0: 40000f3d 00000023 00000000 fffffffc
3ffffed0: 00000000 000048b7 3fff0aac 40223ffa
3ffffee0: 000048b7 3fffc6fc 00000001 3fffdab0
3ffffef0: 00000000 3fffdad0 3ffeebb0 00000004
3fffff00: 402248c4 00000000 0000007d 401004d8
3fffff10: 3ffeead0 00000015 00000015 401070d4
3fffff20: 3fff00e4 3fff00e0 08d5ea09 40224825
3fffff30: 00000000 400042db 08d5ea09 3ffed4d0
3fffff40: 40004b31 3fff0f14 000002f4 0007c000
3fffff50: 4010569e 00000000 3ffed3e0 40107118
3fffff60: 40208961 3ffed3e0 00000000 3fffdc00
3fffff70: 3fff0f14 00001000 40208df6 00000002
3fffff80: 4021a5ca 3fffdab0 40209ff7 3fffdab0
3fffff90: 00000000 3fffdab0 3ffeebb0 40203ff7
3fffffa0: 40000f49 40000f49 3fffdab0 40000f49
<<<stack<<<
ets Jan 8 2013,rst cause:2, boot mode:(1,7)
ets Jan 8 2013,rst cause:4, boot mode:(1,7)
wdt reset