Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openthread_border_router/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ schema:
device: device(subsystem=tty)
baudrate: list(57600|115200|230400|460800|921600|1000000)
flow_control: bool
backbone_interface: str?
network_device: str?
otbr_log_level: list(debug|info|notice|warning|error|critical|alert|emergency)
firewall: bool
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,11 @@ if bashio::config.exists 'autoflash_firmware'; then
bashio::addon.option 'autoflash_firmware'
fi

backbone_if="$(bashio::api.supervisor 'GET' '/network/info' '' 'first(.interfaces[] | select (.primary == true)) .interface')"
backbone_if=""
if bashio::config.has_value 'backbone_interface'; then
backbone_if="$(bashio::config 'backbone_interface')"
fi

device=$(bashio::config 'device')

if bashio::config.has_value 'network_device'; then
Expand Down Expand Up @@ -72,10 +76,22 @@ case "${otbr_log_level}" in
;;
esac

# shellcheck disable=SC2086
if [ -z ${backbone_if} ]; then
bashio::log.warning "No primary network interface found! Using static eth0."
backbone_if="eth0"
# Fallback to primary supervisor network interface
if [ -z "${backbone_if}" ]; then
backbone_if="$(bashio::api.supervisor 'GET' '/network/info' '' 'first(.interfaces[] | select (.primary == true)) .interface')"
if [ -n "${backbone_if}" ]; then
bashio::log.warning "No network interface configured! Using primary interface instead (${backbone_if})."
fi
fi

# Fallback to first available enabled interface if backbone_if is still empty
if [ -z "${backbone_if}" ]; then
backbone_if="$(ip -br link show up | awk '$1 != "lo" {print $1; exit}')"
if [ -z "${backbone_if}" ]; then
bashio::exit.nok "No enabled network interface found."
fi

bashio::log.warning "Using fallback interface: ${backbone_if}"
fi

# shellcheck disable=SC2015
Expand Down
5 changes: 5 additions & 0 deletions openthread_border_router/translations/en.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ configuration:
flow_control:
name: Hardware flow control
description: Enable hardware flow control for serial port.
backbone_interface:
name: Backbone Network Interface
description: >-
The network interface used for the backbone network.
If not specified, it falls back to the primary interface.
network_device:
name: Network Device
description: >-
Expand Down