2

I have an IPhone(11) with Personal Hotspot turned on. Sometimes I would like to use my IPhone's Personal Hotspot as the internet connection for my laptop running Ubuntu 22.04 - when I'm in a place without wifi. If I try to ask my Ubuntu to connect to this Hotspot, sometimes the Hotspot ("Steve's IPhone") appears on the list of networks to which I can connect and connection is then possible, and sometimes it doesn't appear on the list. There is neither rhyme nor reason I can see as to when this connection will or won't be found. Turning wifi off and back on does not resolve the problem. Nor can the connection be seen with

sudo iwlist wlp4s0 scan | grep ESSID

(wlp4s0 being the interface my wifi is now using accord to ifconfig, though sometimes it shows up as wlan0, another mystery I'd like to understand someday.)

What is the explanation for this odd and inconsistent behavior? And does anyone know a way to force more consistent behavior in wifi connection using this system?

[update] a commenter below suggests that the above is too vague a description, but the vagueness is inherent in the problem. Sometimes it works, sometimes it doesn't, and I am unable to determine why it works or fails. The commenter suggest that it would be better to ask for information on how to troubleshoot this. That is a good idea, so I'll ask:

How might I troubleshoot this?

[Update 2: in response to @telcoM's questions]

Make/model is Lenovo Thinkpad T540 (2014)

$ sudo lspci -s 4:0 -nnv
04:00.0 Network controller [0280]: Intel Corporation Wireless 7260 [8086:08b2] (rev 83)
    Subsystem: Intel Corporation Dual Band Wireless-AC 7260 [8086:c270]
    Flags: bus master, fast devsel, latency 0, IRQ 32
    Memory at f1400000 (64-bit, non-prefetchable) [size=8K]
    Capabilities: [c8] Power Management version 3
    Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
    Capabilities: [40] Express Endpoint, MSI 00
    Capabilities: [100] Advanced Error Reporting
    Capabilities: [140] Device Serial Number e8-2a-ea-ff-ff-15-8a-1f
    Capabilities: [14c] Latency Tolerance Reporting
    Capabilities: [154] Vendor Specific Information: ID=cafe Rev=1 Len=014 <?>
    Kernel driver in use: iwlwifi
    Kernel modules: iwlwifi

$ ethtool -i wlp4s0
driver: iwlwifi
version: 5.15.0-37-generic
firmware-version: 17.3216344376.0 7260-17.ucode
expansion-rom-version: 
bus-info: 0000:04:00.0
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no

$ sudo dmidecode -s system-product-name; sudo dmidecode -s system-sku-number; sudo dmidecode -s system-manufacturer
20BECTO1WW
LENOVO_MT_20BE
LENOVO

$ sudo dmidecode -s bios-version; sudo dmidecode -s bios-release-date
GMET91WW (2.39 )
06/03/2021
7
  • the laptop may be too close to the phone Commented Jun 13, 2022 at 1:15
  • really? How close is too close? Commented Jun 13, 2022 at 2:34
  • just a thought off top of my head ... easily tested ... add a few meters of separation between the two devices Commented Jun 13, 2022 at 2:42
  • Moving it further didn't help. I'm looking for a more solid understanding of the problem anyway, not a try this and try that. Commented Jun 13, 2022 at 4:20
  • you asked a question that solicits guesses ... you asked for an explanation without presenting any data ... if you want an answer, you will have to submit to "try this" requests from people here ... perhaps you could ask how to troubleshoot this issue? Commented Jun 13, 2022 at 7:08

3 Answers 3

2

Sounds like the laptop might have a more restricted set of WiFi channels available than the iPhone has. Normally the hotspot (iPhone) decides the channel to use. IPhone probably makes the decision automatically whenever the hotspot function is switched on. If it happens to pick a channel the laptop cannot use, the laptop won't be able to find the hotspot.

With iw reg get, you'll see the set of country-specific radio frequency restrictions Linux is currently assuming, and with iw list you can see a list of channels the laptop's WiFi adapter can tune to. If iw reg get says country 00: DFS-UNSET, Linux will be transmitting only on channels that are allowed to use globally, until it hears some base station that can inform the WiFi adapter which country it's in, and so which country-specific restrictions it should use.

Some WiFi adapters handle the country-specific frequency restrictions completely internally (to avoid the faintest possibility of legal issues caused by interference with military radars), others can take input from the kernel. With iw reg set <two-letter country code>, you can tell the kernel your idea of what the applicable country code should be, if the country code is currently unset.

Some WiFi adapters (and/or drivers for them) may be incapable of using all the channels legal in your country, for whatever reason. I used to have a system with a Broadcom BCM43228; if used with the open-source b43 driver, the set of 5 GHz channels available was very limited. The closed-source wl driver had a complete set of channels available.

Unfortunately an iPhone will probably not indicate which channels it has chosen for its hotspot function.

The fact that you said the WiFi adapter sometimes appears as wlp4s0 and sometimes as wlan0 is strange too. Perhaps different settings get applied depending on whether the adapter gets initialized in early initramfs vs. later when the system is fully running?

Some laptops have a physical switch for disabling any radio transmitters (for "airplane mode"). Others can have similar functionality embedded in ACPI firmware and operated with a particular keystroke. sudo rfkill list should indicate if such a radio transmitter kill-switch is currently active.

Good information to add to your question, and to help in troubleshooting, would be:

  • identification of the WiFi chip: sudo lspci -s 4:0 -nnv
  • identification of the driver: ethtool -i wlp4s0 (or ethtool -i wlan0)
  • the make and model of your laptop (in case it has e.g. known firmware bugs causing problems with the WiFi adapter); the output of sudo dmidecode -s system-product-name; sudo dmidecode -s system-sku-number; sudo dmidecode -s system-manufacturer might provide the necessary information
  • the BIOS version/release date: sudo dmidecode -s bios-version; sudo dmidecode -s bios-release-date
1
  • thank you! I have added the output of the commands above as an update to the original question, Commented Jun 13, 2022 at 20:05
1

One possible workaround that seems to work in two different instances on two different computers:

Get the list of available networks. If the IPhone hotspot doesn't appear, on the IPhone, Settings->Personal Hotspot page, turn it off and on again. In both instances, this caused the IPhone hotspot to appear on the computers' list of networks.

I would still like to know why this is necessary.

0

Troubleshooting workarounds

if the iPhone hotspot doesn't appear on the list of available networks:

  1. Turn off and on the Personal Hotspot
  2. Turn off and on the Data Transfer
  3. Unlock the screen if you were operating on a locked one
  4. Connect another phone to this Hotspot first
  5. Plug it to computer via USB cable for Ethernet connection

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.