Generalize firmware picker across hardware roles
This commit is contained in:
1 parent
003738766c
commit
7f37bd72e4
4 files changed
+1015
-399
No files matched your search
+700
-238
File diff suppressed because it is too large.
Load diff
@@ -25,6 +25,11 @@
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.firmware-picker-intro [data-role="release-set"] {
|
||||
margin-top: 0.25rem;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.firmware-picker-form {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
|
||||
@@ -75,6 +80,21 @@
|
||||
margin-top: 0.2rem;
|
||||
}
|
||||
|
||||
.firmware-picker-card {
|
||||
padding: 0.75rem 0 0.25rem;
|
||||
}
|
||||
|
||||
.firmware-picker-card + .firmware-picker-card {
|
||||
border-top: 1px solid var(--picker-border);
|
||||
margin-top: 1rem;
|
||||
padding-top: 1.25rem;
|
||||
}
|
||||
|
||||
.firmware-picker-card h3 {
|
||||
margin: 0 0 0.7rem;
|
||||
overflow-wrap: anywhere;
|
||||
}
|
||||
|
||||
.firmware-picker-facts {
|
||||
display: grid;
|
||||
grid-template-columns: minmax(7rem, auto) 1fr;
|
||||
|
||||
+120
-94
@@ -1,148 +1,174 @@
|
||||
# Firmware picker
|
||||
|
||||
Choose what the board will do, then let the picker reduce the release assets
|
||||
to one recommended firmware. The first guided board is Station G2 because its
|
||||
standard, logging, FULL, LoRa-OTA, MQTT, bridge, room-server, and Companion
|
||||
profiles are easy to confuse.
|
||||
Choose the exact hardware first. The remaining menus then show only firmware
|
||||
roles and features that were actually built for that hardware in the current
|
||||
release set.
|
||||
|
||||
The picker reads public release metadata from GitHub. It does not upload any
|
||||
device information.
|
||||
The picker reads public release metadata from GitHub. It does not upload device
|
||||
information. Hardware names, target names, and download links come directly
|
||||
from the published firmware assets.
|
||||
|
||||
<div class="firmware-picker" data-firmware-picker data-release-repo="mikecarper/MeshCore">
|
||||
<div class="firmware-picker-intro" role="note">
|
||||
<strong>Station G2 shortcut</strong>
|
||||
<strong>Current release set</strong>
|
||||
<p data-role="release-set">Loading release information...</p>
|
||||
<p>
|
||||
If the G2 normally stays connected to a computer and you want USB packet
|
||||
logs, choose <strong>USB logging repeater</strong>. The recommended image
|
||||
is the expanded <strong>FULL logging</strong> profile. The smaller legacy
|
||||
logging image is mainly a compatibility fallback, not the normal choice
|
||||
for a computer-powered logger.
|
||||
For a new installation, choose the exact board and role, prefer a
|
||||
<strong>FULL / complete profile</strong> when it is available, and select
|
||||
<strong>USB first install / recovery</strong>. Narrower profiles remain
|
||||
available when their reduced transport or feature set is intentional.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form class="firmware-picker-form" data-role="form">
|
||||
<label>
|
||||
Release channel
|
||||
<select data-field="channel">
|
||||
<option value="development" selected>Current development and pre-releases</option>
|
||||
<option value="stable">Stable releases</option>
|
||||
1. Hardware
|
||||
<select data-field="hardware" disabled>
|
||||
<option value="">Loading hardware...</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
What should the Station G2 do?
|
||||
<select data-field="purpose">
|
||||
<option value="usb-logging">USB logging repeater - recommended when connected to a computer</option>
|
||||
<option value="field">Simple standalone repeater</option>
|
||||
<option value="field-ota">Standalone repeater with LoRa/WiFi OTA, no external sensors</option>
|
||||
<option value="mqtt">Full MQTT observer/repeater</option>
|
||||
<option value="espnow">ESP-NOW bridge repeater</option>
|
||||
<option value="room">Room server</option>
|
||||
<option value="room-mqtt">Full MQTT room observer</option>
|
||||
<option value="companion-usb">USB Companion</option>
|
||||
<option value="companion-ble">Bluetooth Companion</option>
|
||||
<option value="companion-wifi">WiFi Companion</option>
|
||||
<option value="companion-full">Full Companion and LoRa-OTA source</option>
|
||||
2. Firmware role
|
||||
<select data-field="role" disabled>
|
||||
<option value="">Choose hardware first</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
How will this firmware be installed?
|
||||
<select data-field="install">
|
||||
<option value="first">First install, recovery, or changing partition/profile - USB cable</option>
|
||||
<option value="wifi">Same profile and partition - browser/WiFi OTA</option>
|
||||
<option value="lora">Same profile and partition - LoRa OTA</option>
|
||||
3. Logging / MQTT
|
||||
<select data-field="logging" disabled>
|
||||
<option value="">Choose role first</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
4. OTA capability
|
||||
<select data-field="ota" disabled>
|
||||
<option value="">Choose earlier options first</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
5. Connection / bridge mode
|
||||
<select data-field="mode" disabled>
|
||||
<option value="">Choose earlier options first</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
6. Feature profile
|
||||
<select data-field="feature" disabled>
|
||||
<option value="">Choose earlier options first</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
7. Hardware/profile variant
|
||||
<select data-field="variant" disabled>
|
||||
<option value="">Choose earlier options first</option>
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label>
|
||||
8. Installation method
|
||||
<select data-field="install" disabled>
|
||||
<option value="">Choose firmware options first</option>
|
||||
</select>
|
||||
</label>
|
||||
</form>
|
||||
|
||||
<div class="firmware-picker-status" data-role="status" aria-live="polite">
|
||||
Loading release catalog...
|
||||
Loading the current firmware catalog...
|
||||
</div>
|
||||
|
||||
<section class="firmware-picker-result" data-role="result" aria-live="polite" hidden>
|
||||
<p class="firmware-picker-eyebrow">Recommended firmware</p>
|
||||
<h2 data-role="result-title"></h2>
|
||||
<p data-role="result-summary"></p>
|
||||
<dl class="firmware-picker-facts" data-role="result-facts"></dl>
|
||||
<div class="firmware-picker-actions">
|
||||
<a class="firmware-picker-primary" data-role="download" href="#">Download recommended file</a>
|
||||
<a data-role="release" href="#">Open its release</a>
|
||||
</div>
|
||||
<div class="firmware-picker-steps" data-role="steps"></div>
|
||||
<p class="firmware-picker-eyebrow">Exact firmware match</p>
|
||||
<h2>Recommended download</h2>
|
||||
<div data-role="result-list"></div>
|
||||
</section>
|
||||
|
||||
<section class="firmware-picker-missing" data-role="missing" aria-live="polite" hidden>
|
||||
<h2>The matching asset is not in this release channel yet</h2>
|
||||
<h2>No exact firmware matched</h2>
|
||||
<p data-role="missing-text"></p>
|
||||
<a href="https://github.com/mikecarper/MeshCore/releases">Browse all firmware releases</a>
|
||||
</section>
|
||||
|
||||
<details class="firmware-asset-browser">
|
||||
<summary>Advanced: search all recent release filenames</summary>
|
||||
<summary>Advanced: search current release filenames</summary>
|
||||
<p>
|
||||
This search is for uncommon hardware variants and expert recovery. A
|
||||
filename match is not a board-identity check.
|
||||
Use this for uncommon board suffixes or expert recovery. A filename match
|
||||
is not a board-identity check.
|
||||
</p>
|
||||
<label>
|
||||
Filename contains
|
||||
<input data-field="asset-search" placeholder="Station_G2, heltec_v4, repeater, ...">
|
||||
<input data-field="asset-search" placeholder="Station_G2, heltec_v4, RAK_4631, ...">
|
||||
</label>
|
||||
<div data-role="asset-results"></div>
|
||||
</details>
|
||||
</div>
|
||||
|
||||
## What FULL means for a USB logger
|
||||
## What the choices mean
|
||||
|
||||
A Station G2 that is powered from and monitored by a computer normally should
|
||||
use the FULL logging profile:
|
||||
| Choice | Use |
|
||||
| --- | --- |
|
||||
| Companion | A phone, computer, or host application controls the radio |
|
||||
| Repeater | Standalone mesh relay |
|
||||
| Room Server | Hosts room conversations and history |
|
||||
| Sensor / telemetry | Publishes supported sensor data |
|
||||
| Terminal Chat | Standalone serial-terminal interface |
|
||||
| USB logging / USB-connected MQTT | Node remains attached to a computer over a data-capable USB cable |
|
||||
| Wi-Fi MQTT observer | Firmware connects directly to MQTT over Wi-Fi; this is not USB logging |
|
||||
| No logging | Normal standalone operation without the dedicated logging/MQTT profile |
|
||||
| LoRa OTA receiver | Repeater profile that can stage an exact matching update received over LoRa |
|
||||
| LoRa OTA source | Full Companion serving a host-supplied update to another node |
|
||||
| OTA-enabled profile | Build uses an OTA-capable application/partition profile, but is not necessarily an explicit LoRa receiver |
|
||||
|
||||
1. Save its name, radio settings, keys, and other configuration.
|
||||
2. Download the exact Station G2 `full-logging-ota` merged image recommended
|
||||
above.
|
||||
3. Flash that `-merged.bin` over USB once. It installs the expanded partition
|
||||
table as well as the application.
|
||||
4. Reconnect the serial terminal at 115200 baud and restore any settings that
|
||||
were not retained.
|
||||
5. Leave the data-capable USB connection attached to collect logs. Use
|
||||
`set usb.logging off` temporarily if the runtime output needs to be quiet.
|
||||
Connection and bridge choices depend on the selected role. Companion firmware
|
||||
may offer Full, Bluetooth, USB, Wi-Fi, serial, or Ethernet transports.
|
||||
Repeaters may offer standard, ESP-NOW bridge, RS-232 bridge, Ethernet, or MQTT
|
||||
observer modes.
|
||||
|
||||
Choose the standalone or lean OTA repeater instead when the board is normally
|
||||
battery/solar powered, has no computer collecting USB output, or must retain a
|
||||
known legacy partition layout.
|
||||
## FULL versus standard
|
||||
|
||||
## Can a Heltec V4 partition be expanded by OTA?
|
||||
For a new installation, use the FULL / complete profile when it exists and the
|
||||
board has enough flash. FULL profiles keep the complete supported feature set
|
||||
and CLI. Standard profiles remain useful for boards without a FULL build, for
|
||||
an intentionally narrower transport, or when retaining an existing compatible
|
||||
partition layout.
|
||||
|
||||
No. WiFi OTA and LoRa OTA write an application into the inactive application
|
||||
partition. They do not replace the partition table at flash offset `0x8000`.
|
||||
Allowing a running application to move its own active/inactive partitions
|
||||
would risk overwriting the running image, staged image, NVS, or filesystem.
|
||||
Changing between standard and FULL ESP32 layouts requires the exact-board
|
||||
merged image over USB. A running application cannot safely move its own active
|
||||
and inactive partitions.
|
||||
|
||||
The current Heltec V4 definition already uses its 16 MiB flash efficiently:
|
||||
|
||||
| Region | Size |
|
||||
|---|---:|
|
||||
| Application slot A | `0x640000` (6.25 MiB) |
|
||||
| Application slot B | `0x640000` (6.25 MiB) |
|
||||
| SPIFFS | `0x360000` (3.375 MiB) |
|
||||
|
||||
That is much larger than current MeshCore V4 applications. A different layout
|
||||
is possible only as a custom build, and it requires a one-time exact-board
|
||||
merged-image flash over USB. Expanding the app slots further would shrink or
|
||||
remove SPIFFS, or remove the second slot and therefore remove safe OTA.
|
||||
|
||||
After installing a new partition table over USB, later WiFi or LoRa updates
|
||||
must use a non-merged application built for the same board, role, and partition
|
||||
signature. Never use an app-only FULL image to try to migrate a device that is
|
||||
still running another partition layout.
|
||||
|
||||
## Merged versus non-merged files
|
||||
## Installation methods
|
||||
|
||||
| File | Use |
|
||||
|---|---|
|
||||
| `-merged.bin` | First install, recovery, role/profile migration, or partition-table change over USB |
|
||||
| `.bin` without `-merged` | Browser/WiFi application update when the installed partition layout already matches |
|
||||
| `.mota` | LoRa OTA package for the exact target identity and installed partition layout |
|
||||
| --- | --- |
|
||||
| <code>-merged.bin</code> | ESP32 first install, recovery, role migration, or partition-profile change over USB |
|
||||
| Non-merged <code>.bin</code> | Same-board, same-role, same-partition application update |
|
||||
| <code>.zip</code> | Native nRF52 Serial DFU package; it is not an extra archive |
|
||||
| <code>.uf2</code> | UF2 bootloader drag-and-drop installation |
|
||||
| <code>.hex</code> | Full wired programmer or recovery flash |
|
||||
|
||||
When uncertain, back up the configuration and use the exact-board merged image
|
||||
over USB. Do not send a merged image through browser OTA or LoRa OTA.
|
||||
Never send a merged ESP32 image through browser OTA or LoRa OTA. Back up the
|
||||
node configuration and verify every filename suffix before flashing.
|
||||
|
||||
## LoRa OTA and OTAFIX
|
||||
|
||||
An OTA receiver build installs the receiving/staging firmware. A later LoRa
|
||||
update still needs an exact target identity, compatible partition signature,
|
||||
matching radio settings, and the correct update package.
|
||||
|
||||
nRF52 LoRa OTA requires an OTAFIX bootloader built for the exact board. There
|
||||
is no universal bootloader file. Use the
|
||||
[latest stable OTAFIX release](https://github.com/mikecarper/Adafruit_nRF52_Bootloader_OTAFIX/releases/latest)
|
||||
and select the hardware-matched HEX, Serial DFU ZIP, or bootloader-update UF2.
|
||||
|
||||
## Hardware and variant names
|
||||
|
||||
The hardware menu preserves meaningful board suffixes such as display type,
|
||||
radio chip, PA/FEM layout, pin map, and external-flash variant. Later menus
|
||||
expose build variants such as FEM on/off, power saving, serial port, or
|
||||
no-external-sensors when those choices exist. Do not substitute a similarly
|
||||
named target.
|
||||
+175
-67
@@ -3,83 +3,191 @@
|
||||
const assert = require("assert");
|
||||
const picker = require("../docs/_javascript/firmware_picker.js");
|
||||
|
||||
const releases = [
|
||||
{
|
||||
name: "Stable FULL profiles",
|
||||
tag_name: "full-profiles-v1",
|
||||
html_url: "https://github.com/mikecarper/MeshCore/releases/tag/full-profiles-v1",
|
||||
published_at: "2026-08-20T12:00:00Z",
|
||||
prerelease: false,
|
||||
draft: false,
|
||||
assets: [
|
||||
{
|
||||
name: "Station_G2_repeater-full-logging-ota-v1-deadbee-merged.bin",
|
||||
browser_download_url: "https://github.com/mikecarper/MeshCore/releases/download/full-profiles-v1/Station_G2_repeater-full-logging-ota-v1-deadbee-merged.bin",
|
||||
size: 2000000,
|
||||
},
|
||||
{
|
||||
name: "Station_G2_repeater-full-logging-ota-v1-merged.bin",
|
||||
browser_download_url: "https://github.com/mikecarper/MeshCore/releases/download/full-profiles-v1/Station_G2_repeater-full-logging-ota-v1-merged.bin",
|
||||
size: 2000000,
|
||||
},
|
||||
{
|
||||
name: "Station_G2_repeater-full-logging-ota-v1.bin",
|
||||
browser_download_url: "https://github.com/mikecarper/MeshCore/releases/download/full-profiles-v1/Station_G2_repeater-full-logging-ota-v1.bin",
|
||||
size: 1500000,
|
||||
},
|
||||
{
|
||||
name: "Station_G2_companion_radio_full-logging-v1-merged.bin",
|
||||
browser_download_url: "https://github.com/mikecarper/MeshCore/releases/download/full-profiles-v1/Station_G2_companion_radio_full-logging-v1-merged.bin",
|
||||
size: 1800000,
|
||||
},
|
||||
{
|
||||
name: "Station_G2_companion_radio_full-v1-merged.bin",
|
||||
browser_download_url: "https://github.com/mikecarper/MeshCore/releases/download/full-profiles-v1/Station_G2_companion_radio_full-v1-merged.bin",
|
||||
size: 1700000,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
name: "Development FULL profiles",
|
||||
tag_name: "full-profiles-v2-dev",
|
||||
html_url: "https://github.com/mikecarper/MeshCore/releases/tag/full-profiles-v2-dev",
|
||||
published_at: "2026-08-21T12:00:00Z",
|
||||
const family = "v2.0.0-dev-abcd1234";
|
||||
|
||||
function asset(name, size) {
|
||||
return {
|
||||
name: name,
|
||||
browser_download_url:
|
||||
"https://github.com/mikecarper/MeshCore/releases/download/test/" + name,
|
||||
size: size || 1000000,
|
||||
};
|
||||
}
|
||||
|
||||
function release(tag, publishedAt, assets, extra) {
|
||||
return Object.assign({
|
||||
name: tag,
|
||||
tag_name: tag,
|
||||
html_url: "https://github.com/mikecarper/MeshCore/releases/tag/" + tag,
|
||||
published_at: publishedAt,
|
||||
prerelease: true,
|
||||
draft: false,
|
||||
assets: [
|
||||
{
|
||||
name: "Station_G2_repeater-full-logging-ota-v2-merged.bin",
|
||||
browser_download_url: "https://github.com/mikecarper/MeshCore/releases/download/full-profiles-v2-dev/Station_G2_repeater-full-logging-ota-v2-merged.bin",
|
||||
size: 2100000,
|
||||
},
|
||||
],
|
||||
},
|
||||
assets: assets,
|
||||
}, extra || {});
|
||||
}
|
||||
|
||||
const releases = [
|
||||
release(family, "2026-08-23T12:00:06Z", [
|
||||
asset("Station_G2_companion_radio_full-" + family + "-merged.bin"),
|
||||
asset("Station_G2_companion_radio_full-" + family + ".bin"),
|
||||
asset("Heltec_t096_companion_radio_ble_ps_femon-" + family + ".uf2"),
|
||||
asset("Heltec_t096_companion_radio_ble_ps_femon-" + family + ".zip"),
|
||||
]),
|
||||
release("repeater-room-" + family, "2026-08-23T12:00:05Z", [
|
||||
asset("Station_G2_repeater-" + family + "-deadbee-merged.bin"),
|
||||
asset("Station_G2_repeater-" + family + "-deadbee.bin"),
|
||||
asset("Station_G2_repeater-" + family + "-merged.bin"),
|
||||
asset("Station_G2_repeater-" + family + ".bin"),
|
||||
asset("wio-e5-repeater_bridge_rs232-" + family + ".hex"),
|
||||
]),
|
||||
release("utility-" + family, "2026-08-23T12:00:04Z", [
|
||||
asset("RAK_4631_sensor-" + family + ".uf2"),
|
||||
asset("RAK_4631_sensor-" + family + ".zip"),
|
||||
]),
|
||||
release("logging-" + family, "2026-08-23T12:00:03Z", [
|
||||
asset("ProMicro_terminal_chat-logging-" + family + ".uf2"),
|
||||
asset("ProMicro_terminal_chat-logging-" + family + ".zip"),
|
||||
]),
|
||||
release("lora-ota-" + family, "2026-08-23T12:00:02Z", [
|
||||
asset(
|
||||
"Station_G2_repeater_lora_ota_no_external_sensors-ota-" +
|
||||
family + "-merged.bin"
|
||||
),
|
||||
asset(
|
||||
"Station_G2_repeater_lora_ota_no_external_sensors-ota-" +
|
||||
family + ".bin"
|
||||
),
|
||||
]),
|
||||
release("full-profiles-" + family, "2026-08-23T12:00:01Z", [
|
||||
asset(
|
||||
"Station_G2_repeater-full-logging-ota-" + family + "-merged.bin"
|
||||
),
|
||||
asset("Station_G2_repeater-full-logging-ota-" + family + ".bin"),
|
||||
asset(
|
||||
"Station_G2_repeater_observer_mqtt-full-ota-" +
|
||||
family + "-merged.bin"
|
||||
),
|
||||
asset(
|
||||
"Station_G2_repeater_observer_mqtt-full-ota-" + family + ".bin"
|
||||
),
|
||||
]),
|
||||
release(
|
||||
"nrf52-mota-v1.0.0-to-" + family,
|
||||
"2026-08-23T12:00:07Z",
|
||||
[asset("Unrelated_repeater-" + family + ".uf2")]
|
||||
),
|
||||
release("v1.9.9", "2026-08-20T12:00:00Z", [], {
|
||||
prerelease: false,
|
||||
}),
|
||||
];
|
||||
|
||||
const stable = picker.flattenReleases(releases, "stable");
|
||||
const development = picker.flattenReleases(releases, "development");
|
||||
const releaseSet = picker.selectReleaseSet(releases);
|
||||
assert.strictEqual(releaseSet.familyTag, family);
|
||||
assert.strictEqual(releaseSet.releases.length, 6);
|
||||
assert(!releaseSet.releases.some(function (item) {
|
||||
return item.tag_name.startsWith("nrf52-mota-");
|
||||
}));
|
||||
|
||||
assert.strictEqual(stable.length, 5);
|
||||
assert.strictEqual(development.length, 6);
|
||||
assert.strictEqual(picker.wantedSuffix("first"), "-merged.bin");
|
||||
assert.strictEqual(picker.wantedSuffix("wifi"), ".bin");
|
||||
const catalog = picker.buildCatalog(releases);
|
||||
assert.strictEqual(catalog.releaseSet.familyTag, family);
|
||||
assert.strictEqual(catalog.profiles.length, 9);
|
||||
assert.strictEqual(catalog.rows.length, 19);
|
||||
|
||||
function profile(target) {
|
||||
const found = catalog.profiles.find(function (item) {
|
||||
return item.target === target;
|
||||
});
|
||||
assert(found, "missing profile " + target);
|
||||
return found;
|
||||
}
|
||||
|
||||
const companionFull = profile("Station_G2_companion_radio_full");
|
||||
assert.strictEqual(companionFull.hardware, "Station_G2");
|
||||
assert.strictEqual(companionFull.role, "companion");
|
||||
assert.strictEqual(companionFull.mode, "full");
|
||||
assert.strictEqual(companionFull.logging, "none");
|
||||
assert.strictEqual(companionFull.ota, "lora-source");
|
||||
assert.strictEqual(companionFull.feature, "full");
|
||||
assert.strictEqual(companionFull.variant, "default");
|
||||
|
||||
const companionBle = profile("Heltec_t096_companion_radio_ble_ps_femon");
|
||||
assert.strictEqual(companionBle.hardware, "Heltec_t096");
|
||||
assert.strictEqual(companionBle.mode, "ble");
|
||||
assert.strictEqual(companionBle.variant, "ps-femon");
|
||||
assert.strictEqual(
|
||||
picker.selectAsset(stable, "usb-logging", "first").name,
|
||||
"Station_G2_repeater-full-logging-ota-v1-merged.bin"
|
||||
picker.humanizeVariant(companionBle.variant),
|
||||
"Power save FEM on"
|
||||
);
|
||||
|
||||
const fullWifiLogging = picker.parseTargetProfile(
|
||||
"Heltec_v2_companion_radio_wifi-full-logging"
|
||||
);
|
||||
assert.strictEqual(fullWifiLogging.mode, "wifi");
|
||||
assert.strictEqual(fullWifiLogging.logging, "usb");
|
||||
assert.strictEqual(fullWifiLogging.feature, "full");
|
||||
assert.strictEqual(fullWifiLogging.variant, "default");
|
||||
|
||||
const fullUsbLogging = picker.parseTargetProfile(
|
||||
"Meshadventurer_sx1262_companion_radio_usb-full-logging"
|
||||
);
|
||||
assert.strictEqual(fullUsbLogging.mode, "usb");
|
||||
assert.strictEqual(fullUsbLogging.variant, "default");
|
||||
|
||||
const standardRepeater = profile("Station_G2_repeater");
|
||||
assert.strictEqual(standardRepeater.role, "repeater");
|
||||
assert.strictEqual(standardRepeater.logging, "none");
|
||||
assert.strictEqual(standardRepeater.ota, "none");
|
||||
assert.strictEqual(standardRepeater.mode, "standard");
|
||||
assert.strictEqual(standardRepeater.feature, "standard");
|
||||
assert.strictEqual(
|
||||
picker.selectAsset(stable, "usb-logging", "wifi").name,
|
||||
"Station_G2_repeater-full-logging-ota-v1.bin"
|
||||
picker.canonicalAsset(standardRepeater.files, "merged-bin").name,
|
||||
"Station_G2_repeater-" + family + "-merged.bin"
|
||||
);
|
||||
assert.strictEqual(
|
||||
picker.selectAsset(development, "usb-logging", "first").name,
|
||||
"Station_G2_repeater-full-logging-ota-v2-merged.bin"
|
||||
|
||||
const fullLogging = profile("Station_G2_repeater-full-logging");
|
||||
assert.strictEqual(fullLogging.logging, "usb");
|
||||
assert.strictEqual(fullLogging.ota, "ota-enabled");
|
||||
assert.strictEqual(fullLogging.feature, "full");
|
||||
assert.strictEqual(fullLogging.variant, "default");
|
||||
|
||||
const mqtt = profile("Station_G2_repeater_observer_mqtt-full");
|
||||
assert.strictEqual(mqtt.logging, "wifi");
|
||||
assert.strictEqual(mqtt.mode, "mqtt");
|
||||
assert.strictEqual(mqtt.ota, "ota-enabled");
|
||||
|
||||
const lora = profile(
|
||||
"Station_G2_repeater_lora_ota_no_external_sensors"
|
||||
);
|
||||
assert.strictEqual(picker.selectAsset(stable, "field", "first"), null);
|
||||
assert.strictEqual(
|
||||
picker.selectAsset(stable, "companion-full", "first").name,
|
||||
"Station_G2_companion_radio_full-v1-merged.bin"
|
||||
assert.strictEqual(lora.ota, "lora-receiver");
|
||||
assert.strictEqual(lora.variant, "no-external-sensors");
|
||||
|
||||
const wio = profile("wio-e5-repeater_bridge_rs232");
|
||||
assert.strictEqual(wio.hardware, "wio-e5");
|
||||
assert.strictEqual(wio.role, "repeater");
|
||||
assert.strictEqual(wio.mode, "rs232");
|
||||
|
||||
const matches = catalog.profiles.filter(function (item) {
|
||||
return picker.profileMatches(item, {
|
||||
hardware: "Station_G2",
|
||||
role: "repeater",
|
||||
logging: "usb",
|
||||
});
|
||||
});
|
||||
assert.strictEqual(matches.length, 1);
|
||||
assert.strictEqual(matches[0].target, "Station_G2_repeater-full-logging");
|
||||
|
||||
assert.deepStrictEqual(
|
||||
picker.uniqueValues(catalog.profiles, "hardware").sort(),
|
||||
["Heltec_t096", "ProMicro", "RAK_4631", "Station_G2", "wio-e5"].sort()
|
||||
);
|
||||
assert.strictEqual(picker.humanizeHardware("RAK_4631"), "RAK 4631");
|
||||
assert.strictEqual(picker.formatBytes(2097152), "2.00 MiB");
|
||||
assert.strictEqual(
|
||||
picker.parseFirmwareAsset(
|
||||
{ name: "wrong-version.bin", url: "", size: 1 },
|
||||
family
|
||||
),
|
||||
null
|
||||
);
|
||||
|
||||
console.log("firmware picker tests passed");
|
||||
console.log("generalized firmware picker tests passed");
|
||||
Reference in new issue
Block a user