Skip to content

Commit fbc5565

Browse files
authored
fix(release): don't false-abort flash on a resumed subscription; tidy #12 console comments (#93)
check_subscription_log (both ota-release.sh and esp32-release.sh) died when the matter-server log had no fresh '(Re-)Subscription succeeded' line in the last 15m. But the flash gate already re-interviews the node and polls it back to available, and matter-server only marks a node available once its subscription is up -- so availability already asserts the subscription (#64). matter-server sometimes RESUMES a subscription after the re-interview without logging a new line (seen on the 2026-07-23 reject flip), which false-aborted a healthy flash mid-run. Warn instead of die when the line is absent; the primary availability gate still holds. Also refresh the #12 checksum-mismatch counter comments in both diag consoles (esp32 diag_console.cpp + ameba hisense_diag_console.h): the RX checksum verify now REJECTS a mismatch (skips parse + counts a link-miss), so the tally is the count of corrupt 0x66 frames dropped, not the old log-only observation. Bumps firmware/src/version.txt 1.3.23 -> 1.3.24 (ameba console comment lives in firmware/src; CI requires the int to increase). Comment-only for the firmware -- nodes 14/62 stay on 1.3.23, no reflash needed. Assisted-by: AI
1 parent 5837900 commit fbc5565

5 files changed

Lines changed: 33 additions & 15 deletions

File tree

firmware/esp32-matter/main/diag_console.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,11 @@ static int cmd_features(int, char **)
154154
static int cmd_poll(int, char **)
155155
{
156156
LOCK(); HisenseState s = s_snap; bool h = s_have; uint32_t f = s_frames; UNLOCK();
157-
// #12 (log-only): checksum-mismatch tally must stay 0 on real traffic before the RX checksum
158-
// verify is allowed to gate parsing / the link-miss counter. Also surface heap here. The
159-
// counter lives in the driver TU with no lock of its own; a word-sized read is atomic on
160-
// Xtensa, so reading it outside s_mtx is safe (at worst one cycle stale) for a diagnostic.
157+
// #12: the RX checksum verify now REJECTS a mismatch (skips the parse + counts a link-miss),
158+
// so this tally is the count of corrupt 0x66 frames dropped since boot; it should stay at/near
159+
// 0 on a healthy bus. Also surface heap here. The counter lives in the driver TU with no lock
160+
// of its own; a word-sized read is atomic on Xtensa, so reading it outside s_mtx is safe (at
161+
// worst one cycle stale) for a diagnostic.
161162
printf("checksum mismatches: %u | heap free=%u min_free=%u\r\n",
162163
(unsigned) hisense_checksum_mismatch_count(),
163164
(unsigned) esp_get_free_heap_size(), (unsigned) esp_get_minimum_free_heap_size());

firmware/scripts/esp32-release.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,9 +275,17 @@ check_subscription_log() {
275275
[ -n "$line" ] && break
276276
sleep 10
277277
done
278-
[ -n "$line" ] \
279-
|| die "no '(Re-)Subscription succeeded' for node $node in the last 15m of the matter-server log -- subscription is broken (#64, docs/10 §16)"
280-
say " matter-server log confirms: ${line:0:120}"
278+
if [ -n "$line" ]; then
279+
say " matter-server log confirms: ${line:0:120}"
280+
else
281+
# The flash gate already re-interviewed the node and polled it back to available, and
282+
# matter-server only marks a node available once its subscription is up -- so availability IS
283+
# the subscription assertion (#64). matter-server sometimes RESUMES a subscription after the
284+
# re-interview without logging a fresh '(Re-)Subscription succeeded' line (seen on the 2026-07-23
285+
# reject flip), so a missing line here is not proof of a break. Warn, do not die: the primary
286+
# gate already passed, and a false die aborts a healthy flash mid-run.
287+
say " no fresh '(Re-)Subscription succeeded' for node $node in 15m -- availability after re-interview already asserted the subscription (#64); matter-server likely resumed it without a new line. OK."
288+
fi
281289
}
282290
flash() {
283291
load_env

firmware/scripts/ota-release.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -581,9 +581,17 @@ check_subscription_log() {
581581
[ -n "$line" ] && break
582582
sleep 10
583583
done
584-
[ -n "$line" ] \
585-
|| die "no '(Re-)Subscription succeeded' for node $node in the last 15m of the matter-server log -- subscription is broken (#64, docs/10 §16)"
586-
say " matter-server log confirms: ${line:0:120}"
584+
if [ -n "$line" ]; then
585+
say " matter-server log confirms: ${line:0:120}"
586+
else
587+
# The flash gate already re-interviewed the node and polled it back to available, and
588+
# matter-server only marks a node available once its subscription is up -- so availability IS
589+
# the subscription assertion (#64). matter-server sometimes RESUMES a subscription after the
590+
# re-interview without logging a fresh '(Re-)Subscription succeeded' line (seen on the 2026-07-23
591+
# reject flip), so a missing line here is not proof of a break. Warn, do not die: the primary
592+
# gate already passed, and a false die aborts a healthy flash mid-run.
593+
say " no fresh '(Re-)Subscription succeeded' for node $node in 15m -- availability after re-interview already asserted the subscription (#64); matter-server likely resumed it without a new line. OK."
594+
fi
587595
}
588596
flash() {
589597
load_env

firmware/src/sdk-edits/hisense_diag_console.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,11 @@ static void diag_cmd_poll(int sock)
113113
{
114114
char b[HISENSE_DIAG_BUF];
115115

116-
// #12 (log-only, shared driver): the RX checksum-mismatch tally must stay 0 on real traffic
117-
// before the verify is allowed to gate parsing / link-miss. Shown here for parity with the
118-
// ESP32 console; heap watermark is in `sys`. (parse_status already rejects a bad checksum,
119-
// so this is belt-and-suspenders visibility for parse_features/parse_faults.)
116+
// #12 (shared driver): the RX checksum verify now REJECTS a mismatch (skips the parse + counts
117+
// a link-miss), so this tally is the count of corrupt 0x66 frames dropped since boot; it should
118+
// stay at/near 0 on a healthy bus. Shown here for parity with the ESP32 console; heap watermark
119+
// is in `sys`. (parse_status already rejected bad status frames; the reject now also covers
120+
// parse_features/parse_faults.)
120121
snprintf(b, sizeof(b), "checksum mismatches: %u\r\n",
121122
(unsigned) hisense_checksum_mismatch_count());
122123
diag_say(sock, b);

firmware/src/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.23
1+
1.3.24

0 commit comments

Comments
 (0)