Compare commits

...

8 Commits

Author SHA1 Message Date
Mark Qvist
8d96673bec Updated flasher paths 2023-01-14 00:55:34 +01:00
Mark Qvist
62a13eb0e8 Added RNode Bootstrap Console info to rnodeconf autoinstaller 2023-01-14 00:28:34 +01:00
Mark Qvist
10d03753b5 Updated documentation 2023-01-13 12:00:12 +01:00
Mark Qvist
f19b87759f Merge branch 'master' of https://git.unsigned.io/markqvist/Reticulum 2023-01-13 11:59:42 +01:00
Mark Qvist
04f009f57c Updated manual 2023-01-13 12:00:07 +01:00
Mark Qvist
78253093c7 Updated rnodeconf 2023-01-13 11:59:38 +01:00
Mark Qvist
63d54dbecb Added console image flashing to rnodeconf 2023-01-11 13:56:41 +01:00
Mark Qvist
32922868b9 Updated rnodeconf install guide 2023-01-11 11:45:10 +01:00
4 changed files with 395 additions and 166 deletions

View File

@ -39,7 +39,7 @@ import RNS
RNS.logtimefmt = "%H:%M:%S"
RNS.compact_log_fmt = True
program_version = "2.0.0"
program_version = "2.1.0"
eth_addr = "0x81F7B979fEa6134bA9FD5c701b3501A2e61E897a"
btc_addr = "3CPmacGm34qYvR6XWLVEJmi2aNe3PZqUuq"
xmr_addr = "87HcDx6jRSkMQ9nPRd5K9hGGpZLn2s7vWETjMaVM5KfV4TD36NcYa8J8WSxhTSvBzzFpqDwp2fg5GX2moZ7VAP9QMZCZGET"
@ -842,7 +842,7 @@ class RNode():
selected_version = None
selected_hash = None
firmware_version_url = "https://unsigned.io/firmware/latest/?variant="
firmware_version_url = "https://unsigned.io/firmware/latest/?v="+program_version+"&variant="
def ensure_firmware_file(fw_filename):
global selected_version, selected_hash, upd_nocheck
try:
@ -898,7 +898,7 @@ def ensure_firmware_file(fw_filename):
RNS.log("No release hash found for "+fw_filename+". The firmware integrity could not be verified.")
exit(97)
RNS.log("Veryfying firmware integrity...")
RNS.log("Verifying firmware integrity...")
fw_file = open(UPD_DIR+"/"+selected_version+"/"+fw_filename, "rb")
expected_hash = bytes.fromhex(selected_hash)
file_hash = hashlib.sha256(fw_file.read()).hexdigest()
@ -1053,6 +1053,9 @@ def main():
from cryptography.hazmat.primitives.asymmetric import padding
if args.autoinstall:
clear = lambda: os.system('clear')
clear()
if not args.port:
print("\nHello!\n\nThis guide will help you install the RNode firmware on supported")
print("and homebrew devices. Please connect the device you wish to set\nup now. Hit enter when it is connected.")
input()
@ -1073,7 +1076,7 @@ def main():
print(" ["+str(pi)+"] "+str(port.device)+" ("+str(port.product)+", "+str(port.serial_number)+")")
pi += 1
print("\nEnter the number of the serial port your device is connected to: ", end="")
print("\nEnter the number of the serial port your device is connected to:\n? ", end="")
try:
c_port = int(input())
if c_port < 1 or c_port > len(ports):
@ -1092,6 +1095,7 @@ def main():
port_product = selected_port.product
port_serialno = selected_port.serial_number
clear()
print("\nOk, using device on "+str(port_path)+" ("+str(port_product)+", "+str(port_serialno)+")")
else:
@ -1137,6 +1141,8 @@ def main():
print("wipe the current EEPROM. See the help for more info.\n\nExiting now.")
exit()
print("\n---------------------------------------------------------------------------")
print(" Device Selection")
if rnode.detected:
print("\nThe device seems to have an RNode firmware installed, but it was not")
print("provisioned correctly, or it is corrupt. We are going to reinstall the")
@ -1144,14 +1150,28 @@ def main():
else:
print("\nIt looks like this is a fresh device with no RNode firmware.")
print("")
print("What kind of device is this?\n")
print("[1] RNode from Unsigned.io")
print("[1] A specific kind of RNode")
print(" .")
print(" / \\ Select this option if you have an RNode of a specific")
print(" | type, built from a recipe or bought from a vendor.")
print("")
print("[2] Homebrew RNode")
print("[3] LilyGO T-Beam")
print("[4] LilyGO LoRa32 v2.0")
print("[5] LilyGO LoRa32 v2.1")
print(" .")
print(" / \\ Select this option if you have put toghether an RNode")
print(" | of your own design, or if you are prototyping one.")
print("")
print("[3] LilyGO LoRa32 v2.1 (aka T3 v1.6.1)")
print("[4] LilyGO LoRa32 v2.0 (aka T3 v1.6)")
print("[5] LilyGO T-Beam")
print("[6] Heltec LoRa32 v2")
print("\n? ", end="")
print(" .")
print(" / \\ Select one of these options if you want to easily turn")
print(" | a supported development board into an RNode.")
print("")
print("---------------------------------------------------------------------------")
print("\nEnter the number that matches your device type:\n? ", end="")
selected_product = None
try:
@ -1162,18 +1182,32 @@ def main():
selected_product = ROM.PRODUCT_RNODE
elif c_dev == 2:
selected_product = ROM.PRODUCT_HMBRW
clear()
print("")
print("---------------------------------------------------------------------------")
print(" Homebrew RNode Installer")
print("")
print("This option allows you to install and provision the RNode firmware on a")
print("custom board design, or a custom device created by coupling a generic")
print("development board with a supported transceiver module.")
print("")
print("Important! Using RNode firmware on homebrew devices should currently be")
print("considered experimental. It is not intended for production or critical use.")
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()
elif c_dev == 3:
elif c_dev == 5:
selected_product = ROM.PRODUCT_TBEAM
clear()
print("")
print("---------------------------------------------------------------------------")
print(" T-Beam RNode Installer")
print("")
print("The RNode firmware can currently be installed on T-Beam devices using the")
print("SX1276 and SX1278 transceiver chips. Support for devices with the newer")
print("SX1262 and SX1268 chips is in development.")
print("")
print("Important! Using RNode firmware on T-Beam devices should currently be")
print("considered experimental. It is not intended for production or critical use.")
print("The currently supplied firmware is provided AS-IS as a courtesey to those")
@ -1182,18 +1216,24 @@ def main():
input()
elif c_dev == 4:
selected_product = ROM.PRODUCT_T32_20
clear()
print("")
print("---------------------------------------------------------------------------")
print(" LilyGO LoRa32 v2.0 RNode Installer")
print("")
print("Important! Using RNode firmware on LoRa32 devices should currently be")
print("considered experimental. It is not intended for production or critical use.")
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()
elif c_dev == 5:
elif c_dev == 3:
selected_product = ROM.PRODUCT_T32_21
clear()
print("")
print("---------------------------------------------------------------------------")
print(" LilyGO LoRa32 v2.1 RNode Installer")
print("")
print("Important! Using RNode firmware on LoRa32 devices should currently be")
print("considered experimental. It is not intended for production or critical use.")
print("The currently supplied firmware is provided AS-IS as a courtesey to those")
@ -1202,8 +1242,11 @@ def main():
input()
elif c_dev == 6:
selected_product = ROM.PRODUCT_H32_V2
clear()
print("")
print("---------------------------------------------------------------------------")
print(" Heltec LoRa32 v2.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("")
@ -1269,39 +1312,39 @@ def main():
elif selected_product == ROM.PRODUCT_RNODE:
selected_mcu = ROM.MCU_1284P
print("\nWhat model is this RNode?\n")
print("[1] Original v1.x RNode, 410 - 525 MHz")
print("[2] Original v1.x RNode, 820 - 1020 MHz")
print("[3] Prototype v2 RNode, 410 - 525 MHz")
print("[4] Prototype v2 RNode, 820 - 1020 MHz")
print("[5] RNode v2.x, 410 - 525 MHz")
print("[6] RNode v2.x, 820 - 1020 MHz")
print("[1] Handheld v2.x RNode, 410 - 525 MHz")
print("[2] Handheld v2.x RNode, 820 - 1020 MHz")
print("[3] Original v1.x RNode, 410 - 525 MHz")
print("[4] Original v1.x RNode, 820 - 1020 MHz")
# print("[5] Prototype v2 RNode, 410 - 525 MHz")
# print("[6] Prototype v2 RNode, 820 - 1020 MHz")
print("\n? ", end="")
try:
c_model = int(input())
if c_model < 1 or c_model > 6:
raise ValueError()
elif c_model == 1:
elif c_model == 3:
selected_model = ROM.MODEL_A4
selected_platform = ROM.PLATFORM_AVR
elif c_model == 2:
elif c_model == 4:
selected_model = ROM.MODEL_A9
selected_platform = ROM.PLATFORM_AVR
elif c_model == 3:
selected_model = ROM.MODEL_A3
selected_mcu = ROM.MCU_ESP32
selected_platform = ROM.PLATFORM_ESP32
elif c_model == 4:
selected_model = ROM.MODEL_A8
selected_mcu = ROM.MCU_ESP32
selected_platform = ROM.PLATFORM_ESP32
elif c_model == 5:
elif c_model == 1:
selected_model = ROM.MODEL_A2
selected_mcu = ROM.MCU_ESP32
selected_platform = ROM.PLATFORM_ESP32
elif c_model == 6:
elif c_model == 2:
selected_model = ROM.MODEL_A7
selected_mcu = ROM.MCU_ESP32
selected_platform = ROM.PLATFORM_ESP32
# elif c_model == 5:
# selected_model = ROM.MODEL_A3
# selected_mcu = ROM.MCU_ESP32
# selected_platform = ROM.PLATFORM_ESP32
# elif c_model == 6:
# selected_model = ROM.MODEL_A8
# selected_mcu = ROM.MCU_ESP32
# selected_platform = ROM.PLATFORM_ESP32
except Exception as e:
print("That model does not exist, exiting now.")
exit()
@ -1432,9 +1475,14 @@ def main():
print("")
exit()
print("\nOk, that should be all the information we need. Please confirm the following")
clear()
print("")
print("------------------------------------------------------------------------------")
print(" Installer Ready")
print("")
print("Ok, that should be all the information we need. Please confirm the following")
print("summary before proceeding. In the next step, the device will be flashed and")
print("provisioned, so make that you are satisfied with your choices.\n")
print("provisioned, so make sure that you are satisfied with your choices.\n")
print("Serial port : "+str(selected_port.device))
print("Device type : "+str(products[selected_product])+" "+str(models[selected_model][3]))
@ -1442,6 +1490,9 @@ def main():
print("Device MCU : "+str(mcus[selected_mcu]))
print("Firmware file : "+str(fw_filename))
print("")
print("------------------------------------------------------------------------------")
print("\nIs the above correct? [y/N] ", end="")
try:
c_ok = input().lower()
@ -1619,9 +1670,29 @@ def main():
RNS.log("Please install \""+flasher+"\" and try again.")
exit()
elif platform == ROM.PLATFORM_ESP32:
numeric_version = float(selected_version)
flasher = UPD_DIR+"/"+selected_version+"/esptool.py"
if which(flasher) is not None:
if fw_filename == "rnode_firmware_tbeam.zip":
if numeric_version >= 1.55:
return [
flasher,
"--chip", "esp32",
"--port", args.port,
"--baud", "921600",
"--before", "default_reset",
"--after", "hard_reset",
"write_flash", "-z",
"--flash_mode", "dio",
"--flash_freq", "80m",
"--flash_size", "4MB",
"0xe000", UPD_DIR+"/"+selected_version+"/rnode_firmware_tbeam.boot_app0",
"0x1000", UPD_DIR+"/"+selected_version+"/rnode_firmware_tbeam.bootloader",
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_tbeam.bin",
"0x210000",UPD_DIR+"/"+selected_version+"/console_image.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_tbeam.partitions",
]
else:
return [
flasher,
"--chip", "esp32",
@ -1639,6 +1710,25 @@ def main():
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_tbeam.partitions",
]
elif fw_filename == "rnode_firmware_lora32v20.zip":
if numeric_version >= 1.55:
return [
flasher,
"--chip", "esp32",
"--port", args.port,
"--baud", "921600",
"--before", "default_reset",
"--after", "hard_reset",
"write_flash", "-z",
"--flash_mode", "dio",
"--flash_freq", "80m",
"--flash_size", "4MB",
"0xe000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v20.boot_app0",
"0x1000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v20.bootloader",
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v20.bin",
"0x210000",UPD_DIR+"/"+selected_version+"/console_image.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v20.partitions",
]
else:
return [
flasher,
"--chip", "esp32",
@ -1656,6 +1746,25 @@ def main():
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v20.partitions",
]
elif fw_filename == "rnode_firmware_lora32v21.zip":
if numeric_version >= 1.55:
return [
flasher,
"--chip", "esp32",
"--port", args.port,
"--baud", "921600",
"--before", "default_reset",
"--after", "hard_reset",
"write_flash", "-z",
"--flash_mode", "dio",
"--flash_freq", "80m",
"--flash_size", "4MB",
"0xe000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v21.boot_app0",
"0x1000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v21.bootloader",
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v21.bin",
"0x210000",UPD_DIR+"/"+selected_version+"/console_image.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v21.partitions",
]
else:
return [
flasher,
"--chip", "esp32",
@ -1673,6 +1782,25 @@ def main():
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_lora32v21.partitions",
]
elif fw_filename == "rnode_firmware_heltec32v2.zip":
if numeric_version >= 1.55:
return [
flasher,
"--chip", "esp32",
"--port", args.port,
"--baud", "921600",
"--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_heltec32v2.boot_app0",
"0x1000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v2.bootloader",
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v2.bin",
"0x210000",UPD_DIR+"/"+selected_version+"/console_image.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v2.partitions",
]
else:
return [
flasher,
"--chip", "esp32",
@ -1690,6 +1818,25 @@ def main():
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_heltec32v2.partitions",
]
elif fw_filename == "rnode_firmware_featheresp32.zip":
if numeric_version >= 1.55:
return [
flasher,
"--chip", "esp32",
"--port", args.port,
"--baud", "921600",
"--before", "default_reset",
"--after", "hard_reset",
"write_flash", "-z",
"--flash_mode", "dio",
"--flash_freq", "80m",
"--flash_size", "4MB",
"0xe000", UPD_DIR+"/"+selected_version+"/rnode_firmware_featheresp32.boot_app0",
"0x1000", UPD_DIR+"/"+selected_version+"/rnode_firmware_featheresp32.bootloader",
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_featheresp32.bin",
"0x210000",UPD_DIR+"/"+selected_version+"/console_image.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_featheresp32.partitions",
]
else:
return [
flasher,
"--chip", "esp32",
@ -1707,6 +1854,25 @@ def main():
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_featheresp32.partitions",
]
elif fw_filename == "rnode_firmware_esp32_generic.zip":
if numeric_version >= 1.55:
return [
flasher,
"--chip", "esp32",
"--port", args.port,
"--baud", "921600",
"--before", "default_reset",
"--after", "hard_reset",
"write_flash", "-z",
"--flash_mode", "dio",
"--flash_freq", "80m",
"--flash_size", "4MB",
"0xe000", UPD_DIR+"/"+selected_version+"/rnode_firmware_esp32_generic.boot_app0",
"0x1000", UPD_DIR+"/"+selected_version+"/rnode_firmware_esp32_generic.bootloader",
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_esp32_generic.bin",
"0x210000",UPD_DIR+"/"+selected_version+"/console_image.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_esp32_generic.partitions",
]
else:
return [
flasher,
"--chip", "esp32",
@ -1724,6 +1890,25 @@ def main():
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_esp32_generic.partitions",
]
elif fw_filename == "rnode_firmware_ng20.zip":
if numeric_version >= 1.55:
return [
flasher,
"--chip", "esp32",
"--port", args.port,
"--baud", "921600",
"--before", "default_reset",
"--after", "hard_reset",
"write_flash", "-z",
"--flash_mode", "dio",
"--flash_freq", "80m",
"--flash_size", "4MB",
"0xe000", UPD_DIR+"/"+selected_version+"/rnode_firmware_ng20.boot_app0",
"0x1000", UPD_DIR+"/"+selected_version+"/rnode_firmware_ng20.bootloader",
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_ng20.bin",
"0x210000",UPD_DIR+"/"+selected_version+"/console_image.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_ng20.partitions",
]
else:
return [
flasher,
"--chip", "esp32",
@ -1741,6 +1926,25 @@ def main():
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_ng20.partitions",
]
elif fw_filename == "rnode_firmware_ng21.zip":
if numeric_version >= 1.55:
return [
flasher,
"--chip", "esp32",
"--port", args.port,
"--baud", "921600",
"--before", "default_reset",
"--after", "hard_reset",
"write_flash", "-z",
"--flash_mode", "dio",
"--flash_freq", "80m",
"--flash_size", "4MB",
"0xe000", UPD_DIR+"/"+selected_version+"/rnode_firmware_ng21.boot_app0",
"0x1000", UPD_DIR+"/"+selected_version+"/rnode_firmware_ng21.bootloader",
"0x10000", UPD_DIR+"/"+selected_version+"/rnode_firmware_ng21.bin",
"0x210000",UPD_DIR+"/"+selected_version+"/console_image.bin",
"0x8000", UPD_DIR+"/"+selected_version+"/rnode_firmware_ng21.partitions",
]
else:
return [
flasher,
"--chip", "esp32",
@ -1881,8 +2085,10 @@ def main():
try:
RNS.log("Checking firmware file availability...")
fw_file_ensured = False
if selected_version == None:
ensure_firmware_file(fw_filename)
fw_file_ensured = True
if not force_update:
if rnode.version == selected_version:
@ -1905,7 +2111,7 @@ def main():
RNS.log("Override with -U option to install anyway")
exit(0)
if selected_version != None:
if not fw_file_ensured and selected_version != None:
ensure_firmware_file(fw_filename)
if fw_filename.endswith(".zip"):
@ -2255,6 +2461,26 @@ def main():
print("")
print("https://markqvist.github.io/Reticulum/manual/gettingstartedfast.html")
print("")
print("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *")
print(" Important! ")
print("")
print("ESP32-based RNodes are created with the RNode Bootstrap Console on-board.")
print("")
print("This repository is hosted directly on the RNode, and contains a wealth of")
print("information, software and tools.")
print("")
print("The RNode Bootstrap Console also contains everything needed to build")
print("and replicate RNodes, including detailed build recipes, 3D-printable")
print("cases, and copies of the source code for both the RNode Firmware,")
print("Reticulum and other utilities.")
print("")
print("To activate the RNode Bootstrap Console, power up your RNode and press")
print("the reset button twice with a one second interval. The RNode will now")
print("reboot into console mode, and activate a WiFi access point for you to")
print("connect to. The console is then reachable at: http://10.0.0.1")
print("")
print("* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *")
print("")
print("Thank you for using this utility! Please help the project by")
print("contributing code and reporting bugs, or by donating!")
print("")

View File

@ -409,7 +409,8 @@ install one or more dependencies
On more unusual systems, and in some rare cases, it might not be possible to
install or even compile one or more of the above modules. In such situations,
you can use the ``rnspure`` package instead of the ``rns`` package. The ``rnspure``
you can use the ``rnspure`` package instead of the ``rns`` package, or use ``pip``
with the ``--no-dependencies`` command-line option. The ``rnspure``
package requires no external dependencies for installation. Please note that the
actual contents of the ``rns`` and ``rnspure`` packages are *completely identical*.
The only difference is that the ``rnspure`` package lists no dependencies required

View File

@ -557,7 +557,8 @@ here at a later point. Until then you can use the <a class="reference external"
install one or more dependencies</p>
<p>On more unusual systems, and in some rare cases, it might not be possible to
install or even compile one or more of the above modules. In such situations,
you can use the <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package instead of the <code class="docutils literal notranslate"><span class="pre">rns</span></code> package. The <code class="docutils literal notranslate"><span class="pre">rnspure</span></code>
you can use the <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package instead of the <code class="docutils literal notranslate"><span class="pre">rns</span></code> package, or use <code class="docutils literal notranslate"><span class="pre">pip</span></code>
with the <code class="docutils literal notranslate"><span class="pre">--no-dependencies</span></code> command-line option. The <code class="docutils literal notranslate"><span class="pre">rnspure</span></code>
package requires no external dependencies for installation. Please note that the
actual contents of the <code class="docutils literal notranslate"><span class="pre">rns</span></code> and <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> packages are <em>completely identical</em>.
The only difference is that the <code class="docutils literal notranslate"><span class="pre">rnspure</span></code> package lists no dependencies required

View File

@ -409,7 +409,8 @@ install one or more dependencies
On more unusual systems, and in some rare cases, it might not be possible to
install or even compile one or more of the above modules. In such situations,
you can use the ``rnspure`` package instead of the ``rns`` package. The ``rnspure``
you can use the ``rnspure`` package instead of the ``rns`` package, or use ``pip``
with the ``--no-dependencies`` command-line option. The ``rnspure``
package requires no external dependencies for installation. Please note that the
actual contents of the ``rns`` and ``rnspure`` packages are *completely identical*.
The only difference is that the ``rnspure`` package lists no dependencies required