OTA: take the package from the latest meshcore-tth release by itself
build / ci-image (push) Successful in 12m58s
build / build (push) Successful in 11m54s

With no file chosen, the node's target (`fw ver`) and image (`fw status`
/ `fw base`) pick the delta from manifest.json of the latest public
release on git.rfa.cz; it is checked against SHA256SUMS (the node checks
the manifest signature itself). Choosing .mcfw files stays for own
builds.

Bench 16. 11. 2026: a node on v1.18.0+tth.20261115.2 got the delta to
20261116 found and downloaded by the app, over the side channel.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
tthandClaude Opus 5.5 committed 2026-11-16 23:45:48 +01:00
1 parent 1b2e0ccdfc
commit 5edb1f3ab7
4 files changed
+260 -9

No files matched your search

+36 -1
View File
@@ -27,6 +27,7 @@ import '../../connector/meshcore_protocol.dart';
import '../../models/contact.dart';
import '../repeater_command_service.dart';
import 'ota_protocol.dart';
import 'ota_release.dart';
class OtaError implements Exception {
OtaError(this.message);
@@ -66,6 +67,7 @@ class OtaTransfer {
this.window = 15,
this.apply = true,
this.applyWait = const Duration(seconds: 60),
this.release,
}) : _bucket = OtaBucket(duty);
final MeshCoreConnector connector;
@@ -81,6 +83,10 @@ class OtaTransfer {
final bool apply;
final Duration applyWait;
/// Where the package comes from when [packages] is empty (default: the
/// latest public release).
final OtaRelease? release;
final OtaBucket _bucket;
late final RepeaterCommandService _cli = RepeaterCommandService(connector);
StreamSubscription<Uint8List>? _frames;
@@ -544,7 +550,36 @@ class OtaTransfer {
log('no base image: not an -ota build');
return OtaResult(OtaState.noPackage, airtime: airtime);
}
final pick = otaPick(packages, base);
var pkgs = packages;
if (pkgs.isEmpty) {
final target = otaParseTarget(await _ask('fw ver'));
if (target == null) {
log('`fw ver` names no target: not an -ota build');
return OtaResult(OtaState.noPackage, airtime: airtime);
}
log('looking for $target from $base in the latest release');
final OtaReleaseMatch m;
try {
m = await (release ?? OtaRelease()).find(target, base);
} on OtaReleaseError catch (e) {
throw OtaError('release: $e');
} catch (e) {
throw OtaError('release: cannot download ($e)');
}
if (m.current) {
log('the node already runs ${m.tag}');
return OtaResult(OtaState.current, airtime: airtime);
}
if (m.package == null) {
log(
'${m.tag} has no delta from $base (too old: a full image over USB/BLE)',
);
return OtaResult(OtaState.noPackage, airtime: airtime);
}
log('${m.tag}: ${m.package!.name}, sha256 ok');
pkgs = [m.package!];
}
final pick = otaPick(pkgs, base);
if (pick.kind == OtaPickKind.current) {
log('the node already runs ${pick.package!.name}');
return OtaResult(