Compare commits

...

6 Commits

Author SHA1 Message Date
faragher
55a5bdb0bd
Merge 2f0199a739 into a5783da407 2023-12-31 07:15:21 -07:00
markqvist
a5783da407
Merge pull request #416 from jooray/patch-2
Fix typo
2023-12-31 12:24:48 +01:00
Juraj Bednar
bec3cee425
Fix typo 2023-12-30 23:47:51 +01:00
faragher
2f0199a739
Interim fix for old versions - fixed 2023-12-04 12:43:58 -06:00
faragher
3e9449c728
Delete rnodeconf.py 2023-12-04 12:42:38 -06:00
faragher
4e2c151f2a
Interim fix for old versions
This does not pull the hash from unsigned.io due to a bug in the firmware server.
2023-12-04 03:15:55 -06:00
2 changed files with 30 additions and 1 deletions

View File

@ -109,7 +109,7 @@ class RNodeInterface(Interface):
def __init__(self, owner, name, port, frequency = None, bandwidth = None, txpower = None, sf = None, cr = None, flow_control = False, id_interval = None, id_callsign = None, st_alock = None, lt_alock = None): def __init__(self, owner, name, port, frequency = None, bandwidth = None, txpower = None, sf = None, cr = None, flow_control = False, id_interval = None, id_callsign = None, st_alock = None, lt_alock = None):
if RNS.vendor.platformutils.is_android(): if RNS.vendor.platformutils.is_android():
raise SystemError("Invlaid interface type. The Android-specific RNode interface must be used on Android") raise SystemError("Invalid interface type. The Android-specific RNode interface must be used on Android")
import importlib import importlib
if importlib.util.find_spec('serial') != None: if importlib.util.find_spec('serial') != None:

View File

@ -1045,6 +1045,35 @@ def ensure_firmware_file(fw_filename):
try: try:
if selected_hash == None: if selected_hash == None:
if not os.path.isfile(UPD_DIR+"/"+selected_version+"/"+fw_filename+".version"):
RNS.log("No hash file found for "+fw_filename+" version "+selected_version)
if not upd_nocheck:
try:
RNS.log("Retrieving hash...")
selected_firmware_version_url = "broken" #"https://unsigned.io/firmware/latest/?v="+selected_version+"&variant="+fw_filename
fallback_selected_version_url = "https://github.com/markqvist/rnode_firmware/releases/download/"+selected_version+"/release.json"
urlretrieve(selected_firmware_version_url, UPD_DIR+"/"+selected_version+"/"+fw_filename+".version")
except Exception as e:
RNS.log("")
RNS.log("WARNING!")
RNS.log("Failed to retrieve latest version hash for your board from the default server")
RNS.log("Will retry using the following fallback URL: "+fallback_selected_version_url)
RNS.log("This is currently expected.")
RNS.log("")
RNS.log("Hit enter if you want to proceed")
input()
try:
urlretrieve(fallback_selected_version_url, UPD_DIR+"/fallback_release_info.json")
import json
with open(UPD_DIR+"/fallback_release_info.json", "rb") as rif:
rdat = json.loads(rif.read())
variant = rdat[fw_filename]
with open(UPD_DIR+"/"+selected_version+"/"+fw_filename+".version", "wb") as verf:
inf_str = str(variant["version"])+" "+str(variant["hash"])
verf.write(inf_str.encode("utf-8"))
except Exception as e:
RNS.log("Error while trying fallback URL: "+str(e))
raise e
try: try:
file = open(UPD_DIR+"/"+selected_version+"/"+fw_filename+".version", "rb") file = open(UPD_DIR+"/"+selected_version+"/"+fw_filename+".version", "rb")
release_info = file.read().decode("utf-8").strip() release_info = file.read().decode("utf-8").strip()