MATE Mate on 10.2 Release WI-FI problems

Configuration for BCM4313

  • Configuration

    Votes: 0 0.0%
  • automation

    Votes: 0 0.0%

  • Total voters
    0
Key Notes: Network Discovery, Network Analyzer, Network Adaptors

Well, installed Mate on 10.2 Release and cannot get my WI-FI working. Any suggestions would be deeply appreciated. So my code will return:

alc0:alc.0: Atheros AR8152 v2.0 PCIe Fast Ethernet

Code:
                          Revised see next post


Other subjects may be pertinent to my post:

Probably C and C++ programming is not as quick as we may Bash into it! Here it is (not really) in reference to:

https://forums.freebsd.org/threads/22043/

https://forums.freebsd.org/threads/44211/
 
Last edited:
Confusion here since the Atheros AR8152 v2.0 PCIe Fast Ethernet is the wired LAN controller (wired network) while the wireless device is:
BCM4313 802.11b/g/n Wireless LAN Controller -- not attached!

This device requires manual intervention as it is not installed!

Next is try on the subject: (or just changing the adaptor)

https://forums.freebsd.org/threads/26616/
https://forums.freebsd.org/threads/33728/
https://forums.freebsd.org/threads/22251/

The code here was tested on Acer 5749, Dell Latitude E6500 and a 1U HP DL360G5 - an upgrade to prior version.


ALL NETWORK ADAPTERS:
-------------------------------------------------------------------------------
alc0:alc.0: Atheros AR8152 v2.0 PCIe Fast Ethernet:Hooked
none2:none.2: BCM4313 802.11b/g/n Wireless LAN Controller:not attached
-------------------------------------------------------------------------------
Code:
#!/bin/sh

# some vars to work with
NCD_tmp="NCD_tmp.txt"; WCD_tmp="WCD_tmp.txt"; WCD_run="NCD"; i=""; j=""; c=0;

NCD_rmt(){
  # start fresh
  NCD_run="$1"
  if [ "$NCD_run" == "NCD" ] ; then
  if [ -e "$NCD_tmp" ]; then
  rm $NCD_tmp
  touch $NCD_tmp
  sleep 1
  fi
  fi
  if [ "$NCD_run" == "WCD" ] ; then
  if [ -e "$WCD_tmp" ]; then
  rm $WCD_tmp
  touch $WCD_tmp
  sleep 1
  fi
  fi
}

# 02  Network Controller Device
NCD_src=`sysctl -a dev | grep class=0x02`

NCD_rmt $WCD_run

for i in $NCD_src; do
  echo ${i} >> $NCD_tmp
done

i="";
NCD_fld=$(grep ":" $NCD_tmp | awk -F : '{ print $1 }')

if [ ! -z "$NCD_fld" ]; then
  NCD_rmt $WCD_run
  for i in $NCD_fld; do
  NCD_dev=$(echo ${i} | cut -d'.' -f2)
  NCD_cnt=$(echo ${i} | cut -d'.' -f3)
  NCD_dsc=$(sysctl -a dev.${NCD_dev}.${NCD_cnt}.%desc | cut -d':' -f2)
  echo "${NCD_dev}${NCD_cnt}:${NCD_dev}.${NCD_cnt}:${NCD_dsc}:Hooked" >> $NCD_tmp
  done
fi

# lets run pciconf
WCD_run="WCD"; i="";
WCD_src=`pciconf -lv | grep class=0x02`

NCD_rmt $WCD_run

for i in $WCD_src; do
  echo ${i} >> $WCD_tmp
done

i="";
WCD_fld=$(grep ":" $WCD_tmp | awk -F : '{ print $1 }')

if [ ! -z "$WCD_fld" ]; then
  WCD_xmp=$(grep ":" $NCD_tmp | awk -F : '{ print $1 }')

  for i in $WCD_fld; do
  WCD_nme=$(grep "${i}" $WCD_tmp)
  WCD_sta=$(pciconf -a ${WCD_nme} | cut -d' ' -f2 -f3 -f4)

  # device
  WCD_dsc=$(pciconf -lv ${WCD_nme} | grep device)
  WCD_dsc=$(echo ${WCD_dsc} | cut -d'=' -f2)
  WCD_dsc=$(echo "$WCD_dsc" | sed "s/\'//g")

  WCD_pci=$(echo ${i} | cut -d'@' -f1)
  NCD_res=$(grep "${WCD_pci}" $NCD_tmp)

  # if no results from grep, should be a new device
  if [ -z "$NCD_res" ]; then

  # This will not work if double digits
  WCD_max=9
  for j in $(seq 1 $WCD_max); do

  if [ ! -z $(echo ${WCD_pci} | grep ${j}) ]; then
  WCD_two=$(echo "$WCD_pci" | sed "s/$j/\.$j/g")
  echo "${WCD_pci}:${WCD_two}:${WCD_dsc}:${WCD_sta}" >> $NCD_tmp
  fi

  done
  fi
  done
fi
  if [ -e "$WCD_tmp" ]; then
  rm $WCD_tmp
  sleep 1
  fi

# Example usage of data colected in tmp file:

XMP_exm(){
  i=""
  NCD_xmp=$(grep ":" $NCD_tmp | awk -F : '{ print $1 }')
  echo ""
  echo "-------------------------------------------------------------------------------"

  for i in $NCD_xmp; do
  c=`expr $c + 1`
  XMP_dsc=$(grep "${i}" $NCD_tmp | awk -F : '{ print $3 }')
  echo "[${c}] [${i}] ${XMP_dsc}"
  done
  echo ""
  echo "Select Network Controller Device to work with"
  echo "Enter the number coresponding to network device listed above (default [1]):"
  read XMP_sel

  if [ -z "$XMP_sel" ]; then
  XMP_sel=1
  fi

  echo "Selection made is: "${XMP_sel}
  echo ""
}

XMP_exm
echo ""
echo "ALL NETWORK ADAPTERS:"
echo "-------------------------------------------------------------------------------"
cat $NCD_tmp
echo "-------------------------------------------------------------------------------"
 
Just an update on this code (tested only on one machine) -- Well freebsd 10.2 is not there neither Mate.

Moved to another tread: https://forums.freebsd.org/threads/55707/

Code:
#!/bin/sh

# some vars to work with
NCD_tmp="NCD_tmp.txt"; WCD_tmp="WCD_tmp.txt"; WCD_run="NCD"; i=""; j=""; c=0;

NCD_rmt(){
  # start fresh
  NCD_run="$1"
  if [ "$NCD_run" == "NCD" ] ; then
  if [ -e "$NCD_tmp" ]; then
  rm $NCD_tmp
  touch $NCD_tmp
  sleep 1
  fi
  fi
  if [ "$NCD_run" == "WCD" ] ; then
  if [ -e "$WCD_tmp" ]; then
  rm $WCD_tmp
  touch $WCD_tmp
  sleep 1
  fi
  fi
}

# 02  Network Controller Device
NCD_src=`sysctl -a dev | grep class=0x02`

NCD_rmt $WCD_run

for i in $NCD_src; do
  echo ${i} >> $NCD_tmp
done

i="";
NCD_fld=$(grep ":" $NCD_tmp | awk -F : '{ print $1 }')

if [ ! -z "$NCD_fld" ]; then
  NCD_rmt $WCD_run
  for i in $NCD_fld; do
  NCD_dev=$(echo ${i} | cut -d'.' -f2)
  NCD_cnt=$(echo ${i} | cut -d'.' -f3)
  NCD_dsc=$(sysctl -a dev.${NCD_dev}.${NCD_cnt}.%desc | cut -d':' -f2)
  echo "${NCD_dev}${NCD_cnt}:${NCD_dev}.${NCD_cnt}:${NCD_dsc}:Hooked" >> $NCD_tmp
  done
fi

# lets run pciconf
WCD_run="WCD"; i="";
WCD_src=`pciconf -lv | grep class=0x02`

NCD_rmt $WCD_run

for i in $WCD_src; do
  echo ${i} >> $WCD_tmp
done

i="";
WCD_fld=$(grep ":" $WCD_tmp | awk -F : '{ print $1 }')

if [ ! -z "$WCD_fld" ]; then
  WCD_xmp=$(grep ":" $NCD_tmp | awk -F : '{ print $1 }')

  for i in $WCD_fld; do
  WCD_nme=$(grep "${i}" $WCD_tmp)
  WCD_sta=$(pciconf -a ${WCD_nme} | cut -d' ' -f2 -f3 -f4)

  # device
  WCD_dsc=$(pciconf -lv ${WCD_nme} | grep device)
  WCD_dsc=$(echo ${WCD_dsc} | cut -d'=' -f2)
  WCD_dsc=$(echo "$WCD_dsc" | sed "s/\'//g")

  WCD_pci=$(echo ${i} | cut -d'@' -f1)
  NCD_res=$(grep "${WCD_pci}" $NCD_tmp)

  # if no results from grep, should be a new device
  if [ -z "$NCD_res" ]; then

  # This will not work if double digits
  WCD_max=9
  for j in $(seq 1 $WCD_max); do

  if [ ! -z $(echo ${WCD_pci} | grep ${j}) ]; then
  WCD_two=$(echo "$WCD_pci" | sed "s/$j/\.$j/g")
  echo "${WCD_pci}:${WCD_two}:${WCD_dsc}:${WCD_sta}" >> $NCD_tmp
  fi

  done
  fi
  done
fi
  if [ -e "$WCD_tmp" ]; then
  rm $WCD_tmp
  sleep 1
  fi

# Example usage of data colected in tmp file:

XMP_exm(){
  i=""
  NCD_xmp=$(grep ":" $NCD_tmp | awk -F : '{ print $1 }')
  echo ""
  echo "-------------------------------------------------------------------------------"

  for i in $NCD_xmp; do
  c=`expr $c + 1`
  XMP_dsc=$(grep "${i}" $NCD_tmp | awk -F : '{ print $3 }')
  echo "[${c}] [${i}] ${XMP_dsc}"
  done
  echo ""
  echo "Select Network Controller Device to work with"
  echo "Enter the number coresponding to network device listed above (default [1]):"
  read XMP_sel

  if [ -z "$XMP_sel" ]; then
  XMP_sel=1
  fi

  echo "Selection made is: "${XMP_sel}
  echo ""
  i=""; c=0;
  XMP_xmp=$(grep ":" $NCD_tmp | awk -F : '{ print $1 }')

  for i in $XMP_xmp; do
  c=`expr $c + 1`
  if [ "$XMP_sel" -eq "$c" ] ; then
  # lets get some info on selection
  XMP_con=$(grep "${i}" $NCD_tmp | awk -F : '{ print $4 }')
  XMP_dsc=$(grep "${i}" $NCD_tmp | awk -F : '{ print $3 }')
  XMP_dev=$(grep "${i}" $NCD_tmp | awk -F : '{ print $1 }')
  fi
  done

  XMP_sta=$(pciconf -lv ${XMP_dev} | grep -i device | cut -d'=' -f2)
  XMP_cek="Wired"
  for i in $XMP_sta; do
  if [ "$i" == "Wireless" ] ; then
  XMP_cek="Wireless"
  fi
  done
  XMP_err="none"
  if [ "$XMP_con" != "Hooked" ] ; then
  XMP_err="Error: device selected is not attached to system -- manual intervention required"
  XMP_dev=""; XMP_dsc=""; XMP_con="";
  fi

  echo ""
  echo "ALL NETWORK ADAPTERS:"
  echo "-------------------------------------------------------------------------------"
  cat $NCD_tmp
  echo "-------------------------------------------------------------------------------"
  echo ""
  echo "SELECTED DEVICE:"
  echo "-------------------------------------------------------------------------------"
  echo "${XMP_dev} ${XMP_dsc} ${XMP_con} ${XMP_cek}"
  echo "-------------------------------------------------------------------------------"

  CON_funk $XMP_err $XMP_cek $XMP_dev

}

CON_funk(){
  i=""
  CON_err="$1"
  CON_cek="$2"
  CON_dev="$3"
  CON_arr=$(grep ":" $NCD_tmp | awk -F : '{ print $1 }')

  if [ "$CON_cek" == "Wireless" ] ; then
  if [ "$CON_err" == "none" ] ; then
  # bring down all interfaces
  ifconfig wlan0 down
  for i in $CON_arr; do
  ifconfig $i down
  sleep 1
  done

  # bring up selected device
  ifconfig $CON_dev up

  # connection
  ifconfig $CON_dev

  ifconfig wlan0 destroy
  ifconfig wlan0 create wlandev ${CON_dev}
  ifconfig wlan0 inet 10.40.1.129 netmask 255.255.255.0 ssid AHR-50

  ifconfig wlan0 up list scan
  sleep 3
   
  ifconfig ${CON_dev}; echo ""; echo "";
  ifconfig wlan0; echo ""; echo "";

  # restart
  wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf -D bsd
  #/etc/rc.d/netif restart wlan0
  #/etc/rc.d/wpa_supplicant restart wlan0
  else
  echo ${CON_err}
  fi

  else
  echo "This script will not process Non Wireless Devices!"
  fi
}

XMP_exm
 
Back
Top