Issue with hostapd in remote locations
Poul Petersen
petersen at accushoot.com
Tue Apr 8 15:42:26 PDT 2025
I am running hostapd in a portable machine and running into an issue
with the service not always starting when I move to a new location.
The specifics of the environment are as follows:
debian 12
hostapd v2.10
adaptor: panda PAU0B
wifi kernel module: mt76x0u
kernel: 6.12.9+bpo-amd64
iw reg get: shows "country US"
hostapd.conf relevant settings:
hw_mode=g
channel=7 (we just added a scan that can change this to any of 1-11)
country_code=US
ieee80211d=0
ieee80211h=0
ieee80211n=1
ieee80211ac=1
ieee80211ax=0
The hostapd service is setup to run at boot using systemctl. Most of
the time, this works great. But every now and then, the hostapd
service refuses to start. There is no error and running in debug mode
doesn't not make it clear to me what is failing (again no error I can
discern). It just closes like this (I don't have a snippet of debug
mode because it is hard to reproduce unfortunately):
Starting hostapd.service - Access point and authentication server for
Wi-Fi and Ethernet...
wlan: interface state UNINITIALIZED->COUNTRY_UPDATE
wlan: interface state COUNTRY_UPDATE->HT_SCAN
Stopping hostapd.service - Access point and authentication server for
Wi-Fi and Ethernet...
And it does this over and over (we have systemctl setup to keep trying)
This issue almost always happens when the box has been moved to a new
physical location where it has not been before. For example:
Recently, we took three boxes to a new location and all three worked.
Then we took those three boxes to a remote location with no wifi
signals (very remote) and precious little other wireless signals. Two
of them failed and the third one worked.
Then we took them back to the previous location where they worked, and
all three worked again.
They were powered off between moves.
Given the behaviour, I am thinking this has something to do with the
regulatory scan that is done at startup, which is why I tried
disabling ieee80211d, etc. That actually seemed to help a bit. but
this new test where we moved to a very remote location caused the
issue to surface again.
I also feel like running a channel scan right before startup helps
which is something we recently added, but I haven't tested that
definitively because I can't reproduce the failure reliably. Note: I
haven't been able to get ACS scanning to work, so we are parsing the
output of "iwlist wlan scan" right now to choose a quiet channel
before we start hostapd. Also, the channel scanner was not turned on
for the three box test in a remote location I mentioned above...
Any thoughts? I would like the system to ultimately work in any
location. If it is somehow related to the regulatory scan, is there
some way to make hostapd more tolerant of failing that scan?
Thanks for any advice,
-poul
More information about the Hostap
mailing list