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: Support Yellow with CM5 #3852

Merged
merged 1 commit into from
Dec 3, 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
4 changes: 4 additions & 0 deletions openthread_border_router/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 2.12.2

- Update flasher script to work with Home Assistant Yellow with CM5

## 2.12.1
- Fix possible race condition between otbr-agent-configure and otbr-agent-rest-discovery
services causing failed startup ([#3826](https://github.com/home-assistant/addons/issues/3826))
Expand Down
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.12.1
version: 2.12.2
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 @@ -16,6 +16,26 @@ function exit_no_firmware {
exit 0
}

# Function to check if the device is Home Assistant Yellow
function is_home_assistant_yellow {
# First, ensure the device is /dev/ttyAMA1
if [ "${device}" != "/dev/ttyAMA1" ]; then
return 1
fi

# Check the known paths for Home Assistant Yellow
local paths=(
"/sys/devices/platform/soc/fe201800.serial/tty/ttyAMA1"
"/sys/devices/platform/axi/1000120000.pcie/1f0003c000.serial/tty/ttyAMA1"
)
for path in "${paths[@]}"; do
if [ -d "${path}" ]; then
return 0
fi
done
return 1
}

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

Expand All @@ -29,8 +49,7 @@ if bashio::config.has_value 'network_device'; then
exit 0
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
if is_home_assistant_yellow; then
bashio::log.info "Detected Home Assistant Yellow"
firmware="yellow_openthread_rcp_2.4.4.0_GitHub-7074a43e4_gsdk_4.4.4.gbl"
gpio_reset_flag="--bootloader-reset yellow"
Expand Down
Loading