Skip to content

Radio 2 settings file

The settings of a 3DR Radio 2 fit in one small text file. Write it once, then load it onto as many radios as you like. Loading happens over the USB cable, with the radio in boot mode: the file never crosses the network, and it cannot be read back out of a radio.

For setting up a single pair, see the Radio 2 setup guide.

Every setting, with the factory values of a ground radio (access point):

wifi:
role: "ap"
ssid: "3DR-Radio2"
security: "wpa2"
password: "radio2-halow"
bssid: ""
hidden: false
max_stations: 10
country: "US"
channel: 9220
bandwidth: 4
tx_power: 20
mcs: 2
network:
mode: "bridge"
dhcp: false
ip: "192.168.200.1"
netmask: "255.255.255.0"
gateway: "192.168.200.1"
dhcp_server: true
serial:
baud: 921600
data_bits: 8
stop_bits: 1
parity: "none"
flow: false
bridge:
port: 8099
ap_address: "192.168.200.1"
ap_output: "udp"
framing: "mavlink"
gcs_ip: "192.168.200.250"
gcs_port: 14550
admin:
password: ""

You rarely need all of it. The rules are few:

  • A line that is not in the file is left alone. A file with three lines changes three settings. This is what makes one file usable for a whole fleet.
  • The file is checked as a whole. If one value is not acceptable, nothing is changed and you are told which value or which line.
  • Text goes in quotes, numbers and true/false do not. A password made only of digits must be quoted, or it is read as a number and refused.
  • Lines starting with # are comments. Indent with spaces, not tabs.
  • The file holds passwords as plain text. Store it like a password.

The file is a simple form of YAML: sections, and name: value lines inside them. Lists, deeper nesting and multi-line values are not understood. It can be at most 4096 bytes.

A starting point. On a radio you have set up, open its page, go to System and press Save settings to a file. You get every setting except the passwords, which never leave a radio; add those lines yourself.

  1. Slide the radio’s BOOT switch to the boot position and connect its USB-C port to the computer (unplug and plug it back in if it was already connected).
  2. Open radio.3dr.tools in your preferred browser.
  3. Under Settings file, choose your file. The page checks at once that the radio will be able to read it.
  4. Either install firmware at the same time, or tick Only load the settings to leave the firmware as it is.
  5. Press the button and pick the radio’s serial port.
  6. The radio restarts and the page shows its answer: the file was applied, or which line or value it could not use. Slide the BOOT switch back.

With Reset settings to factory defaults ticked, the file is applied on top of the defaults: the radio ends up exactly as the file says, whatever it was before. Without it, the file is applied on top of the radio’s current settings.

The radio needs firmware 0.4 or newer to understand a settings file. Installing the firmware in the same step takes care of that.

Keep one file per kind of radio, holding what the whole fleet shares. For the vehicle radios:

# Vehicle radios, north field fleet
wifi:
role: "sta"
ssid: "north-field"
password: "a long passphrase"
country: "US"
tx_power: 20
serial:
baud: 57600 # our autopilots talk at 57600
flow: false
bridge:
framing: "mavlink"

and for the ground radios:

# Ground radios, north field fleet
wifi:
role: "ap"
ssid: "north-field"
password: "a long passphrase"
country: "US"
channel: 9220
bandwidth: 4
mcs: 2
max_stations: 10
bridge:
ap_output: "udp"
gcs_ip: "192.168.200.250"
gcs_port: 14550
admin:
password: "page-password"

What to keep and what to drop:

Keep in a fleet fileUsually drop
wifirole, ssid, password, security, country; on access points also channel, bandwidth, mcsbssid (it names one particular access point)
networknothing, unless you run your own addressingthe whole section: an access point’s fixed address would be copied to every radio
serialeverything your autopilots need
bridgeframing, and on access points ap_output, gcs_ip, gcs_port
adminpassword, if all radios should share a page passwordthe whole section otherwise. password: "" removes the page password.

Both ends of a link need the same ssid, password, security, country and framing. A station follows its access point’s channel, so channel, bandwidth and mcs matter on the access point.

Setting role in the file means the same firmware download works for every radio: the file decides whether it is a ground or a vehicle radio.

For each radio:

  1. BOOT switch on, plug in the USB cable.
  2. On radio.3dr.tools: pick the file for this kind of radio, leave firmware installation and Reset settings to factory defaults on, press the button. The page remembers nothing between radios, but the file and the choices stay selected until you reload it.
  3. Wait for “applied” (about a minute with firmware, a few seconds without).
  4. BOOT switch off, unplug, next radio.

Because the reset and the file are applied together, every radio that goes through this ends up in the same known state, whatever was on it before.

Check one pair before doing the rest: power a provisioned ground radio and a vehicle radio, connect a computer to the ground radio’s Ethernet port, open http://192.168.200.1, and confirm the station shows up under Status.

If a radio ends up unreachable (wrong role, wrong address, forgotten password), run it through the same steps again: boot mode always works.

The firmware repository has a command-line tool, tools/flash/nrc_flash.py, that does the same from a command line (Linux, Python 3, no other dependencies):

# firmware, factory reset and settings file in one go
nrc_flash.py flash radio2_v0.4.0_sta.bin --boot --erase-settings --settings vehicles.yaml
# only the settings file
nrc_flash.py settings vehicles.yaml

Add -p /dev/ttyUSB1 for another serial port. It prints what the radio answered and exits with an error status when the file was refused:

Settings file: read-back CRC 0cfa7fe8 matches
The radio says: [settings] file applied

wifi

NameValuesNotes
role"ap", "sta"Access point (ground) or station (vehicle). Changing it also sets network.dhcp and network.dhcp_server to that role’s defaults, unless the same file sets them.
ssidtext, 1-32 charactersNetwork name. Same on both ends.
security"wpa2", "wpa3-sae", "wpa3-owe", "open"Same on both ends.
passwordtext, 8-63 charactersNeeded for wpa2 and wpa3-sae.
bssid"8C:1F:64:B0:7F:6C" or ""Station: join only the access point with this MAC address. Empty: any.
hiddentrue, falseAccess point: do not announce the network name.
max_stations1-65Access point: how many stations may join.
country"US", "EU", "JP", "AU", "NZ", "K1", "K2", "SG"Where the radio is operated. The hardware must be the variant for that band.
channelcentre frequency in units of 100 kHz: 9220 is 922.0 MHzMust be a channel of that country and bandwidth; give all three together when changing country. See Channels below.
bandwidth1, 2, 4 (MHz)
tx_power1-30 (dBm); in the US at most 23, and 21 on channel 9060 with bandwidth: 4An upper limit; the radio’s own power table still applies.
allow_uncertifiedfalse, trueFirmware 0.4.1 and newer. Your acknowledgement: “I understand the possible consequences of operating this radio outside of certified channels and/or settings”. With true the radio also accepts the channels its module can tune to but is not certified on, and a tx_power above the certified figure; a station also joins an access point on such a channel. Off from the factory. See Channel, power and region.
mcs-1 automatic, 0-7, 10Radio data rate. Slower reaches further; see “Serial speed and radio setting” in the setup guide.

The values for channel, for each country and bandwidth. A value is the centre frequency in units of 100 kHz: 9220 is 922.0 MHz. Only an access point needs one; a station follows its access point.

countrybandwidth: 1bandwidth: 2bandwidth: 4
"US"9035, 9045, 9055, 9065, 9075, 9085, 9095, 9105, 9115, 9125, 9135, 9145, 9155, 9165, 9175, 9185, 9195, 9205, 9215, 9225, 9235, 9245, 9255, 92659050, 9070, 9090, 9110, 9130, 9150, 9170, 9190, 9210, 9230, 92509060 (at most 21 dBm), 9100, 9140, 9180, 9220
"US", not certified9025, 92759030, 9040, 9060, 9080, 9100, 9120, 9140, 9160, 9180, 9200, 9220, 9240, 9260, 92709050, 9090, 9130, 9170, 9210, 9250, 9260
"EU"8635, 8645, 8655, 8665, 86758660none
"JP"9210, 9230, 9240, 9250, 9260, 92709235, 9245, 9255, 92659245, 9255
"AU", "NZ"9155, 9165, 9175, 9185, 9195, 9205, 9215, 9225, 9235, 9245, 9255, 9265, 92759170, 9190, 9210, 9230, 9250, 92709180, 9220, 9260
"K1"9215, 9225nonenone
"K2"9255, 9265, 9275, 9285, 9295, 93059270, 9290none
"SG"8665, 8675, 8685, 9175, 9185, 9195, 9205, 9215, 9225, 9235, 92458680, 9180, 9200, 9220, 92409190, 9230

The channels marked “not certified” are ones the radio module can tune to but is not certified on. A radio accepts them only with allow_uncertified: true (firmware 0.4.1 and newer), see Channel, power and region. In Singapore a radio covers either the 866 MHz or the 920 MHz channels, depending on its hardware variant.

network

NameValuesNotes
mode"bridge", "nat"Bridge: Ethernet and radio are one network (default).
dhcptrue, falseGet the address from the network (stations) or use the fixed one below.
ip, netmask, gateway"192.168.200.1"The fixed address.
dhcp_servertrue, falseHand out addresses (access points).

serial (the vehicle port on a station; on an access point, the port chosen by ap_output)

NameValuesNotes
baud9600, 19200, 38400, 57600, 115200, 230400, 460800, 500000, 921600, 1000000, 2000000Must match the autopilot. With ap_output: "usb", at most 500000.
data_bits5-8
stop_bits1, 2
parity"none", "odd", "even"
flowtrue, falseRTS/CTS. Only if both lines are wired and the autopilot uses them.

bridge (telemetry)

NameValuesNotes
framing"mavlink", "raw"Same on both ends.
ap_output"udp", "usb", "serial"Access point: where the ground station gets telemetry. Network, the USB-C port as a serial port, or the telemetry connector.
gcs_ip, gcs_port"192.168.200.250", 14550Access point with udp: where telemetry is sent until the ground station speaks first.
ap_address, port"192.168.200.1", 8099The link between station and access point. Change only together, on both ends, and only if the access point’s address changes.

admin

NameValuesNotes
passwordtext, up to 32 charactersPassword of the radio’s page (user admin). "" removes it.

The page (or the command-line tool) shows the radio’s answer. Nothing from the file is applied when it is refused; the radio keeps running with the settings it had (or the factory defaults, if you reset them in the same step). Correct the file and load it again.

AnswerMeaning
cannot read line NLine N is not a name: value line the radio understands: a tab, a list, a missing quote, the same name twice, or a setting that is not inside a section. The web page catches these before writing anything.
invalid value for <name>The file was read, but that value is out of range or of the wrong kind, for example a quoted number or an unquoted password of digits.
invalid value for channelThe channel does not exist for this country and bandwidth, or the radio is not certified on it. From firmware 0.4.1 the answer says which: not a channel of this width in this domain, or this radio is not certified on it; allow_uncertified unlocks it.
invalid value for tx_power: at most N dBm on this channelMore power than the radio is approved for on that channel.
no settings in itThe file is empty or only comments.
it is empty or too largeMore than 4096 bytes. Remove comments.
it was not written completelyThe write was interrupted. Load it again.
no answerThe file was written, but the radio did not report. Either its USB port is set to carry telemetry (the console is then off), or its firmware is older than 0.4. Check the settings on the radio’s page.

In boot mode the tool writes the file into a part of the radio’s flash memory reserved for it. When the firmware next starts, before the radio link comes up, it reads the file, checks it, stores the settings, and erases the file, whether it could use it or not. A file is therefore applied exactly once.

The radio’s boot loader has commands to write flash but none to read it, so the tool cannot read a settings file, or anything else, back out of a radio. The radio’s own page never shows passwords either. Someone holding the radio and suitable equipment can still read its flash chip directly; the settings are not encrypted.