Compare commits

...

4 Commits

Author SHA1 Message Date
jacobeva
526da2a500
Merge 9a97195b8c into f461a7827b 2024-10-03 20:46:59 -07:00
Mark Qvist
f461a7827b Added T-Deck defines to rnodeconf 2024-10-03 00:52:38 +02:00
Mark Qvist
62091b28b0 Fixed version comparison 2024-10-02 02:54:18 +02:00
jacob.eva
9a97195b8c
Fix interface values not being set on RNodeSubInterface instances 2024-09-20 17:50:34 +01:00
4 changed files with 35 additions and 12 deletions

View File

@ -491,6 +491,9 @@ class RNodeInterface(Interface):
raise IOError("An IO error occurred while configuring radio state for "+str(self)) raise IOError("An IO error occurred while configuring radio state for "+str(self))
def validate_firmware(self): def validate_firmware(self):
if (self.maj_version > RNodeInterface.REQUIRED_FW_VER_MAJ):
self.firmware_ok = True
else:
if (self.maj_version >= RNodeInterface.REQUIRED_FW_VER_MAJ): if (self.maj_version >= RNodeInterface.REQUIRED_FW_VER_MAJ):
if (self.min_version >= RNodeInterface.REQUIRED_FW_VER_MIN): if (self.min_version >= RNodeInterface.REQUIRED_FW_VER_MIN):
self.firmware_ok = True self.firmware_ok = True

View File

@ -249,6 +249,7 @@ class RNodeMultiInterface(Interface):
if (not self.validcfg): if (not self.validcfg):
raise ValueError("The configuration for "+str(self)+" contains errors, interface is offline") raise ValueError("The configuration for "+str(self)+" contains errors, interface is offline")
def start(self):
try: try:
self.open_port() self.open_port()
@ -323,8 +324,8 @@ class RNodeMultiInterface(Interface):
lt_alock=subint[9] lt_alock=subint[9]
) )
interface.OUT = self.OUT interface.OUT = subint[10]
interface.IN = self.IN interface.IN = True
interface.announce_rate_target = self.announce_rate_target interface.announce_rate_target = self.announce_rate_target
interface.mode = self.mode interface.mode = self.mode
@ -1006,6 +1007,11 @@ class RNodeSubInterface(Interface):
self.parent_interface = parent_interface self.parent_interface = parent_interface
self.announce_rate_target = None self.announce_rate_target = None
self.mode = None
self.announce_cap = None
self.bitrate = None
self.ifac_size = None
# add this interface to the subinterfaces array # add this interface to the subinterfaces array
self.parent_interface.subinterfaces[index] = self self.parent_interface.subinterfaces[index] = self

View File

@ -991,7 +991,7 @@ class Reticulum:
enabled_count += 1 enabled_count += 1
# Create an array with a row for each subinterface # Create an array with a row for each subinterface
subint_config = [[0 for x in range(10)] for y in range(enabled_count)] subint_config = [[0 for x in range(11)] for y in range(enabled_count)]
subint_index = 0 subint_index = 0
for subinterface in c: for subinterface in c:
@ -1020,6 +1020,11 @@ class Reticulum:
subint_config[subint_index][8] = st_alock subint_config[subint_index][8] = st_alock
lt_alock = float(subinterface_config["airtime_limit_long"]) if "airtime_limit_long" in subinterface_config else None lt_alock = float(subinterface_config["airtime_limit_long"]) if "airtime_limit_long" in subinterface_config else None
subint_config[subint_index][9] = lt_alock subint_config[subint_index][9] = lt_alock
if "outgoing" in subinterface_config and subinterface_config.as_bool("outgoing") == False:
subint_config[subint_index][10] = False
else:
subint_config[subint_index][10] = True
subint_index += 1 subint_index += 1
# if no subinterfaces are defined # if no subinterfaces are defined
@ -1045,10 +1050,8 @@ class Reticulum:
id_callsign = id_callsign id_callsign = id_callsign
) )
if "outgoing" in c and c.as_bool("outgoing") == False: interface.IN = False
interface.OUT = False interface.OUT = False
else:
interface.OUT = True
interface.mode = interface_mode interface.mode = interface_mode
@ -1099,6 +1102,9 @@ class Reticulum:
RNS.Transport.interfaces.append(interface) RNS.Transport.interfaces.append(interface)
if isinstance(interface, RNS.Interfaces.RNodeMultiInterface.RNodeMultiInterface):
interface.start()
else: else:
RNS.log("Skipping disabled interface \""+name+"\"", RNS.LOG_DEBUG) RNS.log("Skipping disabled interface \""+name+"\"", RNS.LOG_DEBUG)

View File

@ -169,6 +169,10 @@ class ROM():
MODEL_E3 = 0xE3 MODEL_E3 = 0xE3
MODEL_E8 = 0xE8 MODEL_E8 = 0xE8
PRODUCT_TDECK = 0xD0
MODEL_D4 = 0xD4
MODEL_D9 = 0xD9
PRODUCT_RAK4631 = 0x10 PRODUCT_RAK4631 = 0x10
MODEL_11 = 0x11 MODEL_11 = 0x11
MODEL_12 = 0x12 MODEL_12 = 0x12
@ -207,6 +211,7 @@ class ROM():
BOARD_RNODE = 0x31 BOARD_RNODE = 0x31
BOARD_HMBRW = 0x32 BOARD_HMBRW = 0x32
BOARD_TBEAM = 0x33 BOARD_TBEAM = 0x33
BOARD_TDECK = 0x3B
BOARD_HUZZAH32 = 0x34 BOARD_HUZZAH32 = 0x34
BOARD_GENERIC_ESP32 = 0x35 BOARD_GENERIC_ESP32 = 0x35
BOARD_LORA32_V2_0 = 0x36 BOARD_LORA32_V2_0 = 0x36
@ -221,6 +226,7 @@ products = {
ROM.PRODUCT_RNODE: "RNode", ROM.PRODUCT_RNODE: "RNode",
ROM.PRODUCT_HMBRW: "Hombrew RNode", ROM.PRODUCT_HMBRW: "Hombrew RNode",
ROM.PRODUCT_TBEAM: "LilyGO T-Beam", ROM.PRODUCT_TBEAM: "LilyGO T-Beam",
ROM.PRODUCT_TDECK: "LilyGO T-Deck",
ROM.PRODUCT_T32_10: "LilyGO LoRa32 v1.0", ROM.PRODUCT_T32_10: "LilyGO LoRa32 v1.0",
ROM.PRODUCT_T32_20: "LilyGO LoRa32 v2.0", ROM.PRODUCT_T32_20: "LilyGO LoRa32 v2.0",
ROM.PRODUCT_T32_21: "LilyGO LoRa32 v2.1", ROM.PRODUCT_T32_21: "LilyGO LoRa32 v2.1",
@ -267,12 +273,14 @@ models = {
0xCA: [863000000, 928000000, 21, "863 - 928 MHz", "rnode_firmware_heltec32v3.zip", "SX1262"], 0xCA: [863000000, 928000000, 21, "863 - 928 MHz", "rnode_firmware_heltec32v3.zip", "SX1262"],
0xE4: [420000000, 520000000, 17, "420 - 520 MHz", "rnode_firmware_tbeam.zip", "SX1278"], 0xE4: [420000000, 520000000, 17, "420 - 520 MHz", "rnode_firmware_tbeam.zip", "SX1278"],
0xE9: [850000000, 950000000, 17, "850 - 950 MHz", "rnode_firmware_tbeam.zip", "SX1276"], 0xE9: [850000000, 950000000, 17, "850 - 950 MHz", "rnode_firmware_tbeam.zip", "SX1276"],
0xD4: [420000000, 520000000, 22, "420 - 520 MHz", "rnode_firmware_tdeck.zip", "SX1268"],
0xD9: [850000000, 950000000, 22, "850 - 950 MHz", "rnode_firmware_tdeck.zip", "SX1262"],
0xE3: [420000000, 520000000, 22, "420 - 520 MHz", "rnode_firmware_tbeam_sx1262.zip", "SX1268"], 0xE3: [420000000, 520000000, 22, "420 - 520 MHz", "rnode_firmware_tbeam_sx1262.zip", "SX1268"],
0xE8: [850000000, 950000000, 22, "850 - 950 MHz", "rnode_firmware_tbeam_sx1262.zip", "SX1262"], 0xE8: [850000000, 950000000, 22, "850 - 950 MHz", "rnode_firmware_tbeam_sx1262.zip", "SX1262"],
0x11: [430000000, 510000000, 22, "430 - 510 MHz", "rnode_firmware_rak4631.zip", "SX1262"], 0x11: [430000000, 510000000, 22, "430 - 510 MHz", "rnode_firmware_rak4631.zip", "SX1262"],
0x12: [779000000, 928000000, 22, "779 - 928 MHz", "rnode_firmware_rak4631.zip", "SX1262"], 0x12: [779000000, 928000000, 22, "779 - 928 MHz", "rnode_firmware_rak4631.zip", "SX1262"],
0x11: [430000000, 510000000, 22, "430 - 510 MHz", "rnode_firmware_rak4631_sx1280.zip", "SX1262 + SX1280"], 0x13: [430000000, 510000000, 22, "430 - 510 MHz", "rnode_firmware_rak4631_sx1280.zip", "SX1262 + SX1280"],
0x12: [779000000, 928000000, 22, "779 - 928 MHz", "rnode_firmware_rak4631_sx1280.zip", "SX1262 + SX1280"], 0x14: [779000000, 928000000, 22, "779 - 928 MHz", "rnode_firmware_rak4631_sx1280.zip", "SX1262 + SX1280"],
0x16: [779000000, 928000000, 22, "430 - 510 Mhz", "rnode_firmware_techo.zip", "SX1262"], 0x16: [779000000, 928000000, 22, "430 - 510 Mhz", "rnode_firmware_techo.zip", "SX1262"],
0x17: [779000000, 928000000, 22, "779 - 928 Mhz", "rnode_firmware_techo.zip", "SX1262"], 0x17: [779000000, 928000000, 22, "779 - 928 Mhz", "rnode_firmware_techo.zip", "SX1262"],
0x21: [820000000, 960000000, 22, "820 - 960 MHz", "rnode_firmware_opencom_xl.zip", "SX1262 + SX1280"], 0x21: [820000000, 960000000, 22, "820 - 960 MHz", "rnode_firmware_opencom_xl.zip", "SX1262 + SX1280"],