himilou
Posts: 7
Joined: Thu Oct 14, 2021 1:40 am

Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Thu Oct 14, 2021 1:54 am

I have my Pi configured ( hopefully correctly ) to act as a wireless access point. On boot the Pi accepts connections as expected. I can connect from Android phone, kindle tablet, and windows. After any of these clients disconnects, usually due to the client entering a power save state or in some cases reconnecting to another WPA because the Pi has no internet access, Clients can no longer connect until the pi is rebooted.

The distance between the pi and the clients is very small at this time, less than 3 feet and there is not an unusual amount of wireless activity going on. ( house in suburban neighborhood )

I have tried changing various hostapd settings such as channel and radio type ( a/g/n ) and tried setting the radio channel to auto configure through scanning with the same results.
I have also set the radio power managent to off with a command in rc.local

Below are the current config files as well as systemctl status output from 3 different stages, after boot, after first client connects and when the pi is no longer accepting connections.

This is a new install of raspbian lite ( no GUI )

I am using 3 different clients, Windows, Android phone, and a Kindle. The Kindle knows of no other access points . Windows and the phone have other standard wi fi access points within range. The issue seems to start after Windows or the phone connect and then after realizing their is no internet connection disconnect from the PI and switch back to their other access points. The kindle does not try and switch and doe s not seem to trigger this behavior.

**Configuration files**

-------------------------------------
/etc/hostapd/hostapd.conf
-------------------------------------

Code: Select all

country_code=US
interface=wlan0
driver=nl80211
hw_mode=g
ignore_broadcast_ssid=0
channel=8
wmm_enabled=0
#acs_num_scans=5
macaddr_acl=0
auth_algs=3
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
ssid=yournamehere
wpa_passphrase=abcd
--------------------------
/etc/network/interfaces
-------------------------

Code: Select all

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
-------------------------------------
/etc/dhcpcd.conf
-------------------------------------

Code: Select all

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private

#config for wireless access point
interface wlan0
metric 400
static ip_address=10.0.0.1/24
static routers=10.0.0.1
static domain_name_servers 192.168.0.1 8.8.8.8
nohook wpa_supplicant

interface eth0
metric 100
static ip_address=192.168.0.150/24
static routers=192.168.0.1
static domain_name_servers 192.168.0.1 8.8.8.8


-------------------------------------
/etc/rc.local
-------------------------------------

Code: Select all

# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

# Print the IP address
_IP=$(hostname -I) || true
if [ "$_IP" ]; then
  printf "My IP address is %s\n" "$_IP"
fi

#load the iptables config
iptables-restore < /etc/iptables.ipv4.nat

#force wifi to no power mamangement
/sbin/iw wlan0 set power_save off
exit 0

-------------------------------------------
/etc/dnsmasq.conf
-------------------------------------------

Code: Select all

interface=wlan0
domain-needed
dhcp-range=10.0.0.100,10.0.0.150,255.255.255.0,48h
server=192.168.0.1
server=8.8.8.8

#interface=eth0
#server=192.168.0.1
#server=8.8.8.8
#except-interface=eth0

state of services at boot

Code: Select all

pi@PiServer:~ $ sudo systemctl status dnsmasq
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-10-13 11:12:22 PDT; 35s ago
  Process: 541 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
  Process: 549 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 563 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
 Main PID: 562 (dnsmasq)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/dnsmasq.service
           └─562 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.d

Oct 13 11:12:21 PiServer dnsmasq[562]: started, version 2.80 cachesize 150
Oct 13 11:12:21 PiServer dnsmasq[562]: compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntra
Oct 13 11:12:21 PiServer dnsmasq-dhcp[562]: DHCP, IP range 10.0.0.100 -- 10.0.0.150, lease time 2d
Oct 13 11:12:21 PiServer dnsmasq[562]: using nameserver 8.8.8.8#53
Oct 13 11:12:21 PiServer dnsmasq[562]: using nameserver 192.168.0.1#53
Oct 13 11:12:21 PiServer dnsmasq[562]: read /etc/hosts - 5 addresses
Oct 13 11:12:22 PiServer dnsmasq[562]: no servers found in /run/dnsmasq/resolv.conf, will retry
Oct 13 11:12:22 PiServer dnsmasq[563]: Too few arguments.
Oct 13 11:12:22 PiServer systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Oct 13 11:12:26 PiServer dnsmasq[562]: nameserver 192.168.0.1 refused to do a recursive query


pi@PiServer:~ $ sudo systemctl status hostapd
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-10-13 11:12:21 PDT; 1min 48s ago
  Process: 543 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SU
 Main PID: 552 (hostapd)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/hostapd.service
           └─552 /usr/sbin/hostapd -B -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf

Oct 13 11:12:21 PiServer systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Oct 13 11:12:21 PiServer hostapd[543]: Configuration file: /etc/hostapd/hostapd.conf
Oct 13 11:12:21 PiServer hostapd[543]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Oct 13 11:12:21 PiServer systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.

after first client connect

Code: Select all

pi@PiServer:~ $ sudo systemctl status dnsmasq
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-10-13 11:12:22 PDT; 3min 36s ago
  Process: 541 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
  Process: 549 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 563 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
 Main PID: 562 (dnsmasq)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/dnsmasq.service
           └─562 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.d

Oct 13 11:12:21 PiServer dnsmasq[562]: using nameserver 192.168.0.1#53
Oct 13 11:12:21 PiServer dnsmasq[562]: read /etc/hosts - 5 addresses
Oct 13 11:12:22 PiServer dnsmasq[562]: no servers found in /run/dnsmasq/resolv.conf, will retry
Oct 13 11:12:22 PiServer dnsmasq[563]: Too few arguments.
Oct 13 11:12:22 PiServer systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Oct 13 11:12:26 PiServer dnsmasq[562]: nameserver 192.168.0.1 refused to do a recursive query
Oct 13 11:14:51 PiServer dnsmasq-dhcp[562]: DHCPDISCOVER(wlan0) 14:0a:c5:d3:1b:2f
Oct 13 11:14:51 PiServer dnsmasq-dhcp[562]: DHCPOFFER(wlan0) 10.0.0.124 14:0a:c5:d3:1b:2f
Oct 13 11:14:51 PiServer dnsmasq-dhcp[562]: DHCPREQUEST(wlan0) 10.0.0.124 14:0a:c5:d3:1b:2f
Oct 13 11:14:51 PiServer dnsmasq-dhcp[562]: DHCPACK(wlan0) 10.0.0.124 14:0a:c5:d3:1b:2f


pi@PiServer:~ $ sudo systemctl status hostapd
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-10-13 11:12:21 PDT; 4min 6s ago
  Process: 543 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SU
 Main PID: 552 (hostapd)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/hostapd.service
           └─552 /usr/sbin/hostapd -B -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf

Oct 13 11:12:21 PiServer systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Oct 13 11:12:21 PiServer hostapd[543]: Configuration file: /etc/hostapd/hostapd.conf
Oct 13 11:12:21 PiServer hostapd[543]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Oct 13 11:12:21 PiServer systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Oct 13 11:14:51 PiServer hostapd[552]: wlan0: STA 14:0a:c5:d3:1b:2f IEEE 802.11: associated
Oct 13 11:14:51 PiServer hostapd[552]: wlan0: STA 14:0a:c5:d3:1b:2f RADIUS: starting accounting session C8A10819EC9E7FA8
Oct 13 11:14:51 PiServer hostapd[552]: wlan0: STA 14:0a:c5:d3:1b:2f WPA: pairwise key handshake completed (RSN)

after a client connects and then disconnects Can now no longer connect any clients

Code: Select all

pi@PiServer:~ $ ^C
pi@PiServer:~ $ sudo systemctl status hostapd
● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-10-13 11:12:21 PDT; 7min ago
  Process: 543 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SU
 Main PID: 552 (hostapd)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/hostapd.service
           └─552 /usr/sbin/hostapd -B -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf

Oct 13 11:14:51 PiServer hostapd[552]: wlan0: STA 14:0a:c5:d3:1b:2f RADIUS: starting accounting session C8A10819EC9E7FA8
Oct 13 11:14:51 PiServer hostapd[552]: wlan0: STA 14:0a:c5:d3:1b:2f WPA: pairwise key handshake completed (RSN)
Oct 13 11:18:07 PiServer hostapd[552]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: associated
Oct 13 11:18:07 PiServer hostapd[552]: wlan0: STA b4:ae:2b:c1:58:95 RADIUS: starting accounting session 178CDFCC1189DEB8
Oct 13 11:18:07 PiServer hostapd[552]: wlan0: STA b4:ae:2b:c1:58:95 WPA: pairwise key handshake completed (RSN)
Oct 13 11:18:31 PiServer hostapd[552]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: disassociated
Oct 13 11:18:31 PiServer hostapd[552]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: disassociated
Oct 13 11:18:31 PiServer hostapd[552]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: disassociated
Oct 13 11:19:38 PiServer hostapd[552]: wlan0: STA 14:0a:c5:d3:1b:2f IEEE 802.11: disassociated
Oct 13 11:19:42 PiServer hostapd[552]: wlan0: STA 14:0a:c5:d3:1b:2f IEEE 802.11: disassociated



pi@PiServer:~ $ ^C
pi@PiServer:~ $ sudo systemctl status dnsmasq
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2021-10-13 11:12:22 PDT; 8min ago
  Process: 541 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
  Process: 549 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 563 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
 Main PID: 562 (dnsmasq)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/dnsmasq.service
           └─562 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.d

Oct 13 11:12:22 PiServer dnsmasq[562]: no servers found in /run/dnsmasq/resolv.conf, will retry
Oct 13 11:12:22 PiServer dnsmasq[563]: Too few arguments.
Oct 13 11:12:22 PiServer systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Oct 13 11:12:26 PiServer dnsmasq[562]: nameserver 192.168.0.1 refused to do a recursive query
Oct 13 11:14:51 PiServer dnsmasq-dhcp[562]: DHCPDISCOVER(wlan0) 14:0a:c5:d3:1b:2f
Oct 13 11:14:51 PiServer dnsmasq-dhcp[562]: DHCPOFFER(wlan0) 10.0.0.124 14:0a:c5:d3:1b:2f
Oct 13 11:14:51 PiServer dnsmasq-dhcp[562]: DHCPREQUEST(wlan0) 10.0.0.124 14:0a:c5:d3:1b:2f
Oct 13 11:14:51 PiServer dnsmasq-dhcp[562]: DHCPACK(wlan0) 10.0.0.124 14:0a:c5:d3:1b:2f
Oct 13 11:18:07 PiServer dnsmasq-dhcp[562]: DHCPREQUEST(wlan0) 10.0.0.145 b4:ae:2b:c1:58:95
Oct 13 11:18:07 PiServer dnsmasq-dhcp[562]: DHCPACK(wlan0) 10.0.0.145 b4:ae:2b:c1:58:95 surface


version info

Code: Select all


pi@PiServer:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

Anyone have a workaround or solution to this?

Thanks!

epoch1970
Posts: 7089
Joined: Thu May 05, 2016 9:33 am
Location: France

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Thu Oct 14, 2021 4:35 pm

I don't see a problem in any of your logs.
This option isn't compatible with wifi N and later, AFAIK.

Code: Select all

wmm_enabled=0
Try removing this line. It defaults to enabled.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

himilou
Posts: 7
Joined: Thu Oct 14, 2021 1:40 am

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Thu Oct 14, 2021 6:26 pm

Thanks for the reply, I have tried a hostapd without that line and I still got the same issue. which is after rebooting the pi I can connect from a device or devices. as soon as a device disconnects ( I believe due to windows or phone deciding to switch to a different access point because the pi is not internet connected ) new devices cannot connect and disconnected devices cannot reconnect.

I have added
logger_syslog=-1
logger_syslog_level=2
logger_stdout=-1
logger_stdout_level=2

to the hostapd file but I dont see any additional output.

I had tried it without the wmm setting in there and the behavior was the same but I have removed it as its not fixing this issue. Any ideas on how to proceed? I should add that Im not used to using system.d so I am not completely sure if the config files are correct or not and they are currently the result of looking over a lot of different how to configure examples

I ultimately would like to have level 3 routing between the pi and the eth0 network with the pi serviing dhcp requests to wlan0 clients only vs full blown bridge mode where all traffic is forwarded both ways ( without taking filtering into account ) but the clients have to stay connected first :)

I should add that as soon as the pi gets into this state the clients will try and reconnect multiple times and eventually give up, or in the case of the kindle disable the connection.

Thanks!

epoch1970
Posts: 7089
Joined: Thu May 05, 2016 9:33 am
Location: France

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Thu Oct 14, 2021 7:54 pm

himilou wrote:
Thu Oct 14, 2021 6:26 pm
I ultimately would like to have level 3 routing between the pi and the eth0 network with the pi serviing dhcp requests to wlan0 clients only
This is known to work on RaspiOS.
https://www.raspberrypi.com/documentati ... cess-point

If it does not work, try from a clean OS install.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

drgeoff
Posts: 12244
Joined: Wed Jan 25, 2012 6:39 pm

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Fri Oct 15, 2021 12:30 am

In dhcpcd.conf your

Code: Select all

static domain_name_servers 192.168.0.1 8.8.8.8
lines are missing the '='.
Quis custodiet ipsos custodes?

himilou
Posts: 7
Joined: Thu Oct 14, 2021 1:40 am

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Fri Oct 15, 2021 11:09 pm

So I reimaged my pi followed the instructions here
https://www.raspberrypi.com/documentati ... cess-point
and the same issue occurs?

Any idea on what to look at to try and troubleshoot this issue or is it a bug?

epoch1970
Posts: 7089
Joined: Thu May 05, 2016 9:33 am
Location: France

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Sat Oct 16, 2021 9:25 am

That’s unusual.
Perhaps you can concisely restate the issue and how to reproduce it step by step?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

himilou
Posts: 7
Joined: Thu Oct 14, 2021 1:40 am

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Sat Oct 16, 2021 5:43 pm

Thanks,

So the issue is as follows. After following the how to to setup a routed WPA from the above URL The following occurs
boot pi ( no errors seen booting )
run systemctl status hostapd to check status ( output follows )

Code: Select all

● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-10-16 18:13:11 BST; 1min 32s ago
  Process: 594 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SUCCESS)
 Main PID: 601 (hostapd)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/hostapd.service
           └─601 /usr/sbin/hostapd -B -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf

Oct 16 18:13:10 raspberrypi systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Oct 16 18:13:11 raspberrypi hostapd[594]: Configuration file: /etc/hostapd/hostapd.conf
Oct 16 18:13:11 raspberrypi hostapd[594]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Oct 16 18:13:11 raspberrypi systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Oct 16 18:14:19 raspberrypi hostapd[601]: wlan0: STA 14:0a:c5:d3:1b:2f IEEE 802.11: associated
Oct 16 18:14:19 raspberrypi hostapd[601]: wlan0: STA 14:0a:c5:d3:1b:2f RADIUS: starting accounting session E3BE903CD030C895
Oct 16 18:14:19 raspberrypi hostapd[601]: wlan0: STA 14:0a:c5:d3:1b:2f WPA: pairwise key handshake completed (RSN)
connect with a client and verify that we connected and got a dhcp address given to us:

Code: Select all

Oct 16 18:13:10 raspberrypi systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
Oct 16 18:13:11 raspberrypi hostapd[594]: Configuration file: /etc/hostapd/hostapd.conf
Oct 16 18:13:11 raspberrypi hostapd[594]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Oct 16 18:13:11 raspberrypi systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Oct 16 18:14:19 raspberrypi hostapd[601]: wlan0: STA 14:0a:c5:d3:1b:2f IEEE 802.11: associated
Oct 16 18:14:19 raspberrypi hostapd[601]: wlan0: STA 14:0a:c5:d3:1b:2f RADIUS: starting accounting session E3BE903CD030C895
Oct 16 18:14:19 raspberrypi hostapd[601]: wlan0: STA 14:0a:c5:d3:1b:2f WPA: pairwise key handshake completed (RSN)
Oct 16 18:18:44 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: associated
Oct 16 18:18:44 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 RADIUS: starting accounting session 01E0021EB6C239A0
Oct 16 18:18:44 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 WPA: pairwise key handshake completed (RSN)


● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-10-16 18:13:11 BST; 6min ago
  Process: 595 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
  Process: 600 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 610 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
 Main PID: 608 (dnsmasq)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/dnsmasq.service
           └─608 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.d

Oct 16 18:13:11 raspberrypi dnsmasq[608]: using nameserver 8.8.8.8#53
Oct 16 18:13:11 raspberrypi dnsmasq[608]: read /etc/hosts - 5 addresses
Oct 16 18:13:11 raspberrypi dnsmasq[610]: Too few arguments.
Oct 16 18:13:11 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Oct 16 18:14:19 raspberrypi dnsmasq-dhcp[608]: DHCPDISCOVER(wlan0) 14:0a:c5:d3:1b:2f
Oct 16 18:14:19 raspberrypi dnsmasq-dhcp[608]: DHCPOFFER(wlan0) 192.168.100.74 14:0a:c5:d3:1b:2f
Oct 16 18:14:19 raspberrypi dnsmasq-dhcp[608]: DHCPREQUEST(wlan0) 192.168.100.74 14:0a:c5:d3:1b:2f
Oct 16 18:14:19 raspberrypi dnsmasq-dhcp[608]: DHCPACK(wlan0) 192.168.100.74 14:0a:c5:d3:1b:2f
Oct 16 18:18:44 raspberrypi dnsmasq-dhcp[608]: DHCPREQUEST(wlan0) 192.168.100.95 b4:ae:2b:c1:58:95
Oct 16 18:18:44 raspberrypi dnsmasq-dhcp[608]: DHCPACK(wlan0) 192.168.100.95 b4:ae:2b:c1:58:95 surface
disconnect from the pi access point
try and reconnect to the pi access point and receive an error, in the case of windows, cant connect to this network.

output of systemctl status for hostapd and dnsmasq after disconnecting a client and reconnecting

Code: Select all


● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
   Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-10-16 18:13:11 BST; 12min ago
  Process: 594 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SUCCESS)
 Main PID: 601 (hostapd)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/hostapd.service
           └─601 /usr/sbin/hostapd -B -P /run/hostapd.pid -B /etc/hostapd/hostapd.conf

Oct 16 18:14:19 raspberrypi hostapd[601]: wlan0: STA 14:0a:c5:d3:1b:2f WPA: pairwise key handshake completed (RSN)
Oct 16 18:18:44 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: associated
Oct 16 18:18:44 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 RADIUS: starting accounting session 01E0021EB6C239A0
Oct 16 18:18:44 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 WPA: pairwise key handshake completed (RSN)
Oct 16 18:21:24 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: disassociated
Oct 16 18:21:24 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: disassociated
Oct 16 18:21:24 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: disassociated
Oct 16 18:21:24 raspberrypi hostapd[601]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: disassociated
Oct 16 18:22:15 raspberrypi hostapd[601]: wlan0: STA 14:0a:c5:d3:1b:2f IEEE 802.11: disassociated
Oct 16 18:22:19 raspberrypi hostapd[601]: wlan0: STA 14:0a:c5:d3:1b:2f IEEE 802.11: disassociated


● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: active (running) since Sat 2021-10-16 18:13:11 BST; 13min ago
  Process: 595 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
  Process: 600 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=0/SUCCESS)
  Process: 610 ExecStartPost=/etc/init.d/dnsmasq systemd-start-resolvconf (code=exited, status=0/SUCCESS)
 Main PID: 608 (dnsmasq)
    Tasks: 1 (limit: 2059)
   CGroup: /system.slice/dnsmasq.service
           └─608 /usr/sbin/dnsmasq -x /run/dnsmasq/dnsmasq.pid -u dnsmasq -r /run/dnsmasq/resolv.conf -7 /etc/dnsmasq.d,.dpkg-dist,.d

Oct 16 18:13:11 raspberrypi dnsmasq[608]: using nameserver 8.8.8.8#53
Oct 16 18:13:11 raspberrypi dnsmasq[608]: read /etc/hosts - 5 addresses
Oct 16 18:13:11 raspberrypi dnsmasq[610]: Too few arguments.
Oct 16 18:13:11 raspberrypi systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Oct 16 18:14:19 raspberrypi dnsmasq-dhcp[608]: DHCPDISCOVER(wlan0) 14:0a:c5:d3:1b:2f
Oct 16 18:14:19 raspberrypi dnsmasq-dhcp[608]: DHCPOFFER(wlan0) 192.168.100.74 14:0a:c5:d3:1b:2f
Oct 16 18:14:19 raspberrypi dnsmasq-dhcp[608]: DHCPREQUEST(wlan0) 192.168.100.74 14:0a:c5:d3:1b:2f
Oct 16 18:14:19 raspberrypi dnsmasq-dhcp[608]: DHCPACK(wlan0) 192.168.100.74 14:0a:c5:d3:1b:2f
Oct 16 18:18:44 raspberrypi dnsmasq-dhcp[608]: DHCPREQUEST(wlan0) 192.168.100.95 b4:ae:2b:c1:58:95
Oct 16 18:18:44 raspberrypi dnsmasq-dhcp[608]: DHCPACK(wlan0) 192.168.100.95 b4:ae:2b:c1:58:95 surface

so from the logs it appears that after a disassociate event for hostapd hostapd ( or the driver ) get into a state and no longer attempt to process a connection from a client. At least thats what appears to happen based on the lack of an associated event and the lack of a dhcp request after the initial client disconnect.

As I mentioned earlier the client does not matter, this happens with and Android phone and a kindle also. ( its just easiest to validate a connection from an os with cmd line tools )

The only thing different about my setup between the how to URL and my pi is the subnet for the wlan0 config, enabling ssh, and using raspi-config to change the keyboard layout to US english so I can cut and paste the logs here.

Thanks!

epoch1970
Posts: 7089
Joined: Thu May 05, 2016 9:33 am
Location: France

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Sat Oct 16, 2021 6:48 pm

IMHO good old /var/log/syslog can be more informative than the truncated systemd logs.

What you present as dnsmasq logs AFTER disconnecting are in fact logs taken BEFORE. Apparently there are no logs once you have disconnected.
Something goes wrong (like hostapd dying or something like that) and systemd does not help seeing what's going on.

If neither Pi or PSU or OS or SD are shot the guide works, AFAIK. So looking for deviations from the guide:

What is the IP address of eth0?
Of wlan0?
Are you running the released version of Raspios, or something more experimental?
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

himilou
Posts: 7
Joined: Thu Oct 14, 2021 1:40 am

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Sat Oct 16, 2021 8:54 pm

Thanks,
I have used journalctl with grep to search for wlan0 hostapd and dnsmasq issues but the logs are about the same and certainly no failures listed.

the wlan0 network is 192,168,100.0/24
and the eth0 is 192.168.0.0.24

but that does not seem relevant because as the logs show after the disassociation no requests reach the dnsmasq service so its definately an issue lower down the stack.

There are a couple of other posts in the forum here from others that have had similar issues including this one which refers to a fix for this but that does not actually seem to work.

viewtopic.php?t=231267

Im going to try a wireless USB adapter. If that works successfully then I guess thats what I will use.

I would like to know how to disable the onboard wlan interface. The end goal for this device is to be an openplotter \ SignalK server for my boat and the less power that is used the better.

Thanks for your help so far.

himilou
Posts: 7
Joined: Thu Oct 14, 2021 1:40 am

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Sat Oct 16, 2021 9:45 pm

ok interesting followup:

I got a usb wireless adapter a netis WL-2111 wireless N, which uses the rtl8192cu driver. I powered down and rebooted and the output from ip addr show then listed 2 wireless interfaces onboard wlan0 and the netis wlan1.

I then blacklisted the onboard driver by creating a raspi-blacklist.conf in /etc/modprobe.d with the entries
blacklist brcmfmac
blacklist brcmutil
and rebooted.

the netis usb wireless adapter is now associated with wlan0 and seems to work perfectly. No other config changes needed ( because its now wlan0 )
it also seems to be fine without connecting it to an external powered USB hub.

of note is that if I tell a client device to disconnect and join another network I no longer see a disassociated message. This is a red flag to me and tells me that disassociated is an ERROR, not a normal state.

Code: Select all

Oct 16 22:23:08 raspberrypi hostapd[624]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Oct 16 22:23:08 raspberrypi systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.
Oct 16 22:26:09 raspberrypi hostapd[625]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: authenticated
Oct 16 22:26:09 raspberrypi hostapd[625]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: associated (aid 1)
Oct 16 22:26:09 raspberrypi hostapd[625]: wlan0: STA b4:ae:2b:c1:58:95 RADIUS: starting accounting session AE051BA924343032
Oct 16 22:26:09 raspberrypi hostapd[625]: wlan0: STA b4:ae:2b:c1:58:95 WPA: pairwise key handshake completed (RSN)
Oct 16 22:27:45 raspberrypi hostapd[625]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: authenticated
Oct 16 22:27:45 raspberrypi hostapd[625]: wlan0: STA b4:ae:2b:c1:58:95 IEEE 802.11: associated (aid 1)
Oct 16 22:27:45 raspberrypi hostapd[625]: wlan0: STA b4:ae:2b:c1:58:95 RADIUS: starting accounting session 28A5DFB2287134FD
Oct 16 22:27:45 raspberrypi hostapd[625]: wlan0: STA b4:ae:2b:c1:58:95 WPA: pairwise key handshake completed (RSN)
So it looks like the brcm driver has a bug. Anyway I hope this helps. If you know how to file a bug against the driver please feel free to copy paste this into the bug report, I have no clue as to how to file a bug against a raspi driver.

Hopefully this info will help others if they desire to configure a WPA.

Cheers and thanks for all the help!!

himilou
Posts: 7
Joined: Thu Oct 14, 2021 1:40 am

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Sat Oct 16, 2021 9:48 pm

small follow up, as far as blacklisting the onboard driver goes this is the guide I used:
https://thedigitalnomadguy.com/how-to-d ... erry-pi-3/

epoch1970
Posts: 7089
Joined: Thu May 05, 2016 9:33 am
Location: France

Re: Pi 3B+ as Wireless Access Point. After client disconnect no other clients can connect \ reconnect

Sun Oct 17, 2021 8:06 am

No need to blacklist the brcm driver, you can disable WiFi in config.txt instead

If the built-in interface doesn’t work, but a 1/3 party one does, this tells me there is something going on with your OS.
If all Pi3B+ running RaspiOS had issues with the built in wireless interface this forum would be on fire. It doesn’t look to be the case.
I would suggest installing a clean copy of RaspiOS to an SD and seeing if troubles persist.

Associated/de-associated states map successfully authenticating with an AP / leaving the AP (at the initiative of the client or the AP).
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

Return to “Networking and servers”