mirror of
https://github.com/markqvist/Reticulum.git
synced 2024-11-26 15:30:18 +00:00
Compare commits
6 Commits
49a8d2ef41
...
55a5bdb0bd
Author | SHA1 | Date | |
---|---|---|---|
|
55a5bdb0bd | ||
|
a5783da407 | ||
|
bec3cee425 | ||
|
2f0199a739 | ||
|
3e9449c728 | ||
|
4e2c151f2a |
@ -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:
|
||||||
|
@ -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()
|
||||||
|
Loading…
Reference in New Issue
Block a user