Cannot get WLAN to work

I have a new installation of FreeBSD on a PC with a built in Qualcomm Atheros wireless adapter. I am having trouble with connecting it to the network and Internet, having followed many instructions in the Handbook and these forums but still without luck. I also have FreeBSD on a different machine connected to the same network and that one worked fine out of the box, and I attempted to use those same settings on this Atheros one but still no.

At this point I can't tell what's wrong, so any help is appreciated: these are the relevant console outputs:
  • The output of ping -c2 www.freebsd.org is:
    Code:
    ping: cannot resolve www.freebsd.org: Name does not resolve
  • The output of sysctl net.wlan.devices is:
    Code:
    net.wlan.devices: ath0
  • The output of pciconf -lv | grep -A1 -B3 network is:
Code:
ath0@pci0:3:0:0:     class=0x028000 rev=0x01 hdr=0x00 vendor=0x168c device=0x002b subvendor=0x144f subdevice=0x7159
     vendor = 'Qualcomm Atheros'
     device = 'AR9285 Wireless Network Adapter (PCI-Express)'
     class = network
  • The output of ifconfig is:
Code:
lo0: flags=8049<UP, LOOPBACK, RUNNING, MULTICAST> metric - mtu 16384
     options=680003<RXCSUM, TXCSUM, LINKSTATE, RXCSUM_IPV6, TXCSUM_IPV6>
     inet6 ::1 prefixlen 128
     inet 127.0.0.1 netmask 0xff000000
     groups: lo
     nd6 options=21<PERFORMNUD, AUTO_LINKLOCAL>
  • The output of ifconfig wlan0 up list scan is:
    Code:
    ifconfig: interface wlan0 does not exist
  • The /etc/rc.conf file contains:
Code:
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
  • The /etc/wpa_supplicant.conf file is:
Code:
ctrl_interface=/var/run/wpa_supplicant
eapol_version=2
ap_scan=1
fast_reauth=1

network={
     ssid="(my network name)"
     scan_ssid=0
     psk="(my passkey)"
     priority=5
}
network ={
     priority=0
     key_mgmt=NONE
}
 
Thanks, it worked! The auto method didn't do it but the wlan0 interface was made by doing it manually: ifconfig wlan0 create wlandev ath0 and after that a restart of networking services: /etc/rc.d/netif restart && /etc/rc.d/routing restart and voilà.
 
I would check dmesg(8) for clues as to what happened. You didn't mention what release your running, but I know that 14.3 broke the Atheros AR938x, so it wouldn't surprise me if other models were impacted as well.
 
Yep, there is another issue because the next day (i.e. turned system off and on again) the wlan0 once again "does not exist".
/etc/netstart only starts lo0. I have checked and can confirm that all the outputs and config files shown above are still the same thing today.

Again however I can still get it to work and successfully connect using the manual command (as a root only!).

I would check dmesg(8) for clues as to what happened. You didn't mention what release your running, but I know that 14.3 broke the Atheros AR938x, so it wouldn't surprise me if other models were impacted as well.
Thanks for the reminder, this is FreeBSD 13.5 on i386. I should probably upgrade anyway to 14.3.

As for dmesg(8), I didn't spot anything wrong. What I see of relevance there includes:
Code:
ath0: <Atheros 9285> mem 0xf01000000-0xf010ffff irq 17 at device 0.0 on pci1
[ath] AR9285 Main LNA config: LNA2
[ath] AR9285 Alt LNA config: LNA1
[ath] LNA diversity enabled, Diversity enabled
[ath] Enabling diversity for Kite
ath0: [HT] enabling HT modes
ath0: [HT] 1 stream STBC receive enabled
ath0: [HT] 1 RX streams; 1 TX streams
ath0: AR9285 mac 192.2 RF5133 phy 14.0
ath0: 2GHz radio: 0x0000; 5GHz radio: 0x00c0

and at the very end only says lo0: link state changed to UP without any other mention of wlan0.
 
You can try to trace the wlan_up() function located in /etc/network.subr

Bash:
wlan_up()
{
    local -; set -x        # add this, don't forget to remove after.
...
}

Code:
# ifconfig wlan0 destroy
# /etc/netstart
 
You can try to trace the wlan_up() function located in /etc/network.subr

Bash:
wlan_up()
{
    local -; set -x        # add this, don't forget to remove after.
...
}

Code:
# ifconfig wlan0 destroy
# /etc/netstart
Well, yesterday I decided to go and upgrade to the latest FreeBSD version 14.3 (which will also probably be the last for this 32-bit processor). I did a clean install on the disk and guess what: the wireless adapter worked immediately after setup without me having to modify anything. And I can see during the boot process that the wlan0 interface is automatically created and started, as expected.

Maybe there's something that changed in FreeBSD 14? I noticed that the /etc/rc.conf file already has those two lines shown above (which I had to manually put in FreeBSD 13).

Still thanks very much for your help! I do wonder though if your last suggestion may have fixed the issue on that installation? I guess I'll never know.
 
I noticed that the /etc/rc.conf file already has those two lines shown above (which I had to manually put in FreeBSD 13).
If you configured the (wireless) network during the installation, the installer would have added them.
 
If you configured the (wireless) network during the installation, the installer would have added them.
I see, but from what I remember I had it configured during the FBSD 13 install too. I'm sure I wouldn't have skipped over that step.
 
I do wonder though if your last suggestion may have fixed the issue on that installation? I guess I'll never know.
It was just to trace the function to see the values of the variables. My guess is that you didn't copy/paste from the rc.conf on the machine and that there was a typo in wlans_ and we wouldn't have seen anything. I don't see an other reason here. Although, it is possible that there is a bug, in this case it seems too unlikely.
 
Back
Top