markqvist / Reticulum

The cryptography-based networking stack for building unstoppable networks with LoRa, Packet Radio, WiFi and everything in between.
https://reticulum.network
MIT License
2k stars 124 forks source link

Add RNodeMultiInterface support #530

Closed jacobeva closed 1 month ago

jacobeva commented 1 month ago

This PR adds interface support for RNodes with multiple interfaces on board. Firmware version 1.73 and up (community edition) is required on the RNode to utilise this interface type.

Please see the below example for details on how to configure this interface type (it would be wise to add it to the RNS manual):

[[openCom XL]]
type = RNodeMultiInterface
# Enable interface if you want to use it!
interface_enabled = True

# Serial port for the device
port = /dev/ttyACM0

# You can configure the RNode to send
# out identification on the channel with
# a set interval by configuring the
# following two parameters.

# id_callsign = MYCALL-0
# id_interval = 600

# For certain homebrew RNode interfaces
# with low amounts of RAM, using packet
# flow control can be useful. By default
# it is disabled.

# flow_control = False

  # A subinterface
  [[[HIGHDATARATE]]]
  # Subinterfaces can be enabled and disabled in of themselves
  interface_enabled = True

  # Set frequency to 2.4GHz
  frequency = 2400000000

  # Set LoRa bandwidth to 1625 KHz
  bandwidth = 1625000

  # Set TX power to 0 dBm (0.12 mW)
  txpower = 0

  # The virtual port, only the manufacturer or the person who wrote the board
  # config can tell you what it will be for which interface
  vport = 1

  # Select spreading factor 5. Valid
  # range is 5 through 12, with 5 
  # being the fastest and 12 having
  # the longest range.
  spreadingfactor =        5

  # Select coding rate 5. Valid range
  # is 5 throough 8, with 5 being the
  # fastest, and 8 the longest range.
  codingrate = 5

  # It is possible to limit the airtime
  # utilisation of an RNode by using the
  # following two configuration options.
  # The short-term limit is applied in a
  # window of approximately 15 seconds,
  # and the long-term limit is enforced
  # over a rolling 60 minute window. Both
  # options are specified in percent.

  # airtime_limit_long = 100
  # airtime_limit_short = 100

  [[[LOWDATARATE]]]
  # Subinterfaces can be enabled and disabled in of themselves
  interface_enabled = True

  # Set frequency to 865.6 MHz
  frequency = 865600000

  # The virtual port, only the manufacturer or the person who wrote the board
  # config can tell you what it will be for which interface
  vport = 0

  # Set LoRa bandwidth to 125 KHz
  bandwidth = 125000

  # Set TX power to 0 dBm (0.12 mW)
  txpower = 0

  # Select spreading factor 5. Valid
  # range is 5 through 12, with 5 
  # being the fastest and 12 having
  # the longest range.
  spreadingfactor = 5

  # Select coding rate 5. Valid range
  # is 5 throough 8, with 5 being the
  # fastest, and 8 the longest range.
  codingrate = 5

  # It is possible to limit the airtime
  # utilisation of an RNode by using the
  # following two configuration options.
  # The short-term limit is applied in a
  # window of approximately 15 seconds,
  # and the long-term limit is enforced
  # over a rolling 60 minute window. Both
  # options are specified in percent.

  # airtime_limit_long = 100
  # airtime_limit_short = 100

I have also included a commit to update the minimum supported spreading factor for the Android RNodeInterface, which has been changed from 7 to 5 in accordance with progress in firmware support.

markqvist commented 1 month ago

Thanks Jacob. Merged, and section also added to the manual. I have a few more additions I'm getting into 0.7.6, but I should have this released very soon.