WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] TCL laptop sometimes cannot connect to TCL wireless router  (Read 2158 times)

Offline GNUser

  • Hero Member
  • *****
  • Posts: 1343
Both my laptop and wireless router are powered by TCL. Things usually work perfectly, except that once in a while the laptop cannot connect to the wireless network.

This is what I see in my laptop's terminal while  wpa_supplicant  struggles to authenticate:

Code: [Select]
Successfully initialized wpa_supplicant
udhcpc: started, v1.31.1
udhcpc: sending discover
wlan0: SME: Trying to authenticate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: Trying to associate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:c0:ca:82:e6:49 status_code=17
wlan0: SME: Deauth request to the driver failed
udhcpc: sending discover
wlan0: SME: Trying to authenticate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: Trying to associate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:c0:ca:82:e6:49 status_code=17
wlan0: SME: Deauth request to the driver failed
udhcpc: sending discover
wlan0: CTRL-EVENT-REGDOM-CHANGE init=BEACON_HINT type=UNKNOWN
wlan0: SME: Trying to authenticate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: Trying to associate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:c0:ca:82:e6:49 status_code=17
wlan0: SME: Deauth request to the driver failed
wlan0: SME: Trying to authenticate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: Trying to associate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:c0:ca:82:e6:49 status_code=17
wlan0: SME: Deauth request to the driver failed
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="bibliotheca_alexandrina" auth_failures=1 duration=10 reason=CONN_FAILED
wlan0: CTRL-EVENT-SSID-REENABLED id=0 ssid="bibliotheca_alexandrina"
wlan0: SME: Trying to authenticate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: Trying to associate with 00:c0:ca:82:e6:49 (SSID='bibliotheca_alexandrina' freq=2462 MHz)
wlan0: CTRL-EVENT-ASSOC-REJECT bssid=00:c0:ca:82:e6:49 status_code=17
wlan0: SME: Deauth request to the driver failed
wlan0: CTRL-EVENT-SSID-TEMP-DISABLED id=0 ssid="bibliotheca_alexandrina" auth_failures=2 duration=23 reason=CONN_FAILED
^C
nl80211: deinit ifname=wlan0 disabled_11b_rates=0
bruno@box:~$ wlan0: CTRL-EVENT-TERMINATING

Here is the script that runs in my "router" (actually an old netbook) to create the wireless hotspot:
Code: [Select]
#!/bin/sh

wan_if=eth0
lan_if=wlan1
ssid=bibliotheca_alexandrina
password=foobarbaz
roku_mac=[redacted]
printer_mac=[redacted]
ip_stem=192.168.10
channel=11

main()
{
setup_nat
setup_dnsmasq
setup_hostapd
}

setup_nat() # nat is more robust than bridge
{
echo 1 >/proc/sys/net/ipv4/conf/$wan_if/forwarding
echo 1 >/proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o $wan_if -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i $lan_if -o $wan_if -j ACCEPT
}

setup_dnsmasq()
{
# for tiny core (persistent lease file across boots):
touch /opt/dnsmasq.leases; mkdir -p /var/lib/misc
ln -s /opt/dnsmasq.leases /var/lib/misc/dnsmasq.leases

ifconfig $lan_if $ip_stem.1
echo "listen-address=$ip_stem.1
dhcp-range=$ip_stem.100,$ip_stem.200,255.255.255.0,24h
dhcp-option-force=option:router,$ip_stem.1
dhcp-option-force=option:dns-server,192.168.10.1
dhcp-host=$roku_mac,192.168.10.60
dhcp-host=$printer_mac,192.168.10.7,infinite
dhcp-option-force=option:mtu,1500" >/tmp/dnsmasq.conf
dnsmasq -C /tmp/dnsmasq.conf
}

setup_hostapd()
{
echo "beacon_int=100
ssid=$ssid
interface=$lan_if
driver=nl80211
channel=$channel
ignore_broadcast_ssid=0
ap_isolate=0
hw_mode=g
wpa=3 # wpa=0 means no password
wpa_passphrase=$password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP CCMP
rsn_pairwise=CCMP

# for 802.11n support:
ieee80211n=1
wmm_enabled=1
ht_capab=[HT20][SHORT-GI-20]

" >/tmp/hostapd.conf
hostapd /tmp/hostapd.conf
}

main

Any ideas why the laptop cannot connect to the wireless hotspot?

P.S. In all seriousness, the problem tends to occur when my in-laws visit and are connected to my hotspot with their Windows laptops. This brings the total number of devices on my wireless network from baseline of 6 up to 8. Since both dnsmasq and hostapd default to a limit of 150 clients, the explanation cannot be that there are too many wireless clients. Networking is not my forte and I'm at a loss. Any help, even if wild guesses, would be welcome.
« Last Edit: May 21, 2020, 04:34:46 AM by Rich »

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 933
Re: TCL laptop sometimes cannot connect to TCL wireless router
« Reply #1 on: May 20, 2020, 07:00:51 AM »
Hi, GNUser!

My home network looks just like Yours. Internet is PPPoE connected to Asus EEE 901 (natine WiFi adapter, RTLxxx, if I am not mistaken). Devices are laptop (Atheros chip), Orange Pi and a couple of Android smarts. So EEE was holding wireless network with the help of internal antenna, and is placed badly, from the point of view of signal strength distribution - i.e. one of rooms has very low signal. And I had problems like Yours, i.e. if number of nodes increase, some of them are dropping out of connection. I haven't logged the events. I've choosed the right place for antenna, which eliminated field shadows, bought external USB Wifi adapter (Atheros chip, they are the best for open source), and connected external antenna to my EEE router. And since then problems are gone.

Of course trouble was like Yours, but this method is not guarantee, You know. But why not to try?

Cheers )

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: TCL laptop sometimes cannot connect to TCL wireless router
« Reply #2 on: May 20, 2020, 09:44:32 AM »
The client log says it's a server/AP-side thing, so you should look in that log. It's possible your server wifi chip can't handle that many clients, or maybe something in the config.
The only barriers that can stop you are the ones you create yourself.

Offline GNUser

  • Hero Member
  • *****
  • Posts: 1343
Re: TCL laptop sometimes cannot connect to TCL wireless router
« Reply #3 on: May 20, 2020, 05:04:27 PM »
Thank you both!

jazzbiker - our setups are quite similar! My netbook/router is an EEE and I also use an external Atheros wifi adapter, this one:
https://www.thinkpenguin.com/gnu-linux/penguin-wireless-n-usb-adapter-w-external-antenna-gnu-linux-tpe-n150usbl
Which adapter do you use? My setup is in the center of the house with strong signal everywhere, so signal strength is not the issue.

curaga - I hadn't considered a hardware limitation, but that might just be the problem. Any idea how to check how many clients the server's wifi (Atheros) chip can handle?

Online curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10957
Re: TCL laptop sometimes cannot connect to TCL wireless router
« Reply #4 on: May 20, 2020, 11:37:55 PM »
I'd look up manufacturer spec sheets or the driver source.
The only barriers that can stop you are the ones you create yourself.

Offline jazzbiker

  • Hero Member
  • *****
  • Posts: 933
Re: TCL laptop sometimes cannot connect to TCL wireless router
« Reply #5 on: May 20, 2020, 11:53:39 PM »
Hi, GNUser!

You mentioned, that trouble comes hand in hand with Windows. We don't know, what those drivers do on Your frequency. It is possible for malicious intruder to break any connection at any moment.

Offline GNUser

  • Hero Member
  • *****
  • Posts: 1343
Re: TCL laptop sometimes cannot connect to TCL wireless router
« Reply #6 on: May 21, 2020, 04:29:28 AM »
I contacted the seller (ThinkPenguin) for support. They confirm it's a hardware limitation:

Quote
ThinkPenguin writes:
The max # of clients is 8. It's a hardware or chip limitation sort
of. The code could be rewritten to accommodate more clients by
offloading to the hosts CPU, but it's never been done. Basically these
adapters have very limited memory which limits the number of clients
that can connect.

Generally speaking the companies which design the chips that go into
routers and every other kind of device produce different versions for
different use cases. A chip designed for a wifi adapter or computer
isn't going to perform the same as a chip designed for a router even
where it is capable of performing said function.
This can be marked as solved. Thank you both very much. This issue was driving me crazy.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Hi GNUser
... This can be marked as solved. ...
Done.