From 18fdc85cfae366d190a6149649cc6a595a49031e Mon Sep 17 00:00:00 2001 From: thetechprepper Date: Thu, 2 Jul 2026 13:38:07 -0700 Subject: [PATCH] reticulum - Added support for flashing the RNode firmware on a Heltec v4 offline --- REGRESSION.md | 3 +- scripts/install-offline-rnode-firmware.json | 9 ++++ scripts/install-offline-rnode-firmware.sh | 50 +++++++++++++++++++++ scripts/install.sh | 1 + 4 files changed, 62 insertions(+), 1 deletion(-) create mode 100644 scripts/install-offline-rnode-firmware.json create mode 100755 scripts/install-offline-rnode-firmware.sh diff --git a/REGRESSION.md b/REGRESSION.md index 275a71a..3e9e72e 100644 --- a/REGRESSION.md +++ b/REGRESSION.md @@ -140,7 +140,8 @@ ## LoRa * [ ] LoRa listed in Conky -* [ ] Heltec v4 PnP +* [ ] Heltec v4 PnP (/dev/et-lora) + * [ ] Offline firmware: rnodeconf --autoinstall --nocheck --fw-version 1.86 * [ ] et-reticulum * [ ] All blueprints * [ ] All permutations of radios and LoRa connected/disconnected diff --git a/scripts/install-offline-rnode-firmware.json b/scripts/install-offline-rnode-firmware.json new file mode 100644 index 0000000..e53135c --- /dev/null +++ b/scripts/install-offline-rnode-firmware.json @@ -0,0 +1,9 @@ +[ + { + "url": "https://github.com/markqvist/RNode_Firmware/releases/download/1.86/rnode_firmware_heltec32v4pa.zip", + "file": "rnode_firmware_heltec32v4pa.zip", + "dir": "update/1.86", + "version": "1.86", + "hash": "75ed47d6a4259e9d073cda680b7323eda420659e117ca4ce42c119b2c9513805" + } +] diff --git a/scripts/install-offline-rnode-firmware.sh b/scripts/install-offline-rnode-firmware.sh new file mode 100755 index 0000000..952b99c --- /dev/null +++ b/scripts/install-offline-rnode-firmware.sh @@ -0,0 +1,50 @@ +#!/bin/bash +# Author : Gaston Gonzalez +# Date : 2 July 2026 +# Purpose : Cache supported RNode firmware for offline installs using: +# +# rnodeconf --autoinstall --nocheck --fw-version VERSION +# +# Here are the supported devices and the command to install the firmware +# offline. +# +# Heltec LoRa32 v4 +# $ rnodeconf --autoinstall --nocheck --fw-version 1.86 + +set -e +trap 'last_command=$current_command; current_command=$BASH_COMMAND' DEBUG +trap 'et-log "\"${last_command}\" command failed with exit code $?."' ERR + +. ./env.sh +. ../overlay/opt/emcomm-tools/bin/et-common + +et-log "Installing offline RNode firmware..." + +OFFLINE_FILES_JSON="install-offline-rnode-firmware.json" +OFFLINE_SAVE_DIR="/etc/skel/.config/rnodeconf" +OFFLINE_UPDATE_DIR="/etc/skel/.config/rnodeconf/update" + +[[ ! -e "${OFFLINE_SAVE_DIR}" ]] && mkdir -v -p ${OFFLINE_SAVE_DIR} + +jq -c '.[]' "${OFFLINE_FILES_JSON}" | while read -r item; do + URL=$(echo "$item" | jq -r '.url') + FILE=$(echo "$item" | jq -r '.file') + DIR=$(echo "$item" | jq -r '.dir') + VERSION=$(echo "$item" | jq -r '.version') + HASH=$(echo "$item" | jq -r '.hash') + ABS_DIR="${OFFLINE_SAVE_DIR}/${DIR}" + + # 1. Create missing directories + mkdir -v -p "${ABS_DIR}" + + # 2. Download resources + download_with_retries ${URL} ${FILE} + + # 3. Move to offline folder + mv "${FILE}" "${ABS_DIR}/" + + # 4. Create version file + VERSION_FILE="${OFFLINE_UPDATE_DIR}/${VERSION}/${FILE}.version" + et-log "Creating firmware version file: ${VERSION_FILE}" + echo "${VERSION} ${HASH}" > ${VERSION_FILE} +done diff --git a/scripts/install.sh b/scripts/install.sh index bca2c0a..d655754 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -122,6 +122,7 @@ exitIfNotRoot ./install-reticulum.sh ./install-meshchat.sh ./install-modem73.sh +./install-offline-rnode-firmware.sh # Debrand Ubuntu ./debrand.sh