From 5362bf1fc4b8da40f1c7a6b00996f6a24adb4a62 Mon Sep 17 00:00:00 2001 From: Jason Reiss Date: Fri, 28 Oct 2016 09:38:45 -0500 Subject: lora-gateway: add script to link spidev0.0 to installed card --- recipes-connectivity/lora/lora-gateway/ln-lora-spi-dev.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 recipes-connectivity/lora/lora-gateway/ln-lora-spi-dev.sh (limited to 'recipes-connectivity/lora/lora-gateway') diff --git a/recipes-connectivity/lora/lora-gateway/ln-lora-spi-dev.sh b/recipes-connectivity/lora/lora-gateway/ln-lora-spi-dev.sh new file mode 100644 index 0000000..c350fff --- /dev/null +++ b/recipes-connectivity/lora/lora-gateway/ln-lora-spi-dev.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +port1=/sys/devices/platform/mts-io/ap1 +port2=/sys/devices/platform/mts-io/ap2 + +lora_hw=$(mts-io-sysfs show lora/hw-version 2> /dev/null) + +if [ -d $port1 ] && [[ $(cat $port1/hw-version) = $lora_hw ]]; then + ln -sf /dev/spidev32766.2 /dev/spidev0.0 +elif [ -d $port2 ] && [[ $(cat $port2/hw-version) = $lora_hw ]]; then + ln -sf /dev/spidev32765.2 /dev/spidev0.0 +fi -- cgit v1.2.3