Skip to content

Commit

Permalink
openthread_border_router: Support Yellow with CM5 (#3852)
Browse files Browse the repository at this point in the history
Support flashing the internal radio on Home Assistant Yellow with CM5.
  • Loading branch information
agners authored Dec 3, 2024
1 parent dedf6cd commit 81a3226
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
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

0 comments on commit 81a3226

Please sign in to comment.