Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openthread_border_router: bump to latest and smaller improvements #3732

Merged
merged 3 commits into from
Aug 26, 2024
Merged
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
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
From 2c0c78e5f4dc85a63934fc0c32c035a9c5b5babd Mon Sep 17 00:00:00 2001
Message-ID: <2c0c78e5f4dc85a63934fc0c32c035a9c5b5babd.1692864566.git.stefan@agner.ch>
In-Reply-To: <e0792b7605e6d6cb2ebd491025aee7f84d1edbaa.1692864566.git.stefan@agner.ch>
References: <e0792b7605e6d6cb2ebd491025aee7f84d1edbaa.1692864566.git.stefan@agner.ch>
From e67d11327f3ee5f67107d866c2df575a2695727c Mon Sep 17 00:00:00 2001
From: Stefan Agner <[email protected]>
Date: Mon, 5 Jun 2023 23:41:50 +0200
Subject: [PATCH] [rest] support deleting the dataset
Subject: [PATCH] support deleting the dataset

Add REST API to support deleting the active or pending operational
dataset. Deleting the active operational dataset requires the Thread
Expand Down Expand Up @@ -58,7 +55,7 @@ index 2ba2a4dd56..2edc4af29a 100644
schemas:
LeaderData:
diff --git a/src/rest/resource.cpp b/src/rest/resource.cpp
index a60e9d9483..829835341a 100644
index ce154c2e5b..1708faf6ab 100644
--- a/src/rest/resource.cpp
+++ b/src/rest/resource.cpp
@@ -767,12 +767,47 @@ exit:
Expand Down Expand Up @@ -110,7 +107,7 @@ index a60e9d9483..829835341a 100644
GetDataset(aDatasetType, aRequest, aResponse);
break;
diff --git a/src/rest/resource.hpp b/src/rest/resource.hpp
index d79085dbfc..362e501471 100644
index 0929dbcc50..cbe1702f2f 100644
--- a/src/rest/resource.hpp
+++ b/src/rest/resource.hpp
@@ -150,6 +150,7 @@ private:
Expand All @@ -122,5 +119,5 @@ index d79085dbfc..362e501471 100644
void DeleteOutDatedDiagnostic(void);
void UpdateDiag(std::string aKey, std::vector<otNetworkDiagTlv> &aDiag);
--
2.42.0
2.46.0

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
From e1857ad3e14df6e950d51cd1f76c12f1c0f59f18 Mon Sep 17 00:00:00 2001
Message-ID: <e1857ad3e14df6e950d51cd1f76c12f1c0f59f18.1705764864.git.stefan@agner.ch>
From 7662acaaffb9cf730a8ba1d4f6014832dad23d0f Mon Sep 17 00:00:00 2001
From: Stefan Agner <[email protected]>
Date: Sat, 20 Jan 2024 16:31:28 +0100
Subject: [PATCH] [openthread] set netif route metric lower
Subject: [PATCH] set netif route metric lower

It seems that routes learned through IPv6 Neighbor Discovery Protocol
get a metric of 128 when NetworkManager is used. Make sure the
Expand All @@ -12,10 +11,10 @@ OpenThread network interface's own route is lower than that.
1 file changed, 1 insertion(+)

diff --git a/third_party/openthread/CMakeLists.txt b/third_party/openthread/CMakeLists.txt
index f07625da96..0bcca3b79c 100644
index 8ea4516e4e..97007a58cd 100644
--- a/third_party/openthread/CMakeLists.txt
+++ b/third_party/openthread/CMakeLists.txt
@@ -105,6 +105,7 @@ target_compile_definitions(ot-config INTERFACE
@@ -106,6 +106,7 @@ target_compile_definitions(ot-config INTERFACE
"-DOPENTHREAD_CONFIG_MAX_STATECHANGE_HANDLERS=3"
"-DOPENTHREAD_CONFIG_MLE_STEERING_DATA_SET_OOB_ENABLE=1"
"-DOPENTHREAD_CONFIG_TCP_ENABLE=0"
Expand All @@ -24,5 +23,5 @@ index f07625da96..0bcca3b79c 100644
)

--
2.43.0
2.46.0

Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
From 4c8958890eb01448e08921bf3b313cb2169760d0 Mon Sep 17 00:00:00 2001
From: Stefan Agner <[email protected]>
Date: Fri, 16 Aug 2024 11:46:17 +0200
Subject: [PATCH] [logging] support disable syslog for otbr-web as well

Commit c88a5fce6659 ("[logging] add command line arg to disable syslog")
allows to disable logging to syslog via command line argument. Support
the same -s command line argument for otbr-web as well.
---
src/web/main.cpp | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/web/main.cpp b/src/web/main.cpp
index 922038d88c..8b2c20c4e6 100644
--- a/src/web/main.cpp
+++ b/src/web/main.cpp
@@ -76,9 +76,10 @@ int main(int argc, char **argv)
otbrLogLevel logLevel = OTBR_LOG_INFO;
int ret = 0;
int opt;
- uint16_t port = OT_HTTP_PORT;
+ uint16_t port = OT_HTTP_PORT;
+ bool syslogDisable = false;

- while ((opt = getopt(argc, argv, "d:I:p:va:")) != -1)
+ while ((opt = getopt(argc, argv, "d:I:p:va:s")) != -1)
{
switch (opt)
{
@@ -103,6 +104,10 @@ int main(int argc, char **argv)
ExitNow();
break;

+ case 's':
+ syslogDisable = true;
+ break;
+
default:
fprintf(stderr, "Usage: %s [-d DEBUG_LEVEL] [-I interfaceName] [-p port] [-a listenAddress] [-v]\n",
argv[0]);
@@ -111,7 +116,7 @@ int main(int argc, char **argv)
}
}

- otbrLogInit(argv[0], logLevel, true, false);
+ otbrLogInit(argv[0], logLevel, true, syslogDisable);
otbrLogInfo("Running %s", OTBR_PACKAGE_VERSION);

if (interfaceName == nullptr)
--
2.46.0

This file was deleted.

6 changes: 6 additions & 0 deletions openthread_border_router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Changelog

## 2.10.0

- Bump to OTBR POSIX version b66cabfaa0 (2024-08-14 08:01:56 -0700)
- Avoid OTBR Web spamming system console
- Bump universal SiLabs flasher to 0.0.22

## 2.9.1

- Abort firmware flasher if network device is selected
Expand Down
14 changes: 6 additions & 8 deletions openthread_border_router/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@ ENV WEB_GUI 1
ENV REST_API 1
ENV DOCKER 1

COPY 0002-rest-support-deleting-the-dataset.patch /usr/src
COPY 0003-openthread-set-netif-route-metric-lower.patch /usr/src
COPY 0001-support-deleting-the-dataset.patch /usr/src
COPY 0002-set-netif-route-metric-lower.patch /usr/src
COPY 0003-logging-support-disable-syslog-for-otbr-web-as-well.patch /usr/src
COPY 0001-channel-monitor-disable-by-default.patch /usr/src
COPY 0002-posix-fix-build-with-custom-netif-prefix-route-set.patch /usr/src
COPY 0004-Deassert-DTR-and-RTS-if-flow-control-is-disabled.patch /usr/src
# Required and installed (script/bootstrap) can be removed after build
ENV OTBR_BUILD_DEPS build-essential ninja-build cmake wget ca-certificates \
libreadline-dev libncurses-dev libcpputest-dev libdbus-1-dev libavahi-common-dev \
Expand Down Expand Up @@ -55,13 +54,12 @@ RUN \
&& git checkout ${OTBR_VERSION} \
&& git submodule update --init \
&& ./script/bootstrap \
&& patch -p1 < /usr/src/0002-rest-support-deleting-the-dataset.patch \
&& patch -p1 < /usr/src/0003-openthread-set-netif-route-metric-lower.patch \
&& patch -p1 < /usr/src/0001-support-deleting-the-dataset.patch \
&& patch -p1 < /usr/src/0002-set-netif-route-metric-lower.patch \
&& patch -p1 < /usr/src/0003-logging-support-disable-syslog-for-otbr-web-as-well.patch \
&& ( \
cd third_party/openthread/repo \
&& patch -p1 < /usr/src/0001-channel-monitor-disable-by-default.patch \
&& patch -p1 < /usr/src/0002-posix-fix-build-with-custom-netif-prefix-route-set.patch \
&& patch -p1 < /usr/src/0004-Deassert-DTR-and-RTS-if-flow-control-is-disabled.patch \
) \
# Mimic rt_tables_install \
&& echo "88 openthread" >> /etc/iproute2/rt_tables \
Expand Down
4 changes: 2 additions & 2 deletions openthread_border_router/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ build_from:
aarch64: ghcr.io/home-assistant/aarch64-base-debian:bookworm
amd64: ghcr.io/home-assistant/amd64-base-debian:bookworm
args:
OTBR_VERSION: 41474ce29ab45dd24c393d899c9f461844dc1e34
UNIVERSAL_SILABS_FLASHER: 0.0.20
OTBR_VERSION: b66cabfaa0b6829314e8c326c4f92bfbaa55ad9b
UNIVERSAL_SILABS_FLASHER: 0.0.22
2 changes: 1 addition & 1 deletion openthread_border_router/config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
version: 2.9.1
version: 2.10.0
slug: openthread_border_router
name: OpenThread Border Router
description: OpenThread Border Router add-on
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ declare otbr_web_port

otbr_web_port="$(bashio::addon.port 8080)"

exec /usr/sbin/otbr-web -I wpan0 -d6 -p "${otbr_web_port}"
exec /usr/sbin/otbr-web -I wpan0 -d6 -s -p "${otbr_web_port}"
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ fi
# Assume to run on Yellow if UART4 is mapped to ttyAMA1
if [ -d /sys/devices/platform/soc/fe201800.serial/tty/ttyAMA1 ] && [ "${device}" == "/dev/ttyAMA1" ]; then
bashio::log.info "Detected Home Assistant Yellow"
firmware="NabuCasa_Yellow_OpenThread_RCP_v2.4.0.0_PA32_ot-rcp_hw_460800.gbl"
firmware="yellow_ot-rcp_2.4.0.0_GitHub-7074a43e4_gsdk_4.4.3.gbl"
gpio_reset_flag="--bootloader-reset yellow"
else
# Check device manufacturer/product information
Expand All @@ -52,9 +52,9 @@ else

bashio::log.info "Checking ${device} identifying ${usb_product} from ${usb_manufacturer}."
if [[ "${usb_manufacturer}" == "Nabu Casa" && "${usb_product}" == "SkyConnect"* ]]; then
firmware="NabuCasa_SkyConnect_OpenThread_RCP_v2.4.0.0_ot-rcp_hw_460800.gbl"
firmware="skyconnect_ot-rcp_2.4.0.0_GitHub-7074a43e4_gsdk_4.4.3.gbl"
elif [[ "${usb_manufacturer}" == "Nabu Casa" && "${usb_product}" == "Home Assistant Connect ZBT-1"* ]]; then
firmware="NabuCasa_SkyConnect_OpenThread_RCP_v2.4.0.0_ot-rcp_hw_460800.gbl"
firmware="skyconnect_ot-rcp_2.4.0.0_GitHub-7074a43e4_gsdk_4.4.3.gbl"
elif [[ "${usb_manufacturer}" == "ITEAD" && "${usb_product}" == "SONOFF Zigbee 3.0 USB Dongle Plus V2" ]]; then
firmware="ot-rcp-v2.4.2.0-zbdonglee-460800.gbl"
gpio_reset_flag="--bootloader-reset sonoff"
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.