Skip to content

Commit

Permalink
assume a RPI-RF-MOD per default for a connected HB-RF-USB and omit the
Browse files Browse the repository at this point in the history
reset module call which does not seem to be necessary in a virtual
environment with generic_raw_uart which should automatically reset the
module anyway.
  • Loading branch information
jens-maus committed Oct 24, 2019
1 parent 531f0f5 commit 3ef67f8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions buildroot-external/overlay/base/etc/init.d/S11InitRFHardware
Expand Up @@ -82,7 +82,12 @@ identify_rf_hardware() {
if lsusb | grep -q 0403:6f70; then
if [[ -c /dev/raw-uart1 ]]; then
HM_HOST_GPIO_UART="/dev/raw-uart1"
elif [[ -c /dev/raw-uart ]]; then
HM_HOST_GPIO_UART="/dev/raw-uart"
fi
echo -n "HB-RF-USB, "
HM_HMRF_DEV="RPI-RF-MOD"
HM_HMIP_DEV="RPI-RF-MOD"
fi

# check if we should boot in LAN gateway mode
Expand Down Expand Up @@ -116,8 +121,11 @@ init_rf_hardware() {

# if we are using a HB-RF-USB with raw uart we make sure to
# reset the rf module using the provided sysfs link.
if [[ "${HM_HOST_GPIO_UART}" == "/dev/raw-uart1" ]]; then
echo 1 >/sys/class/raw-uart/$(basename ${HM_HOST_GPIO_UART})/reset_radio_module
if lsusb | grep -q 0403:6f70; then
# only reset if we are not in an ova environment
if ! echo "${HM_HOST}" | grep -q ova-; then
echo 1 >/sys/class/raw-uart/$(basename ${HM_HOST_GPIO_UART})/reset_radio_module
fi
else
# identify which GPIO reset pin to drive
if [[ "${HM_HMRF_DEV}" == "RPI-RF-MOD" ]] ||
Expand Down

0 comments on commit 3ef67f8

Please sign in to comment.