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:
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:
#!/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.