Compare commits

...

6 Commits

Author SHA1 Message Date
thiaguetz
bff99e71ee
Merge 11baace08d into 64f5192c79 2024-04-21 19:15:23 +00:00
Mark Qvist
64f5192c79 Changed rnodeconf autoinstaller menu order 2024-04-20 22:25:57 +02:00
Mark Qvist
d223ebc8c0 Added rnodeconf autoinstaller support for Heltec LoRa32 V3 boards 2024-04-20 22:03:14 +02:00
markqvist
c28f413fe6
Merge pull request #486 from cobraPA/upstream_add_heltec_v3
Add product and model, plus support for Heltec V3 serial only setup to rnodeconf.
2024-04-20 18:54:09 +02:00
Kevin Brosius
92e5f65887 Add product and model, plus support for Heltec V3 serial only setup
to rnodeconf.
2024-04-11 01:41:50 -04:00
Thiaguetz
11baace08d feat: implement multicast address type definition on AutoInterface configuration 2024-03-23 00:54:56 -03:00
5 changed files with 92 additions and 5 deletions

View File

@ -43,6 +43,9 @@ class AutoInterface(Interface):
SCOPE_ORGANISATION = "8" SCOPE_ORGANISATION = "8"
SCOPE_GLOBAL = "e" SCOPE_GLOBAL = "e"
MULTICAST_PERMANENT_ADDRESS_TYPE = "0"
MULTICAST_TEMPORARY_ADDRESS_TYPE = "1"
PEERING_TIMEOUT = 7.5 PEERING_TIMEOUT = 7.5
ALL_IGNORE_IFS = ["lo0"] ALL_IGNORE_IFS = ["lo0"]
@ -74,7 +77,7 @@ class AutoInterface(Interface):
ifas = self.netinfo.ifaddresses(ifname) ifas = self.netinfo.ifaddresses(ifname)
return ifas return ifas
def __init__(self, owner, name, group_id=None, discovery_scope=None, discovery_port=None, data_port=None, allowed_interfaces=None, ignored_interfaces=None, configured_bitrate=None): def __init__(self, owner, name, group_id=None, discovery_scope=None, discovery_port=None, multicast_address_type=None, data_port=None, allowed_interfaces=None, ignored_interfaces=None, configured_bitrate=None):
from RNS.vendor.ifaddr import niwrapper from RNS.vendor.ifaddr import niwrapper
super().__init__() super().__init__()
self.netinfo = niwrapper self.netinfo = niwrapper
@ -128,6 +131,13 @@ class AutoInterface(Interface):
else: else:
self.discovery_port = discovery_port self.discovery_port = discovery_port
if multicast_address_type == None:
self.multicast_address_type = AutoInterface.MULTICAST_TEMPORARY_ADDRESS_TYPE
elif str(multicast_address_type).lower() == "temporary":
self.multicast_address_type = AutoInterface.MULTICAST_TEMPORARY_ADDRESS_TYPE
elif str(multicast_address_type).lower() == "permanent":
self.multicast_address_type = AutoInterface.MULTICAST_PERMANENT_ADDRESS_TYPE
if data_port == None: if data_port == None:
self.data_port = AutoInterface.DEFAULT_DATA_PORT self.data_port = AutoInterface.DEFAULT_DATA_PORT
else: else:
@ -156,7 +166,7 @@ class AutoInterface(Interface):
gt += ":"+"{:02x}".format(g[9]+(g[8]<<8)) gt += ":"+"{:02x}".format(g[9]+(g[8]<<8))
gt += ":"+"{:02x}".format(g[11]+(g[10]<<8)) gt += ":"+"{:02x}".format(g[11]+(g[10]<<8))
gt += ":"+"{:02x}".format(g[13]+(g[12]<<8)) gt += ":"+"{:02x}".format(g[13]+(g[12]<<8))
self.mcast_discovery_address = "ff1"+self.discovery_scope+":"+gt self.mcast_discovery_address = "ff"+self.multicast_address_type+self.discovery_scope+":"+gt
suitable_interfaces = 0 suitable_interfaces = 0
for ifname in self.list_interfaces(): for ifname in self.list_interfaces():

View File

@ -540,6 +540,7 @@ class Reticulum:
group_id = c["group_id"] if "group_id" in c else None group_id = c["group_id"] if "group_id" in c else None
discovery_scope = c["discovery_scope"] if "discovery_scope" in c else None discovery_scope = c["discovery_scope"] if "discovery_scope" in c else None
discovery_port = int(c["discovery_port"]) if "discovery_port" in c else None discovery_port = int(c["discovery_port"]) if "discovery_port" in c else None
multicast_address_type = c["multicast_address_type"] if "multicast_address_type" in c else None
data_port = int(c["data_port"]) if "data_port" in c else None data_port = int(c["data_port"]) if "data_port" in c else None
allowed_interfaces = c.as_list("devices") if "devices" in c else None allowed_interfaces = c.as_list("devices") if "devices" in c else None
ignored_interfaces = c.as_list("ignored_devices") if "ignored_devices" in c else None ignored_interfaces = c.as_list("ignored_devices") if "ignored_devices" in c else None
@ -550,6 +551,7 @@ class Reticulum:
group_id, group_id,
discovery_scope, discovery_scope,
discovery_port, discovery_port,
multicast_address_type,
data_port, data_port,
allowed_interfaces, allowed_interfaces,
ignored_interfaces ignored_interfaces

View File

@ -157,6 +157,10 @@ class ROM():
MODEL_C4 = 0xC4 MODEL_C4 = 0xC4
MODEL_C9 = 0xC9 MODEL_C9 = 0xC9
PRODUCT_H32_V3 = 0xC1
MODEL_C5 = 0xC5
MODEL_CA = 0xCA
PRODUCT_TBEAM = 0xE0 PRODUCT_TBEAM = 0xE0
MODEL_E4 = 0xE4 MODEL_E4 = 0xE4
MODEL_E9 = 0xE9 MODEL_E9 = 0xE9
@ -203,6 +207,7 @@ products = {
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",
ROM.PRODUCT_H32_V2: "Heltec LoRa32 v2", ROM.PRODUCT_H32_V2: "Heltec LoRa32 v2",
ROM.PRODUCT_H32_V3: "Heltec LoRa32 v3",
} }
platforms = { platforms = {
@ -237,6 +242,8 @@ models = {
0xBB: [850000000, 950000000, 17, "850 - 950 MHz", "rnode_firmware_lora32v10.zip", "SX1276"], 0xBB: [850000000, 950000000, 17, "850 - 950 MHz", "rnode_firmware_lora32v10.zip", "SX1276"],
0xC4: [420000000, 520000000, 17, "420 - 520 MHz", "rnode_firmware_heltec32v2.zip", "SX1278"], 0xC4: [420000000, 520000000, 17, "420 - 520 MHz", "rnode_firmware_heltec32v2.zip", "SX1278"],
0xC9: [850000000, 950000000, 17, "850 - 950 MHz", "rnode_firmware_heltec32v2.zip", "SX1276"], 0xC9: [850000000, 950000000, 17, "850 - 950 MHz", "rnode_firmware_heltec32v2.zip", "SX1276"],
0xC5: [470000000, 510000000, 21, "470 - 510 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"],
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"],
@ -1552,7 +1559,8 @@ def main():
print("[5] LilyGO LoRa32 v1.0") print("[5] LilyGO LoRa32 v1.0")
print("[6] LilyGO T-Beam") print("[6] LilyGO T-Beam")
print("[7] Heltec LoRa32 v2") print("[7] Heltec LoRa32 v2")
print("[8] LilyGO LoRa T3S3") print("[8] Heltec LoRa32 v3")
print("[9] LilyGO LoRa T3S3")
print(" .") print(" .")
print(" / \\ Select one of these options if you want to easily turn") print(" / \\ Select one of these options if you want to easily turn")
print(" | a supported development board into an RNode.") print(" | a supported development board into an RNode.")
@ -1564,7 +1572,7 @@ def main():
try: try:
c_dev = int(input()) c_dev = int(input())
c_mod = False c_mod = False
if c_dev < 1 or c_dev > 8: if c_dev < 1 or c_dev > 9:
raise ValueError() raise ValueError()
elif c_dev == 1: elif c_dev == 1:
selected_product = ROM.PRODUCT_RNODE selected_product = ROM.PRODUCT_RNODE
@ -1664,7 +1672,7 @@ def main():
print("who would like to experiment with it. Hit enter to continue.") print("who would like to experiment with it. Hit enter to continue.")
print("---------------------------------------------------------------------------") print("---------------------------------------------------------------------------")
input() input()
elif c_dev == 8: elif c_dev == 9:
selected_product = ROM.PRODUCT_RNODE selected_product = ROM.PRODUCT_RNODE
c_mod = True c_mod = True
clear() clear()
@ -1681,6 +1689,22 @@ def main():
print("who would like to experiment with it. Hit enter to continue.") print("who would like to experiment with it. Hit enter to continue.")
print("---------------------------------------------------------------------------") print("---------------------------------------------------------------------------")
input() input()
elif c_dev == 8:
selected_product = ROM.PRODUCT_H32_V3
clear()
print("")
print("---------------------------------------------------------------------------")
print(" Heltec LoRa32 v3.0 RNode Installer")
print("")
print("Important! Using RNode firmware on Heltec devices should currently be")
print("considered experimental. It is not intended for production or critical use.")
print("")
print("Please note that Bluetooth is currently not implemented on this board.")
print("")
print("The currently supplied firmware is provided AS-IS as a courtesey to those")
print("who would like to experiment with it. Hit enter to continue.")
print("---------------------------------------------------------------------------")
input()
except Exception as e: except Exception as e:
print("That device type does not exist, exiting now.") print("That device type does not exist, exiting now.")
exit() exit()
@ -1928,6 +1952,28 @@ def main():
print("That band does not exist, exiting now.") print("That band does not exist, exiting now.")
exit() exit()
elif selected_product == ROM.PRODUCT_H32_V3:
selected_mcu = ROM.MCU_ESP32
print("\nWhat band is this Heltec LoRa32 V3 for?\n")
print("[1] 433 MHz")
print("[2] 868 MHz")
print("[3] 915 MHz")
print("[4] 923 MHz")
print("\n? ", end="")
try:
c_model = int(input())
if c_model < 1 or c_model > 4:
raise ValueError()
elif c_model == 1:
selected_model = ROM.MODEL_C5
selected_platform = ROM.PLATFORM_ESP32
elif c_model > 1:
selected_model = ROM.MODEL_CA
selected_platform = ROM.PLATFORM_ESP32
except Exception as e:
print("That band does not exist, exiting now.")
exit()
if selected_model != ROM.MODEL_FF and selected_model != ROM.MODEL_FE: if selected_model != ROM.MODEL_FF and selected_model != ROM.MODEL_FE:
fw_filename = models[selected_model][4] fw_filename = models[selected_model][4]
@ -2414,6 +2460,23 @@ def main():
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v2.bin", "0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v2.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v2.partitions", "0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v2.partitions",
] ]
elif fw_filename == "rnode_firmware_heltec32v3.zip":
return [
sys.executable, flasher,
"--chip", "esp32-s3",
"--port", args.port,
"--baud", args.baud_flash,
"--before", "default_reset",
"--after", "hard_reset",
"write_flash", "-z",
"--flash_mode", "dio",
"--flash_freq", "80m",
"--flash_size", "8MB",
"0xe000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v3.boot_app0",
"0x0", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v3.bootloader",
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v3.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v3.partitions",
]
elif fw_filename == "rnode_firmware_featheresp32.zip": elif fw_filename == "rnode_firmware_featheresp32.zip":
if numeric_version >= 1.55: if numeric_version >= 1.55:
return [ return [

View File

@ -47,6 +47,12 @@ system, which should be enabled by default in almost all OSes.
group_id = reticulum group_id = reticulum
# You can also choose the multicast address type:
# temporary (default, Temporary Multicast Address)
# or permanent (Permanent Multicast Address)
multicast_address_type = permanent
# You can also select specifically which # You can also select specifically which
# kernel networking devices to use. # kernel networking devices to use.

View File

@ -47,6 +47,12 @@ system, which should be enabled by default in almost all OSes.
group_id = reticulum group_id = reticulum
# You can also choose the multicast address type:
# temporary (default, Temporary Multicast Address)
# or permanent (Permanent Multicast Address)
multicast_address_type = permanent
# You can also select specifically which # You can also select specifically which
# kernel networking devices to use. # kernel networking devices to use.