From 6a5afe98d342be4099be3dfc664df60322c6d5b5 Mon Sep 17 00:00:00 2001 From: Nerivec <62446222+Nerivec@users.noreply.github.com> Date: Wed, 1 Jan 2025 19:31:25 +0100 Subject: [PATCH] add recovery firmware --- firmware-links.json | 72 +++++++++++++++++ src/utils/update-firmware-links.ts | 124 ++++++++++++++++++++++++++++- 2 files changed, 194 insertions(+), 2 deletions(-) diff --git a/firmware-links.json b/firmware-links.json index 76a067d..70f37fb 100644 --- a/firmware-links.json +++ b/firmware-links.json @@ -46,5 +46,77 @@ "ROUTER - SparkFun MGM240p": "https://github.com/Nerivec/silabs-firmware-builder/releases/download/v2024.6.2-update4/sparkfun_mgm240p_zigbee_router_8.0.2.0_115200_sw_flow.gbl", "ROUTER - TubeZB MGM24": "https://github.com/Nerivec/silabs-firmware-builder/releases/download/v2024.6.2-update4/tubeszb-mgm24-zigbee_router_8.0.2.0_115200_hw_flow.gbl", "ROUTER - TubeZB MGM24PB": "https://github.com/Nerivec/silabs-firmware-builder/releases/download/v2024.6.2-update4/tubeszb-mgm24PB-zigbee_router_8.0.2.0_115200_hw_flow.gbl" + }, + "nvm3_32768_clear": { + "Aeotec Zi-Stick (ZGA008)": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F1024IM32_nvm3_clear_0_1048576_8192_16384_32768.gbl", + "EasyIOT ZB-GW04 v1.1": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "EasyIOT ZB-GW04 v1.2": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "Nabu Casa SkyConnect": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F512IM32_nvm3_clear_0_524288_8192_16384_32768.gbl", + "SMLight SLZB06-M": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "SMLight SLZB07": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "SMLight SLZB07mg24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG24A020F1024IM40_nvm3_clear_134217728_1048576_8192_134242304_32768.gbl", + "Sonoff ZBDongle-E": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "SparkFun MGM240p": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNA_nvm3_clear_134217728_1572864_8192_134242304_32768.gbl", + "TubeZB MGM24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PA32VNN_nvm3_clear_134217728_1572864_8192_134242304_32768.gbl", + "TubeZB MGM24PB": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNN_nvm3_clear_134217728_1572864_8192_134242304_32768.gbl", + "ROUTER - Aeotec Zi-Stick (ZGA008)": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F1024IM32_nvm3_clear_0_1048576_8192_16384_32768.gbl", + "ROUTER - EasyIOT ZB-GW04 v1.1": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "ROUTER - EasyIOT ZB-GW04 v1.2": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "ROUTER - Nabu Casa SkyConnect": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F512IM32_nvm3_clear_0_524288_8192_16384_32768.gbl", + "ROUTER - SMLight SLZB06-M": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "ROUTER - SMLight SLZB07": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "ROUTER - SMLight SLZB07mg24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG24A020F1024IM40_nvm3_clear_134217728_1048576_8192_134242304_32768.gbl", + "ROUTER - Sonoff ZBDongle-E": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_32768.gbl", + "ROUTER - SparkFun MGM240p": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNA_nvm3_clear_134217728_1572864_8192_134242304_32768.gbl", + "ROUTER - TubeZB MGM24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PA32VNN_nvm3_clear_134217728_1572864_8192_134242304_32768.gbl", + "ROUTER - TubeZB MGM24PB": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNN_nvm3_clear_134217728_1572864_8192_134242304_32768.gbl" + }, + "nvm3_40960_clear": { + "Aeotec Zi-Stick (ZGA008)": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F1024IM32_nvm3_clear_0_1048576_8192_16384_40960.gbl", + "EasyIOT ZB-GW04 v1.1": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "EasyIOT ZB-GW04 v1.2": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "Nabu Casa SkyConnect": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F512IM32_nvm3_clear_0_524288_8192_16384_40960.gbl", + "SMLight SLZB06-M": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "SMLight SLZB07": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "SMLight SLZB07mg24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG24A020F1024IM40_nvm3_clear_134217728_1048576_8192_134242304_40960.gbl", + "Sonoff ZBDongle-E": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "SparkFun MGM240p": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNA_nvm3_clear_134217728_1572864_8192_134242304_40960.gbl", + "TubeZB MGM24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PA32VNN_nvm3_clear_134217728_1572864_8192_134242304_40960.gbl", + "TubeZB MGM24PB": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNN_nvm3_clear_134217728_1572864_8192_134242304_40960.gbl", + "ROUTER - Aeotec Zi-Stick (ZGA008)": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F1024IM32_nvm3_clear_0_1048576_8192_16384_40960.gbl", + "ROUTER - EasyIOT ZB-GW04 v1.1": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "ROUTER - EasyIOT ZB-GW04 v1.2": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "ROUTER - Nabu Casa SkyConnect": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F512IM32_nvm3_clear_0_524288_8192_16384_40960.gbl", + "ROUTER - SMLight SLZB06-M": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "ROUTER - SMLight SLZB07": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "ROUTER - SMLight SLZB07mg24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG24A020F1024IM40_nvm3_clear_134217728_1048576_8192_134242304_40960.gbl", + "ROUTER - Sonoff ZBDongle-E": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_nvm3_clear_0_786432_8192_16384_40960.gbl", + "ROUTER - SparkFun MGM240p": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNA_nvm3_clear_134217728_1572864_8192_134242304_40960.gbl", + "ROUTER - TubeZB MGM24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PA32VNN_nvm3_clear_134217728_1572864_8192_134242304_40960.gbl", + "ROUTER - TubeZB MGM24PB": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNN_nvm3_clear_134217728_1572864_8192_134242304_40960.gbl" + }, + "app_clear": { + "Aeotec Zi-Stick (ZGA008)": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F1024IM32_app_clear_0_1048576_8192_16384.gbl", + "EasyIOT ZB-GW04 v1.1": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "EasyIOT ZB-GW04 v1.2": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "Nabu Casa SkyConnect": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F512IM32_app_clear_0_524288_8192_16384.gbl", + "SMLight SLZB06-M": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "SMLight SLZB07": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "SMLight SLZB07mg24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG24A020F1024IM40_app_clear_134217728_1048576_8192_134242304.gbl", + "Sonoff ZBDongle-E": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "SparkFun MGM240p": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNA_app_clear_134217728_1572864_8192_134242304.gbl", + "TubeZB MGM24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PA32VNN_app_clear_134217728_1572864_8192_134242304.gbl", + "TubeZB MGM24PB": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNN_app_clear_134217728_1572864_8192_134242304.gbl", + "ROUTER - Aeotec Zi-Stick (ZGA008)": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F1024IM32_app_clear_0_1048576_8192_16384.gbl", + "ROUTER - EasyIOT ZB-GW04 v1.1": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "ROUTER - EasyIOT ZB-GW04 v1.2": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "ROUTER - Nabu Casa SkyConnect": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F512IM32_app_clear_0_524288_8192_16384.gbl", + "ROUTER - SMLight SLZB06-M": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "ROUTER - SMLight SLZB07": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "ROUTER - SMLight SLZB07mg24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG24A020F1024IM40_app_clear_134217728_1048576_8192_134242304.gbl", + "ROUTER - Sonoff ZBDongle-E": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/EFR32MG21A020F768IM32_app_clear_0_786432_8192_16384.gbl", + "ROUTER - SparkFun MGM240p": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNA_app_clear_134217728_1572864_8192_134242304.gbl", + "ROUTER - TubeZB MGM24": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PA32VNN_app_clear_134217728_1572864_8192_134242304.gbl", + "ROUTER - TubeZB MGM24PB": "https://github.com/Nerivec/silabs-firmware-recovery/releases/download/v0.0.1/MGM240PB32VNN_app_clear_134217728_1572864_8192_134242304.gbl" } } \ No newline at end of file diff --git a/src/utils/update-firmware-links.ts b/src/utils/update-firmware-links.ts index 2d221d6..18f512e 100644 --- a/src/utils/update-firmware-links.ts +++ b/src/utils/update-firmware-links.ts @@ -11,6 +11,7 @@ const GITHUB_RELEASES_ENDPOINT = `/releases` const NABUCASA_REPO = `NabuCasa/silabs-firmware-builder` const DARKXST_REPO = `darkxst/silabs-firmware-builder` const NERIVEC_REPO = `Nerivec/silabs-firmware-builder` +const NERIVEC_RECOVERY_REPO = `Nerivec/silabs-firmware-recovery` // const TUBE0013_REPO = `tube0013/silabs-firmware-builder` // const FIRMWARE_BOOTLOADER = `bootloader` @@ -20,6 +21,7 @@ const FIRMWARE_ZIGBEE_ROUTER = `zigbee_router` const NABUCASA_RELEASE = await getLatestGithubRelease(NABUCASA_REPO) const DARKXST_RELEASE = await getLatestGithubRelease(DARKXST_REPO) const NERIVEC_RELEASE = await getLatestGithubRelease(NERIVEC_REPO) +const NERIVEC_RECOVERY_RELEASE = await getLatestGithubRelease(NERIVEC_RECOVERY_REPO) // const TUBE0013_REPO = await getLatestGithubRelease(TUBE0013_REPO) async function getLatestGithubRelease(repo: string): Promise { @@ -28,8 +30,9 @@ async function getLatestGithubRelease(repo: string): Promise return response[0] } -function findFirmware(release: GithubReleaseJson, model: string, type: string): string | undefined { - const firmware = release.assets.find((asset) => asset.name.startsWith(model) && asset.name.includes(type)) +function findFirmware(release: GithubReleaseJson, model: string, include: string | string[]): string | undefined { + const includeArr = Array.isArray(include) ? include : [include]; + const firmware = release.assets.find((asset) => asset.name.startsWith(model) && includeArr.every((i) => asset.name.includes(i))) return firmware?.browser_download_url } @@ -169,6 +172,123 @@ const firmwareLinks: Record