Compare commits

...

6 Commits

Author SHA1 Message Date
faragher 017da06499
Merge 2f0199a739 into 841a3daa26 2024-02-10 23:09:46 +01:00
markqvist 841a3daa26
Merge pull request #439 from jacobeva/master
Update min and max values to support SX1280
2024-02-09 22:30:32 +01:00
jacob.eva d98f03f245
Update min and max values to support SX1280 2024-02-09 21:17:58 +00: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 32 additions and 3 deletions

View File

@ -92,7 +92,7 @@ class RNodeInterface(Interface):
MAX_CHUNK = 32768
FREQ_MIN = 137000000
FREQ_MAX = 1020000000
FREQ_MAX = 3000000000
RSSI_OFFSET = 157
@ -194,11 +194,11 @@ class RNodeInterface(Interface):
RNS.log("Invalid TX power configured for "+str(self), RNS.LOG_ERROR)
self.validcfg = False
if (self.bandwidth < 7800 or self.bandwidth > 500000):
if (self.bandwidth < 7800 or self.bandwidth > 1625000):
RNS.log("Invalid bandwidth configured for "+str(self), RNS.LOG_ERROR)
self.validcfg = False
if (self.sf < 7 or self.sf > 12):
if (self.sf < 5 or self.sf > 12):
RNS.log("Invalid spreading factor configured for "+str(self), RNS.LOG_ERROR)
self.validcfg = False

View File

@ -1050,6 +1050,35 @@ def ensure_firmware_file(fw_filename):
try:
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:
file = open(UPD_DIR+"/"+selected_version+"/"+fw_filename+".version", "rb")
release_info = file.read().decode("utf-8").strip()