Using WiLink 8 software on BeagleBone Green Wireless

224 views
Skip to first unread message

Gi Soo Kim

unread,
Feb 21, 2018, 9:11:07 PM2/21/18
to BeagleBoard
Hi!

I installed TI SDK + WiLink 8 Software on BBGW using attached PDF file instruction.

I had few question about so far I did on BBGWs

I had major issue with packet forwarding between interfaces

First, I would like to explain how did I set up the network

I would like to extend AP(Phantom_ 6132f6) which is came from DJI drone network

The current DJI drone network is

Drone(Camera hidden SSID : FC200_0176db) <-> Range extender(AP : Phantom_6132f6) <-> User Phone(DJI APP)


What am I going to do is


Drone(Camera hidden SSID : FC200_0176db) <-> Range extender(AP : Phantom_6132f6) <-> [wlan0(STA)-BBGW(1)-mesh0(MESH)] 
[mesh0(MESH)-BBGW(2)-wlan0(AP : Phantom_GS)]<-> User Phone(DJI APP).

Here is what I did so far
BBGW(1) status

run the script

/usr/share/wl18xx/sta_start.sh
#!/bin/sh

if ps -w | grep -v grep | grep wpa_supplicant | grep wlan0 > /dev/null
then
    echo "wpa_supplicant is already running"
    exit 0
fi

if [ ! -f /usr/share/wl18xx/wpa_supplicant.conf ]
then
 if [ ! -f /etc/wpa_supplicant.conf ]
 then
  echo "error - no default wpa_supplicant.conf"
  exit 1
 fi
 cp /etc/wpa_supplicant.conf /usr/share/wl18xx/wpa_supplicant.conf
fi

wpa_supplicant  -e/usr/share/wl18xx/entropy.bin \
        -iwlan0 -Dnl80211 -c/usr/share/wl18xx/wpa_supplicant.conf &


/usr/share/wl18xx/sta-connect_ex.sh Phantom_6132f6
#!/bin/sh

NETID=0
WPA_CLI='wpa_cli -i wlan0'
if [ $# -eq 0 ] || [ "$1" == "--help" ] || [ "$1" == "-h" ]; then
    echo ""
    echo "You must specify at least the network ssid"
    echo "format: $0 <ssid> [key_mgmt] [psk]"
    echo ""
    echo "supported key-mgmt: NONE, WPA-PSK"
    exit
fi

NETID=`$WPA_CLI add_network | grep -v Using | grep -v Selected`

echo "netid="$NETID
echo "========================="
echo $WPA_CLI set_network $NETID ssid \'\""$1"\"\' > /usr/share/wl18xx/temp.txt

if [ $# -gt 1 ]; then
    if [ "$2" == "WPA-PSK" ] || [ "$2" == "NONE" ] ; then
       echo $WPA_CLI set_network $NETID key_mgmt "$2" >> /usr/share/wl18xx/temp.
    else
       echo "Sorry, but only WPA-PSK and NONE key_mgmt is supported"
       exit
    fi
else
    echo $WPA_CLI set_network $NETID key_mgmt NONE >> /usr/share/wl18xx/temp.txt
fi

if [ $# -gt 2 ]; then
    echo $WPA_CLI set_network $NETID psk \'\""$3"\"\' >> /usr/share/wl18xx/temp.
fi


echo $WPA_CLI select_network $NETID >> /usr/share/wl18xx/temp.txt
chmod 777 /usr/share/wl18xx/temp.txt
sh /usr/share/wl18xx/temp.txt
rm /usr/share/wl18xx/temp.txt

#udhcpc -i wlan0


./udhcpc -i wlan0

./mesh_start.sh
MESH=mesh0
### add Mesh interface, if not present
if [ ! -d /sys/class/net/$MESH ]
then
  echo "adding $MESH interface"
  iw phy `ls /sys/class/ieee80211/` interface add $MESH type mp
fi

if ps -w | grep -v grep | grep wpa_supplicant | grep mesh0 > /dev/null
then
    echo "wpa_supplicant is already running(Mesh)"
    exit 0
fi

wpa_supplicant -e/usr/share/wl18xx/entropy.bin \
        -imesh0 -Dnl80211 -c mesh_supplicant.conf &

sleep 1

iw phy phy0 set rts 0

ifconfig mesh0 192.168.2.2 netmask 255.255.255.0


Result
ifconfig
본문 이미지 1
route
본문 이미지 2
iptables
본문 이미지 3
 

BBGW(2) status

run the script

/usr/share/wl18xx/ap_start.sh
#!/bin/sh

########## variables ##########

WLAN=wlan0
WLAN2=wlan2
HOSTAPD_PROC=/var/run/hostapd
HOSTAPD_CONF=/usr/share/wl18xx/hostapd.conf
HOSTAPD_BIN_DIR=/usr/sbin
IP_ADDR=192.168.1.100
IP_ADDR2=192.168.53.1
DHCP_CONF=udhcpd.conf
DHCP_CONF2=udhcpd2.conf
DHCP_CONF_PROC=u[d]hcpd.conf
DHCP_CONF_PROC2=u[d]hcpd2.conf

########## body ##########

### check for configuration file
if [ ! -f $HOSTAPD_CONF ]; then
 if [ ! -f /etc/hostapd.conf ]
 then
  echo "error - no default hostapd.conf file"
  exit 1
 fi
 cp /etc/hostapd.conf $HOSTAPD_CONF
 chmod 777 $HOSTAPD_CONF
fi

### configure ip forewarding
echo 1 > /proc/sys/net/ipv4/ip_forward

### add WLAN interface, if not present
if [ ! -d /sys/class/net/$WLAN ]
then
  echo "adding $WLAN interface"
  iw phy `ls /sys/class/ieee80211/` interface add $WLAN type managed
fi

### start a hostapd interface, if not present
if [ ! -r $HOSTAPD_PROC ]
then
 $HOSTAPD_BIN_DIR/hostapd $HOSTAPD_CONF &
 sleep 1
fi
### configure ip
ifconfig $WLAN $IP_ADDR netmask 255.255.255.0 up
if [ -d /sys/class/net/$WLAN2 ]
then
  ifconfig $WLAN2 $IP_ADDR2 netmask 255.255.255.0 up
fi

### start udhcpd server, if not started
output=`ps | grep /usr/share/wl18xx\$DHCP_CONF_PROC`
set -- $output
echo $output
if [ -z "$output" ]; then
  udhcpd $DHCP_CONF
fi

if [ -d /sys/class/net/$WLAN2 ]
then
  output=`ps | grep /usr/share/wl18xx\$DHCP_CONF_PROC2`
  set -- $output
  echo $output
  if [ -z "$output" ]; then
    udhcpd $DHCP_CONF2
  fi
fi

### configure nat
#iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

./mesh_start.sh
MESH=mesh0
### add Mesh interface, if not present
if [ ! -d /sys/class/net/$MESH ]
then
  echo "adding $MESH interface"
  iw phy `ls /sys/class/ieee80211/` interface add $MESH type mp
fi

if ps -w | grep -v grep | grep wpa_supplicant | grep mesh0 > /dev/null
then
    echo "wpa_supplicant is already running(Mesh)"
    exit 0
fi

wpa_supplicant -e/usr/share/wl18xx/entropy.bin \
        -imesh0 -Dnl80211 -c mesh_supplicant.conf &

sleep 1

iw phy phy0 set rts 0

ifconfig mesh0 192.168.2.1 netmask 255.255.255.0

Result
ifconfig
본문 이미지 4
route
본문 이미지 5
iptables
본문 이미지 6

For the /etc/sysctl.conf on both BBGW
본문 이미지 7
본문 이미지 8
본문 이미지 9

So When I connect to User Phone on BBGW(2) AP : Phantom_GS. It does not show the live stream data
 
Could you help with building network? I can not figure out what is the problem and where should I fix it

It seems like I have to dealing with IP forwarding and configure firewall(iptables?)

Only thing I can verified that mesh network is working nothing else

Thank you
TI Wilink 8 Linux SDK.pdf
Reply all
Reply to author
Forward
0 new messages