Conversation
Quency-D
commented
Jan 22, 2026
- It has already been tested on heltec-mesh-solar and heltec-v4.
- The newly added watchdog module does not conflict with the existing meshsolar.
Merge dev branch
|
Found this from here: http://community.heltec.cn/t/heltec-meshtower-resets-its-configuration-itself/20570/36?u=brikots |
weebl2000
left a comment
There was a problem hiding this comment.
A few suggestions — the main one is a units mismatch (ms vs seconds) in the repeater sleep guard.
|
@weebl2000 Thank you for your suggestions. All have been revised. |
|
Please refactor all instances of E.g:
|
|
@Quency-D addressed the review comments and opened a PR to your branch Quency-D#4 |
Address review comments
|
@liamcottle addressed the comments, variables are clearly named now! |
Thank you for your contribution; the connection has been merged. |
|
ESP32 has various watchdogs. |
An external watchdog is more reliable than an internal one. It operates independently, providing an extra layer of protection. |
| return true; | ||
| } | ||
| void SolarExternalWatchdog::loop() { | ||
| if (millis() > next_feed_watchdog) { |
There was a problem hiding this comment.
Just wondering about doing the 2's complement trick here? So that the 49-day glitch doesn't happen.
There was a problem hiding this comment.
This is indeed a problem; let me think of a good solution.
There was a problem hiding this comment.
Just see Dispatcher::millisHasNowPassed() for reference. Usually, you just keep a last (ie in the past) timestamp, and compare to millis() for some duration value. Rather than holding a future timestamp
|
@Quency-D What are the real usecases or problems this watchdog is trying to address / fix? |
Outdoor solar energy equipment can guarantee continuous normal operation. |
| } | ||
| } | ||
|
|
||
| unsigned long SolarExternalWatchdog::getIntervalMs() const { |
There was a problem hiding this comment.
If I'm reading this right, this is the remaining time left until next feed() ?
Or should this be whatever the fixed interval is?
There was a problem hiding this comment.
This is the time remaining until the next feed(), not a fixed time interval.
| return true; | ||
| } | ||
| void SolarExternalWatchdog::loop() { | ||
| if (millis() > next_feed_watchdog) { |
There was a problem hiding this comment.
Just see Dispatcher::millisHasNowPassed() for reference. Usually, you just keep a last (ie in the past) timestamp, and compare to millis() for some duration value. Rather than holding a future timestamp
| void SolarExternalWatchdog::loop() { | ||
| if (millis() > next_feed_watchdog) { | ||
| feed(); | ||
| next_feed_watchdog = millis() + EXTERNAL_WATCHDOG_TIMEOUT_MS; |
There was a problem hiding this comment.
I don't know the specifics of the Mesh Solar's watchdog timer, but does it just have a default timeout of some known value? And is the EXTERNAL_WATCHDOG_TIMEOUT_MS some safe interval INSIDE this default timeout interval? (ie. you don't want to two to be exactly the same, as there will be slight delays until feed() will be called)
There was a problem hiding this comment.
The hardware is configured to run for about 10 minutes, while the code is configured for 8 minutes, leaving a 2-minute margin, which should be more than enough.
Hi @ripplebiz, I made some changes. I'm now using the last feeding time as the criterion instead of a future time. I'm not sure if my understanding is correct. |