Skip to content

Commit

Permalink
recover data from cloud upon watchdog
Browse files Browse the repository at this point in the history
  • Loading branch information
ldab committed Mar 17, 2022
1 parent 3435f12 commit 5294f05
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Binary file modified .pio/build/esp8266/firmware.elf
Binary file not shown.
2 changes: 1 addition & 1 deletion platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
default_envs = esp8266

build_flags =
'-D BLYNK_FIRMWARE_VERSION="0.0.5"'
'-D BLYNK_FIRMWARE_VERSION="0.1.0"'
'-D BLYNK_TEMPLATE_ID="TMPLJTjALNq7"'
-D VERBOSE
;-D DEBUG_ESP_PORT=Serial
Expand Down
7 changes: 5 additions & 2 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ BLYNK_CONNECTED()
char resetInfo[32];
sprintf(resetInfo, "%s epc1=0x%08x", resetReason.c_str(), system_get_rst_info()->epc1);
Blynk.logEvent("info", resetInfo);
}
if (!timer.isEnabled(controlTimer)) {
} else if (!timer.isEnabled(controlTimer)) {
Blynk.virtualWrite(V5, 0);
Blynk.virtualWrite(V10, 0);
Blynk.virtualWrite(V7, "Idle 💤");
Expand Down Expand Up @@ -163,6 +162,8 @@ BLYNK_WRITE(V3) { energy = param.asFloat(); }
BLYNK_WRITE(V9) { currentSetpoint = param.asFloat(); }
BLYNK_WRITE(V50) { step = param.asInt(); }

BLYNK_WRITE(V127) { while (true); } // trigger software watchdog

BLYNK_WRITE(V10)
{
for (size_t i = 0; i < sizeof(segments) / sizeof(segments[0]); i++) {
Expand Down Expand Up @@ -578,6 +579,8 @@ void setup()
rtc_info->epc3, rtc_info->excvaddr, rtc_info->depc); // The address of the last crash is printed, which is used to debug garbled output.
errorLog->printf("epc1=0x%08x, epc2=0x%08x, epc3=0x%08x, excvaddr=0x%08x, depc=0x%08x\n", rtc_info->epc1, rtc_info->epc2,
rtc_info->epc3, rtc_info->excvaddr, rtc_info->depc);

Blynk.syncVirtual(V10);
}
}

Expand Down

0 comments on commit 5294f05

Please sign in to comment.