### Start Reticulum Daemon (rnsd) Source: https://github.com/attermann/microreticulum_firmware/blob/master/Console/source/guides/loracomms.md This command starts the Reticulum daemon in the foreground. It's used to verify the installation and check if a default configuration file is created. The output indicates the status of the daemon and configuration file creation. ```bash rnsd ``` -------------------------------- ### Reticulum Configuration File Example Source: https://github.com/attermann/microreticulum_firmware/blob/master/Console/source/guides/loracomms.md This is an example of a Reticulum configuration file. It includes settings for enabling transport, sharing the instance, specifying ports, and configuring a LoRa interface with specific radio parameters like port, frequency, bandwidth, transmission power, spreading factor, and coding rate. ```ini [reticulum] enable_transport = Yes share_instance = Yes shared_instance_port = 37428 instance_control_port = 37429 panic_on_interface_error = No [logging] loglevel = 4 [interfaces] [[Default Interface]] type = AutoInterface interface_enabled = True [[RNode LoRa Interface]] type = RNodeInterface interface_enabled = True port = /dev/ttyUSB0 frequency = 867200000 bandwidth = 125000 txpower = 7 spreadingfactor = 8 codingrate = 5 ``` -------------------------------- ### Start Reticulum Daemon Verbose Output Source: https://github.com/attermann/microreticulum_firmware/blob/master/Console/source/guides/loracomms.md This command starts the Reticulum daemon with verbose logging enabled (level -vvv). This provides detailed output about the system interfaces, serial port configuration, and radio parameters, useful for debugging and verifying the LoRa interface setup. ```bash rnsd -vvv ``` -------------------------------- ### Install Reticulum Package using pip Source: https://github.com/attermann/microreticulum_firmware/blob/master/Console/source/guides/loracomms.md This command installs the Reticulum networking library using pip, the Python package installer. Ensure you have Python and pip installed on your system. ```bash pip install rns ``` -------------------------------- ### PlatformIO Build Configuration Flags (INI) Source: https://context7.com/attermann/microreticulum_firmware/llms.txt Example PlatformIO configuration in 'platformio.ini' showing build flags to enable microReticulum stack, WiFi transport, filesystem, and specify hardware parameters. These flags control firmware features and hardware compatibility. ```ini ; platformio.ini build flags example build_flags = ; Enable microReticulum RNS stack and transport node -DHAS_RNS ; Enable WiFi UDP transport (uses port 4242) -DUDP_TRANSPORT ; Enable filesystem for persistent storage -DRNS_USE_FS -DRNS_PERSIST_PATHS ; Specify board model -DBOARD_MODEL=BOARD_TBEAM ; Specify modem chip (SX1276, SX1278, SX1262, SX1280) -DMODEM=SX1262 ; Enable external NeoPixel LED -DEXTERNAL_LEDS=true ; Enable TCXO for frequency stability -DENABLE_TCXO=true ; Disable debug build -DNDEBUG ``` -------------------------------- ### Install microReticulum Firmware using rnodeconf Source: https://context7.com/attermann/microreticulum_firmware/llms.txt Installs or updates the microReticulum firmware on supported devices using the `rnodeconf` utility. It supports installing from a remote URL, clearing the cache for fresh downloads, extracting firmware locally, and updating existing installations. ```bash # Install latest firmware from microReticulum repository rnodeconf --autoinstall --fw-url https://github.com/attermann/microReticulum_Firmware/releases/ # Clear cache if reinstalling same version (forces fresh download) rnodeconf --clear-cache # Extract firmware from existing RNode for offline installation rnodeconf --extract # Install using locally extracted firmware rnodeconf --autoinstall --use-extracted # Update existing RNode firmware rnodeconf --update --use-extracted ``` -------------------------------- ### Install microReticulum Firmware Source: https://github.com/attermann/microreticulum_firmware/blob/master/README.md Installs the latest version of the microReticulum firmware using the `rnodeconf` utility. This command pulls the firmware image from a specified URL. Ensure RNS is updated to the latest version to use the `fw-url` switch. ```bash rnodeconf --autoinstall --fw-url https://github.com/attermann/microReticulum_Firmware/releases/ ``` -------------------------------- ### Query RNode Device Information using rnodeconf Source: https://context7.com/attermann/microreticulum_firmware/llms.txt Queries and displays detailed information about the connected RNode device, including firmware version, hardware revision, frequency range, maximum TX power, and current device mode. This is useful for verifying installation and configuration. ```bash # Query device information rnodeconf --info /dev/ttyUSB0 # Example output: # [20:11:22] Opening serial port /dev/ttyUSB0... # [20:11:25] Device connected # [20:11:25] Current firmware version: 1.55 # [20:11:25] Reading EEPROM... # [20:11:25] EEPROM checksum correct # [20:11:25] Device signature validated # [20:11:25] # [20:11:25] Device info: # [20:11:25] Product : LilyGO LoRa32 v2.0 850 - 950 MHz # [20:11:25] Firmware version : 1.55 # [20:11:25] Hardware revision : 1 # [20:11:25] Frequency range : 850.0 MHz - 950.0 MHz # [20:11:25] Max TX power : 17 dBm # [20:11:25] Device mode : Normal (host-controlled) ``` -------------------------------- ### Firmware Release Build Steps Source: https://github.com/attermann/microreticulum_firmware/blob/master/README.md Steps for building new firmware releases, including cleaning the build and release directories, and then packaging all environments. ```bash pio run -t fullclean rm Release/release.json pio run -t package ``` -------------------------------- ### PlatformIO Build and Upload Commands Source: https://github.com/attermann/microreticulum_firmware/blob/master/README.md Commands to build and upload firmware for specific environments (boards) using PlatformIO. Replace `ttgo-t-beam` or `wiscore_rak4631` with the target board environment. ```bash pio run -e ttgo-t-beam pio run -e wiscore_rak4631 ``` ```bash pio run -e ttgo-t-beam -t upload pio run -e wiscore_rak4631 -t upload ``` -------------------------------- ### PlatformIO Package Commands Source: https://github.com/attermann/microreticulum_firmware/blob/master/README.md Commands to build and package firmware for specific environments (boards) using PlatformIO. The `-t package` target creates distributable firmware packages. ```bash pio run -e ttgo-t-beam -t package pio run -e wiscore_rak4631 -t package ``` ```bash pio run -t package ``` -------------------------------- ### PlatformIO Clean Commands Source: https://github.com/attermann/microreticulum_firmware/blob/master/README.md Provides commands for cleaning PlatformIO build environments. `pio run -t clean` removes compiled files for all environments, while `pio run -t fullclean` also removes downloaded library dependencies. ```bash pio run -t clean ``` ```bash pio run -t fullclean ``` -------------------------------- ### Write Version Info Script Source: https://github.com/attermann/microreticulum_firmware/blob/master/README.md Executes a Python script to generate firmware release information and save it to `Release/release.json`. This is part of the firmware release procedure. ```bash python release_hashes.py > Release/release.json ``` -------------------------------- ### Serial KISS Communication with RNode (Python) Source: https://context7.com/attermann/microreticulum_firmware/llms.txt Demonstrates direct serial communication using the KISS protocol to interact with an RNode device. Includes functions for escaping special bytes, sending commands like device detection, setting frequency, and controlling radio state. ```python import serial import time # KISS protocol constants FEND = 0xC0 FESC = 0xDB TFEND = 0xDC TFESC = 0xDD CMD_DETECT = 0x08 DETECT_REQ = 0x73 DETECT_RESP = 0x46 CMD_FREQUENCY = 0x01 CMD_RADIO_STATE = 0x06 RADIO_STATE_ON = 0x01 def kiss_escape(data): """Escape special KISS bytes in data""" result = bytearray() for byte in data: if byte == FEND: result.extend([FESC, TFEND]) elif byte == FESC: result.extend([FESC, TFESC]) else: result.append(byte) return bytes(result) def send_kiss_command(ser, command, data=b''): """Send a KISS command frame""" escaped_data = kiss_escape(data) frame = bytes([FEND, command]) + escaped_data + bytes([FEND]) ser.write(frame) return frame # Connect to RNode ser = serial.Serial('/dev/ttyUSB0', 115200, timeout=1) time.sleep(2) # Wait for device initialization # Detect RNode device send_kiss_command(ser, CMD_DETECT, bytes([DETECT_REQ])) time.sleep(0.5) response = ser.read(100) if DETECT_RESP in response: print("RNode detected!") # Set frequency to 915 MHz (big-endian 4 bytes) freq = 915000000 freq_bytes = freq.to_bytes(4, byteorder='big') send_kiss_command(ser, CMD_FREQUENCY, freq_bytes) print(f"Set frequency to {freq} Hz") # Turn radio on send_kiss_command(ser, CMD_RADIO_STATE, bytes([RADIO_STATE_ON])) print("Radio enabled") ``` -------------------------------- ### Control RNode Devices Programmatically with Python RNodeInterface Source: https://context7.com/attermann/microreticulum_firmware/llms.txt Provides a Python interface for controlling RNode devices, handling KISS protocol framing, radio configuration, and packet transmission/reception. It includes a callback for received packets and methods to send data and check interface status. ```python from RNode import RNodeInterface # Callback function for received packets def packet_received(data, rnode): message = data.decode("utf-8") print(f"Received: {message}") print(f"RSSI: {rnode.r_stat_rssi} dBm") print(f"SNR: {rnode.r_stat_snr} dB") # Initialize RNode with radio configuration rnode = RNodeInterface( callback=packet_received, name="My RNode", port="/dev/ttyUSB0", frequency=868000000, # 868 MHz bandwidth=125000, # 125 kHz txpower=2, # 2 dBm sf=7, # Spreading factor 7 cr=5, # Coding rate 4/5 loglevel=RNodeInterface.LOG_DEBUG ) # Send data packets message = "Hello World!" rnode.send(message.encode("utf-8")) # Check interface status print(f"Online: {rnode.online}") print(f"Interface ready: {rnode.interface_ready}") print(f"Bitrate: {rnode.bitrate_kbps} kbps") ``` -------------------------------- ### Supported Hardware Board Definitions (YAML) Source: https://context7.com/attermann/microreticulum_firmware/llms.txt YAML mapping of PlatformIO environment names to descriptive hardware board names and their LoRa transceiver types. This list details the ESP32 and NRF52-based boards supported by the firmware. ```yaml # ESP32-based boards (SX127x transceiver) ttgo-t-beam: LilyGO T-Beam v1.1 with SX1276/78 ttgo-lora32-v1: LilyGO LoRa32 v1.0 ttgo-lora32-v2: LilyGO LoRa32 v2.0 ttgo-lora32-v21: LilyGO LoRa32 v2.1 (TTGO T3 v1.6.1) heltec_wifi_lora_32_V2: Heltec WiFi LoRa 32 V2 featheresp32: Adafruit Feather ESP32 generic-esp32: Generic ESP32 with SX127x # ESP32-based boards (SX1262 transceiver) ttgo-t-beam-sx1262: LilyGO T-Beam with SX1262 ttgo-t-beam-supreme: LilyGO T-Beam Supreme lilygo-t3-s3: LilyGO T3 S3 heltec_wifi_lora_32_V3: Heltec WiFi LoRa 32 V3 heltec_wifi_lora_32_V4: Heltec WiFi LoRa 32 V4 / Wireless Tracker # ESP32-based boards (SX1280 2.4GHz transceiver) lilygo-t3-s3-sx1280-pa: LilyGO T3 S3 with SX1280 PA # NRF52-based boards wiscore_rak4631: RAKwireless RAK4631 (NRF52840 + SX1262) heltec_t114: Heltec T114 (NRF52840) # Special configurations lilygo-t-deck: LilyGO T-Deck (ESP32-S3 with keyboard) seeed_xiao_esp32s3: Seeed XIAO ESP32S3 ``` -------------------------------- ### Configure RNode to TNC Mode using rnodeconf Source: https://github.com/attermann/microreticulum_firmware/blob/master/Console/source/guides/tnc_mode.md This command configures the RNode device to operate in TNC Mode, making it compatible with amateur radio software. It requires the `rnodeconf` utility and the serial port the RNode is connected to. The command prompts for channel configuration parameters such as frequency, bandwidth, and transmission power. ```shell rnodeconf -T /dev/ttyUSB0 ``` -------------------------------- ### KISS Protocol Command Definitions (C) Source: https://context7.com/attermann/microreticulum_firmware/llms.txt Defines constants for KISS framing and various radio configuration, status query, and control commands used in the firmware. These hex bytes are sent over serial communication to manage device functionality. ```c // KISS framing constants #define FEND 0xC0 // Frame end delimiter #define FESC 0xDB // Frame escape #define TFEND 0xDC // Transposed frame end #define TFESC 0xDD // Transposed frame escape // Radio configuration commands #define CMD_DATA 0x00 // Data packet #define CMD_FREQUENCY 0x01 // Set frequency (4 bytes, Hz) #define CMD_BANDWIDTH 0x02 // Set bandwidth (4 bytes, Hz) #define CMD_TXPOWER 0x03 // Set TX power (1 byte, dBm) #define CMD_SF 0x04 // Set spreading factor (1 byte, 7-12) #define CMD_CR 0x05 // Set coding rate (1 byte, 5-8) #define CMD_RADIO_STATE 0x06 // Radio on/off control // Status query commands #define CMD_STAT_RX 0x21 // RX packet count #define CMD_STAT_TX 0x22 // TX packet count #define CMD_STAT_RSSI 0x23 // Last packet RSSI #define CMD_STAT_SNR 0x24 // Last packet SNR #define CMD_FW_VERSION 0x50 // Firmware version // Detection and control #define CMD_DETECT 0x08 // Device detection (send 0x73, expect 0x46) #define CMD_PROMISC 0x0E // Promiscuous mode toggle #define CMD_READY 0x0F // Check if ready for TX #define CMD_RANDOM 0x40 // Get random byte from radio // Example: Set frequency to 915 MHz via KISS // Frame: FEND + CMD_FREQUENCY + [4 bytes big-endian freq] + FEND // 915000000 = 0x3691F700 // Packet: C0 01 36 91 F7 00 C0 ``` -------------------------------- ### Send Data Packet using KISS Command (Python) Source: https://context7.com/attermann/microreticulum_firmware/llms.txt This snippet demonstrates how to send a data packet using the `send_kiss_command` function. It requires an active serial connection (`ser`) and a byte string message. The function sends the specified message with a command code (0x00 for CMD_DATA) over the serial interface and prints a confirmation. The serial connection is closed afterward. ```python message = b"Hello from RNode!" send_kiss_command(ser, 0x00, message) # CMD_DATA = 0x00 print(f"Sent: {message}") ser.close() ``` -------------------------------- ### ISM Band Frequencies and Radio Parameters Source: https://context7.com/attermann/microreticulum_firmware/llms.txt Defines common ISM band frequencies, bandwidth options, spreading factors, coding rates, and TX power limits for different transceivers. These constants are crucial for configuring radio communication parameters. ```python # Common ISM band frequencies FREQ_433 = 433000000 # 433 MHz (Europe, Asia) FREQ_868 = 868000000 # 868 MHz (Europe) FREQ_915 = 915000000 # 915 MHz (Americas, Australia) FREQ_2400 = 2400000000 # 2.4 GHz (Global, SX1280 only) # Bandwidth options (Hz) BW_7K8 = 7800 # 7.8 kHz - longest range, slowest BW_10K4 = 10400 # 10.4 kHz BW_15K6 = 15600 # 15.6 kHz BW_20K8 = 20800 # 20.8 kHz BW_31K25 = 31250 # 31.25 kHz BW_41K7 = 41700 # 41.7 kHz BW_62K5 = 62500 # 62.5 kHz BW_125K = 125000 # 125 kHz - common default BW_250K = 250000 # 250 kHz BW_500K = 500000 # 500 kHz - shortest range, fastest # Spreading factor (7-12) # Higher SF = longer range, slower data rate SF_7 = 7 # Fastest, shortest range SF_8 = 8 SF_9 = 9 SF_10 = 10 SF_11 = 11 SF_12 = 12 # Slowest, longest range # Coding rate (5-8 maps to 4/5, 4/6, 4/7, 4/8) # Higher CR = more error correction, slower throughput CR_4_5 = 5 # Minimal redundancy CR_4_6 = 6 CR_4_7 = 7 CR_4_8 = 8 # Maximum redundancy # TX Power limits by transceiver # SX1276/78: 0-17 dBm # SX1262: 0-22 dBm # SX1280: 0-13 dBm (0-20 dBm with PA) ``` -------------------------------- ### LoRa Radio Configuration Parameter Ranges (Python) Source: https://context7.com/attermann/microreticulum_firmware/llms.txt Python comments outlining the frequency ranges supported by different LoRa transceiver chips (SX1276/78, SX1262, SX1280). These ranges are crucial for setting operational frequencies within regulatory and hardware limitations. ```python # Frequency ranges by transceiver # SX1276/78: 137 MHz - 1020 MHz (region-dependent) # SX1262: 150 MHz - 960 MHz # SX1280: 2400 MHz - 2500 MHz (2.4 GHz ISM band) ``` -------------------------------- ### Clear rnodeconf Cache Source: https://github.com/attermann/microreticulum_firmware/blob/master/README.md Clears the `rnodeconf` cache to force a fresh download of firmware images, particularly useful when re-installing a new build of the same version. ```bash rnodeconf --clear-cache ```