ubports / ubuntu-touch

Ubuntu Touch's issue inbox is now migrated to GitLab.
https://gitlab.com/ubports/ubuntu-touch
1.28k stars 110 forks source link

Hammerhead: Some Wifi networks don't appear #714

Open Clae224 opened 6 years ago

Clae224 commented 6 years ago

Steps to reproduce

Scan for WiFi networks.

Expected behavior

All networks that other devices can see should be shown.

Actual behavior

Some networks (my home wifi) cannot be seen.

Logfiles and additional information

Running sudo iwlist wlan0 scan shows neighbour's Wifi but not my home wifi.

Wifi scan from Nexus 5:

wlan0 Scan completed :
          Cell 01 - Address: 
44:94:FC:16:BA:D4
                    Channel:1
                    Frequency:2.412 
GHz (Channel 1)
                    Quality=21/70 
Signal level=-89 dBm
                    Encryption 
key:on
                    ESSID:"NETGEAR48" //Not my wifi
                    Bit Rates:1 
Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 
Mb/s
                              24 
Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 
Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000000123c47fcd
                    Extra: Last 
beacon: 40ms ago
                    IE: Unknown: 
00094E4554474541523438
                    IE: Unknown: 
010882848B962430486C
                    IE: Unknown: 
030101
                    IE: Unknown: 
2A0100
                    IE: Unknown: 
2F0100
                    IE: IEEE 
802.11i/WPA2 Version 1
                        Group Cipher 
: CCMP
                        Pairwise 
Ciphers (1) : CCMP
                        Authentication 
Suites (1) : PSK
                    IE: Unknown: 
32040C121860
                    IE: Unknown: 
2D1AFC181BFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 
3D1601080400000000000000000000000000000000000000
                    IE: Unknown: 
DD850050F204104A0001101044000102103B000103104700106A84AB5F3370F76CF3A1C8208CF80D8B102100074E6574676561721023000A44474E443337303076321024000A44474E4433373030763210420004313233341054000800060050F20400011011000A44474E4433373030763210080002200C103C0001031049000600372A000120
                    IE: Unknown: 
DD090010180203F02C0000
                    IE: Unknown: 
DD180050F2020101800003A4000027A4000042435E0062322F00

Working wifi scan:

wlx18d6c7074182  Scan completed :
          Cell 01 - Address: 50:01:D9:87:62:E4
                    Channel:13
                    Frequency:2.472 GHz (Channel 13)
                    Quality=26/70  Signal level=-84 dBm  
                    Encryption key:on
                    ESSID:"[my wifi]"
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=00000095d33e16b0
                    Extra: Last beacon: 32ms ago
                    IE: Unknown: 00094A6572727957694669
                    IE: Unknown: 010882840B162430486C
                    IE: Unknown: 03010D
                    IE: Unknown: 2A0104
                    IE: Unknown: 2F0104
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 32040C121860
                    IE: Unknown: 2D1ABC1917FFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D160D080400000000000000000000000000000000000000
                    IE: Unknown: 4A0E14000A002C01C800140005001900
                    IE: Unknown: 7F080500000000000040
                    IE: Unknown: DD090010180207000C0000
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F2020101840003A4000027A4000042435E0062322F00
                    IE: Unknown: 46057208010000
          Cell 02 - Address: FA:8F:CA:8D:3D:B3
                    Channel:13
                    Frequency:2.472 GHz (Channel 13)
                    Quality=12/70  Signal level=-98 dBm  
                    Encryption key:off
                    ESSID:"" //chromecast or something?
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s
                    Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=00000095d3366140
                    Extra: Last beacon: 232ms ago
                    IE: Unknown: 0000
                    IE: Unknown: 010882848B960C121824
                    IE: Unknown: 03010D
                    IE: Unknown: 05050102000000
                    IE: Unknown: 2A0100
                    IE: Unknown: 2D1A2C0103FF000000000000000000000000000000000008E0E10900
                    IE: Unknown: 32043048606C
                    IE: Unknown: 3D160D080000000000000000000000000000000000000000
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
          Cell 03 - Address: 44:94:FC:16:BA:D4
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=8/70  Signal level=-102 dBm  
                    Encryption key:on
                    ESSID:"NETGEAR48" //not my wifi
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000023ab0be4546
                    Extra: Last beacon: 40ms ago
                    IE: Unknown: 00094E4554474541523438
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 030101
                    IE: Unknown: 2A0100
                    IE: Unknown: 2F0100
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 32040C121860
                    IE: Unknown: 2D1AFC181BFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D1601080400000000000000000000000000000000000000
                    IE: Unknown: DD850050F204104A0001101044000102103B000103104700106A84AB5F3370F76CF3A1C8208CF80D8B102100074E6574676561721023000A44474E443337303076321024000A44474E4433373030763210420004313233341054000800060050F20400011011000A44474E4433373030763210080002200C103C0001031049000600372A000120
                    IE: Unknown: DD090010180202F02C0000
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00
          Cell 04 - Address: 00:60:64:97:BE:B0
                    Channel:6
                    Frequency:2.437 GHz (Channel 6)
                    Quality=6/70  Signal level=-104 dBm  
                    Encryption key:on
                    ESSID:"Slingshot Home WIFI 877" //not my wifi but sometimes phone can see this network too
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 18 Mb/s
                              24 Mb/s; 36 Mb/s; 54 Mb/s
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 48 Mb/s
                    Mode:Master
                    Extra:tsf=0000041b772e8ab8
                    Extra: Last beacon: 19972ms ago
                    IE: Unknown: 0017536C696E6773686F7420486F6D65205749464920383737
                    IE: Unknown: 010882848B962430486C
                    IE: Unknown: 030106
                    IE: Unknown: 2A0104
                    IE: Unknown: 2F0104
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 32040C121860
                    IE: Unknown: 2D1A7C181BFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D1606000400000000000000000000000000000000000000
                    IE: Unknown: DD090010180202F0040000
                    IE: Unknown: DD180050F2020101800003A4000027A4000042435E0062322F00

nmcli -p d shows wlan0 (wifi) as 'disconnected'.

dmesg | grep -i bcmdhd shows a few Complied in drivers/net/wireless/bcmdhd on etc. messages, no errors.

I can turn off/on wifi with the UI buttons. My home wifi is 2.4 Ghz and I've tried to disconnect other devices off the Wifi, as well as entering the wifi info as if it were a hidden network in settings.

Maybe there is a problem with 2.4GHz channel 13 Wifi?

Clae224 commented 6 years ago

I just changed my Wifi router's channel to 1 and it could see and connect to the network!

Moreover, changing the network back to channel 13 drops the connection but also makes it invisible to the device.

Can someone else test if they can connect to a channel 13 wifi hotspot? I set my laptop to a hotspot on channel 13 and the phone could still connect, so maybe it's just a very corner-case compatibility issue with my router/device. In any case, a workaround would just be to change the channel of the wifi access point.

Flohack74 commented 6 years ago

Probably its the international settings that are not applied correctly on the phone. Channel 13 is not allowed everyhwere: grafik

doniks commented 6 years ago

Could it be related to hardware and/or modem firmware? @Clae224 do you know whether it works with android on this particular device?

Clae224 commented 6 years ago

@doniks It worked under android on this device.

@Flohack74 There seems to be a problem with the wifi software in general... I switched language to English UK and rebooted and now the wifi module seems to be broken. In wifi settings, there was no button for wifi toggle on/off. After rebooting again and changing the language back, the wifi module seems to be somewhat functional... the toggle on/off is present now but I cant even use iwlist scan - it returns wlan0 Interface doesn't support scanning : Network is down and nmcli -p d returns wlan0 as unavailable. No wifi networks are visible from setting either.

Edit: running dmesg | grep -i bcmdhd gives Complied in etc. No errors. I've tried rebooting and setting the phone to US English and even German (Germany) for the hell of it. No dice, same unavailable wifi and no errors that I can find. On another note, there seems to be some places where translations are missing/patchy.

JOduMonT commented 6 years ago

I also have an issue like this but with Ubuntu 15.04 (r3) on LGE Nexus 5

I also leave in Switzerland where they often use the channel 13. But my phone seams to just not detect any 5GHz AP

I put my 2.4GHz on the channel 13 and it become inaccessible on the phone

but anyway; it's not really recommended to choose extremity channel like 1 or 13

Might be related, during the installation I choose English US, because I'm an expat and don't speak German and won't my phone in French.

Now, I'll probably open a new issue for my 5GHz behavior ;)

Flohack74 commented 6 years ago

The language selection does not influence the WiFI regulatory domain at all... Its just a language, not a country selector. To be fair this problem is inherited from upstream Ubuntu, I do not think that you can select the WiFi regulatory domains there either...

JOduMonT commented 6 years ago

@Flohack74 you probably right; but what I was trying to point it's more in Switzerland channel 13 is available by default, so I tried and It wasn't working, so I was saying, maybe it's because I choose English as language, but if the language is not a country selector than ubuntu-touch have an issue with the channel 13.

BTW It's works fine on my laptop which have Ubuntu 16.04 than 18.04.

My second point is Ubuntu Touch seams not able to see 5GHz which is might @Clae224 issue too, because none of the networks expose by the scan are 5GHz

UniversalSuperBox commented 5 years ago

5Ghz Wi-Fi troubles appear to be a problem for all Nexus 5's after the 5.0 update: https://forum.xda-developers.com/google-nexus-5/help/finding-5ghz-wifi-signal-t2512372

Users in that thread had success by changing their 5Ghz Wi-Fi to certain channels. If this is the case on Android, I wonder if there's anything we can do about it in Ubuntu Touch.

I wonder if this could be related to #1018... My device disconnects when my network attempts to band-steer it to 5Ghz from 2.4.

Clae224 commented 5 years ago

@UniversalSuperBox

If it's a problem introduced by a later baseband/radio firmware, it's possible that flashing a pre-5.0 version of that can fix the problem. Google provides all current and historical factory images for their android devices.

I don't have Ubuntu Touch on my N5 right now so I can't test this.

frgigr commented 4 years ago

Hi everyone,

I have just run into this issue with a Nexus 5, but let me add some extra details. I had the wifi working without issues for months; yesterday I tried to turn the mobile on but it stopped during booting, because the battery was low-charged (I forgot it).

After charging it, this morning I couldn't connect to my home wifi anymore because it was undetected, although present among Previous networks list (deleting from there didn't help..the same with the command sudo service network-manager restart or with several reboots)

Then I tried using my primary mobile with the hotspot on and the Nexus 5 managed to connect to it

Flohack74 commented 4 years ago

Have you checked ifconfig, if there is a WiFi adapter listed?

frgigr commented 4 years ago

Have you checked ifconfig, if there is a WiFi adapter listed?

By running ifconfig, I can only see the local loopback lo and the wlan0 Does this answer your question?

Flohack74 commented 4 years ago

Yes so wlan0 is the one we are looking for. If there is wlan0, can you type ifconfig wlan0 and paste the result here (excluding your MAC addy)? BTW do you have a SIM card in the device?

frgigr commented 4 years ago

Ok, cool! No SIM card is in the device (since it is my secondary one) and below you can find the output, which seems to be reasonable: Link encap: Ethernet UP BROADCAST MULTICAST MTU: 1500 Metric: 1 RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0 TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0 collisions: 0 txqueuelen: 1000 RX bytes: 0 (0.0 B) TX bytes: 0 (0.0 B)

Flohack74 commented 4 years ago

Well that looks like the kernel driver is there, but the WiFi is not being allocated by network manager. No idea what that can be. Can you also please gibe the output of rfkill list

frgigr commented 4 years ago

Yes, sure! If the wifi is turned off: 0: phy0: Wireless LAN Soft blocked: yes Hard blocked: no 1: brcmfmac-wifi: Wireless LAN Soft blocked: yes Hard blocked: no 2: hci0: Bluetooth Soft blocked: yes Hard blocked: no When turning wifi on, the two "yes" in 0 and 1 turned to "no", as expected!

UPDATE: I don't know how it is possible, but now home Wifi is detected again with N5 at 6% of battery left! Yesterday I factory-resetted the N5, tried sudo iwlist wlan0 scan and wpa_cli to scan networks available, but nothing! Moreover, wpa_cli reported: "_Could not connect to wpasupplicant: (nil) - retrying" I'm going to turn it off and charge it! Let's see what happens..

UPDATE 2: It seems Wifi totally recovered by itself: everything works as before! I don't have an explanation for that

frgigr commented 4 years ago

Hi guys, Sorry to bother you again, but I ran into the issue in the same way as before..However, I googled a bit more and I have something to share..maybe it could help:

My home Wi-Fi is set on channel 13 and I used two devices: a Nexus 5 (which cannot connect) and a BQ E4.5 (which can do it)

Well..the command iwlist wlan0 freq shows all the available frequencies on the phone and among them,

As many of you already said, channels 12, 13 and 14 are not allowed all over the world, so the choice of enabling them has to rely on the country selector, I suppose..

By checking with iw reg get, it seems there is no specific country selected on both devices, with only the code 00 being set (it should mean all world); however, I found only one difference in the following line (I don't know if it is important):

On both devices it seems it is missing the package crda and that's the reason why, creating the file /etc/modprobe.d/cfg80211.conf with the content options cfg80211 ieee80211_regdom=IT didn't fix the issue on Nexus 5, as well as the command iw reg set IT

So, at the end of the story, it seems that on N5 the country selector isn't working properly..the obvious question would be: how do the N5 know when turning channels 12, 13 and 14 on/off? And how can this setting "vanish" suddenly?

Moreover, by googling a bit more, it seems that this issue is also there with Android and it was solved by putting a SIM card in the device: unfortunately I can't have a microSIM to test it..can anyone do it?

The last fact seems to imply that a SIM card can allow selection of a country that Wi-Fi can't..is that possible? Finally, I checked in Location Settings and the only option is by using internal GPS..is A-GPS available when connected to Wi-Fi?

Sorry for the long post, hoping it helps somehow..

Flohack74 commented 4 years ago

Sorry to say, but CRDA sellection does not work at all on UT. I have no easy fix for this, it is unknown whats needed for it neither there is any API that could do it.