helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
806 stars 58 forks source link

Atheros AR9485 does not work out of the box #330

Closed probonopd closed 2 years ago

probonopd commented 2 years ago

Atheros AR9485 does not work out of the box.

pciconf -lv | grep -B3 network
ath0@pci0:2:0:0: class=0x028000 rev=0x01 hdr=0x00 vendor=0x168c device=0x0032 subvendor=0x1a3b subdevice=0x2086
vendor = 'Qualcomm Atheros'
device = 'AR9485 Wireless Network Adapter'
class = network

Source: https://twitter.com/baggetun/status/1464568702200913920

Any help appreciated. (I don't have this device.)

rbag commented 2 years ago

I boot the iso again today. I found that "ifconfig wlan0 scan" does work and gives me a list of networks. So FreeBSD identify it and let me scan.

If I open /Applications/Preferences/Wireless Networks.app I also see Adapter: wlan0, but there is no entries in Networks drop down list. If I click Scan and then Scan again in the new window nothing appears, but I can see the following in Logs: Nov 28 06:00:34 UX31E wpa_supplicant[2712]: ioctl[SIOCS80211, op=103, val=0, arg_len=128]: Operation now in progress Nov 28 06:00:34 UX31E wpa_supplicant[2712]: wlan0: CTRL-EVENT-SCAN-FAILED ret=-1

I will wait for the next release and try again.

probonopd commented 2 years ago

Thanks for the update rbag. Unfortunately I don't have a Atheros AR9485 device so I can't test. if anyone knows what needs to be changed to make it work, please let me know. Thanks!

rbag commented 2 years ago

After setting the correct regdomain with ifconfig I can now scan and connect with Wireless Networks.app again.

sudo ifconfig wlan0 down sudo ifconfig wlan0 regdomain ETSI country NO sudo ifconfig wlan0 up

probonopd commented 2 years ago

Out of curiosity, it would be interesting to know what happens(on the Live system, not installed) when you just do

sudo ifconfig wlan0 down
sudo ifconfig wlan0 up

without the sudo ifconfig wlan0 regdomain ETSI country NO.

rbag commented 2 years ago

You are right, no need to set the regdomain. Down and up is enough.

sudo ifconfig wlan0 down
sudo ifconfig wlan0 up
probonopd commented 2 years ago

Now, what happens if you only run

sudo ifconfig wlan0 up

on a freshly booted Live ISO?

0hip commented 2 years ago

Down and Up did it for me.!! Up only didn't.

PC with Ralink RT2500 802.11bg (before this I was not able to get it working). TOSHIBA SATELLITE S55t with Intel AC 3160 (before this I only got it working by pressing Fn+F12 keys). Both running on a freshly booted Live ISO: hello-0.7.0_0G140-FreeBSD-13.0-amd64. Complete shutdown after each test.

rbag commented 2 years ago

Now, what happens if you only run

sudo ifconfig wlan0 up

on a freshly booted Live ISO?

No, it does not work with only 'up'.

This is what I did after booting live:

% dmesg | grep ath0
ath0: <Atheros AR9485> mem 0xdea00000-0xdea7ffff irq 17 at device 0.0 on pci2
ath0: configuring for CUS198
ath0: Bluetooth Antenna Diversity card detected
ath0: [HT] enabling HT modes
ath0: [HT] enabling short-GI in 20MHz mode
ath0: [HT] 1 stream STBC receive enabled
ath0: [HT] 1 RX streams; 1 TX streams
ath0: AR9485 mac 576.1 RF5110 phy 2582.4
ath0: 2GHz radio: 0x0000; 5GHz radio: 0x0000
% ifconfig            
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
wlan0: flags=8c43<UP,BROADCAST,RUNNING,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 74:2f:68:cb:b5:fd
        inet6 fe80::762f:68ff:fecb:b5fd%wlan0 prefixlen 64 scopeid 0x2
        groups: wlan
        ssid "" channel 6 (2437 MHz 11g)
        regdomain FCC country US indoor ecm authmode OPEN privacy OFF
        txpower 30 bmiss 7 scanvalid 60 protmode CTS wme burst
        parent interface: ath0
        media: IEEE 802.11 Wireless Ethernet autoselect (autoselect)
        status: no carrier
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

As you can see in the next command I can scan using ifconfig

% ifconfig wlan0 scan
SSID/MESH ID                      BSSID              CHAN RATE    S:N     INT CAPS
Telenor2982ror                    90:f8:91:9b:18:af    1   54M  -79:-96   100 EP   RSN BSSLOAD HTCAP WPS WME
Telenor1633her                    90:f8:91:c0:4f:41    6   54M  -90:-96   100 EP   RSN BSSLOAD HTCAP WPS WME

% sudo ifconfig wlan0 up

If I open Wireless Networks app after the "up" command I cannot scan or add any networks

% sudo ifconfig wlan0 down
% sudo ifconfig wlan0 up  

Now after doing down and up I can scan and add network in Wireless Networks app

ifconfig to show I am finally connected

% ifconfig 
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
        inet6 ::1 prefixlen 128
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
        inet 127.0.0.1 netmask 0xff000000
        groups: lo
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 74:2f:68:cb:b5:fd
        inet6 fe80::762f:68ff:fecb:b5fd%wlan0 prefixlen 64 scopeid 0x2
        inet6 2001:4649:e12d:0:762f:68ff:fecb:b5fd prefixlen 64 autoconf
        inet 10.0.0.19 netmask 0xffffff00 broadcast 10.0.0.255
        groups: wlan
        ssid Telenor2982ror channel 1 (2412 MHz 11g ht/20) bssid 90:f8:91:9b:18:af
        regdomain FCC country US indoor ecm authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60
        protmode CTS ampdulimit 64k ampdudensity 8 shortgi -stbctx stbcrx
        -ldpc -uapsd wme burst roaming MANUAL
        parent interface: ath0
        media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
        status: associated
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
% 
probonopd commented 2 years ago

OK, so can we conclude that Network.app should do

sudo ifconfig wlan0 down
sudo ifconfig wlan0 up  

when it is started?

rbag commented 2 years ago

Do it for the next release and let us test :-)

I also tested with an Intel (iwm driver) based laptop, and I needed to do the down and up there too.

probonopd commented 2 years ago

Will be in the next build of the experimental ISO.

0hip commented 2 years ago

https://cgit.freebsd.org/src/commit/?id=5fcdc19a81115d975e238270754e28557a2fcfc5 wpa: Address CTRL-EVENT-SCAN-FAILED May it be related to this behaviour?

step 1 After ifconfig DOWN and UP y was able to scan and connect to internet :) step 2 I was also able to reproduce again the issue with: netif stop wlan0 netif start wlan0 result: scan does not work step 3 jumped to step 1

I did it 5 times with the results as stated. Tested with hello-0.7.0_0G147-FreeBSD-13.0-amd64.iso

probonopd commented 2 years ago

What happens if you run 0G147 and then just run Applications -> Under Construction -> Network? Can you see the list of networks in the menu? (Without running any command line tools)

0hip commented 2 years ago

Running "Network.app" there is no list of networks. Clicking "Rescan Networks" does nothing. IMG_20211201_132601_2-H1080

Then I open terminal and after ifconfig DOWN and UP then clicking "Rescan Networks" the list is populated. IMG_20211201_133104_2-H1080

I have done this many times just to be sure. PD. The same thing happens with "Wireless Network.app"

probonopd commented 2 years ago

Now this is strange... because it should be running automatically now:

https://github.com/helloSystem/Utilities/blob/9ef3b10db3847ff37026688b4b06f2e3dc64b01d/Under%20Construction/Network.app/Network#L378-L388

rbag commented 2 years ago

0H147 : Applications -> Under Construction -> Network

Works for me with my ath0 wireless adapter. I will test on my Intel laptop later. 20211201_210216

0hip commented 2 years ago
  1. __Running the system on my PC
  2. __Launching "Network.app" (for the first time) and after clicking like 3 times "Rescan Networks" I get this (no list)

    IMG_20211201_154249-H1080

3.__Launching "Network.app" again (a second time) and clicking just one time "Rescan Networks" I get this (success!!!)

IMG_20211201_154402-H1080

I did all this One more time waiting after step 2 for about 3 minutes just in case the list could be shown but nothing happened. Did the step 3 and succeeded again. It may be my old PC.

PD. The last 9 red rows in the log appeared when "Network.app" was launched. The second time I launched the app no line was added to the log.

*TOSHIBA SATELLITE S55t with Intel AC 3160: Scanning and connecting is working!!

rbag commented 2 years ago

I will test on my Intel laptop later.

0H147 : Applications -> Under Construction -> Network Scanning and connecting works on my second Intel laptop

probonopd commented 2 years ago

Works for me with my ath0 wireless adapter.

So it seems like we have solved this at least for Atheros, hence closing here. Feel free to open/join the discussion in other tickets regarding other network cards.

Thanks for testing!

SanPollo commented 2 years ago

Just a heads up that this is reproducible with a AR9462 card too. Is the solution, then, that when the Network application is moved from Under Construction, and starts on boot, that the issue will no longer exist?

probonopd commented 2 years ago

Possibly. Just to be sure, does using the Network application work for you also when running from the Live ISO?

SanPollo commented 2 years ago

Yes. Regardless of whether it's the Live ISO or the installed version, to get wifi working I need to either restart the wlan0 interface, or launch the Network application. Then everything starts working (including connecting to previously saved connections).

It doesn't really answer the question of why this is happening when it doesn't on my standard FreeBSD installation, but I guess it's a perfectly good workaround if nobody notices it! 😉