Skip to content

Commit

Permalink
Add 5GHz / 2.4GHz band selection to startup scripts svpcom#7
Browse files Browse the repository at this point in the history
  • Loading branch information
svpcom committed Aug 8, 2017
1 parent 75cbde6 commit 28bd483
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 6 deletions.
24 changes: 21 additions & 3 deletions scripts/rx_standalone.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,35 @@
#!/bin/bash

WLANS=$@
BAND="5G"
#BAND="2G"

CHANNEL2G="6"
CHANNEL5G="149"

for WLAN in $WLANS
do
echo "Setting $WLAN to channel $CHANNEL5G"
ifconfig $WLAN down
iw dev $WLAN set monitor otherbss
iw reg set BO
ifconfig $WLAN up
iw dev $WLAN set bitrates ht-mcs-5 1 sgi-5
iw dev $WLAN set channel $CHANNEL5G HT40+

case $BAND in
"5G")
echo "Setting $WLAN to channel $CHANNEL5G"
iw dev $WLAN set bitrates ht-mcs-5 1 sgi-5
iw dev $WLAN set channel $CHANNEL5G HT40+
;;
"2G")
echo "Setting $WLAN to channel $CHANNEL2G"
iw dev $WLAN set bitrates ht-mcs-2.4 1 sgi-2.4
iw dev $WLAN set channel $CHANNEL2G HT40+
;;
*)
echo "Select 2G or 5G band"
exit -1;
;;
esac
done

./rx $WLANS
25 changes: 22 additions & 3 deletions scripts/tx_standalone.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,33 @@
#!/bin/bash

WLAN=$1

BAND="5G"
#BAND="2G"

CHANNEL2G="6"
CHANNEL5G="149"

echo "Setting $WLAN to channel $CHANNEL5G"
ifconfig $WLAN down
iw dev $WLAN set monitor otherbss
iw reg set BO
ifconfig $WLAN up
iw dev $WLAN set bitrates ht-mcs-5 1 sgi-5
iw dev $WLAN set channel $CHANNEL5G HT40+

case $BAND in
"5G")
echo "Setting $WLAN to channel $CHANNEL5G"
iw dev $WLAN set bitrates ht-mcs-5 1 sgi-5
iw dev $WLAN set channel $CHANNEL5G HT40+
;;
"2G")
echo "Setting $WLAN to channel $CHANNEL2G"
iw dev $WLAN set bitrates ht-mcs-2.4 1 sgi-2.4
iw dev $WLAN set channel $CHANNEL2G HT40+
;;
*)
echo "Select 2G or 5G band"
exit -1;
;;
esac

./tx $WLAN

0 comments on commit 28bd483

Please sign in to comment.