Why? I will cry! hostapd makes me crazy

Why the hell can’t I log my smartphone on via blue wifi anymore? It keeps telling me the password is wrong, but it’s 100% correct.
If I delete the last character of the password in the gui it works, but 12 other devices won’t log in anymore. As soon as I use the correct password, it won’t let me in.

As error message I get in wireless log

14:56:44 hostapd: blue0: STA MyNonRandomMAC IEEE 802.11: Could not add STA to kernel driver
14:56:42 hostapd: blue0: STA MyNonRandomMAC MLME: MLME-DELETEKEYS.request(MyNonRandomMAC)
14:56:42 hostapd: blue0: STA MyNonRandomMAC MLME: MLME-DEAUTHENTICATE.indication(MyNonRandomMAC 39)
14:56:42 hostapd: blue0: STA MyNonRandomMACIEEE 802.11: deauthenticated
14:56:42 hostapd: blue0: STA MyNonRandomMAC IEEE 802.11: Could not add STA to kernel driver

Any Chance to correkt that without changing the PW for a lot of devices?
And what the hell is happend, what I did wrong, yesterday all working fine?

Are you adding an invisible character to the password (white-space, newline?) in the WUI that creates a mismatch between the password in the hostapd.conf and the clients? What I would do is the following

  1. open /etc/hostapd.conf and find this line:
  1. delete all the characters after the ‘=’ and TYPE in the password, as in DO NOT COPY AND PASTE. Then save.

  2. check that you typed the password correctly;

  3. see step 3

  4. restart hostapd

/etc/init.d/hostapd restart
  1. test again

I hope you will not need to do this, but here is my procedure for handling an access point password. In MacOS (but also Linux will work), make sure you have the program utilities pwgen and qrencode (both free software) and create a shell script like this:


# Change this variable to your desired SSID

# Generate a random password with length 65
PASSWORD=$(pwgen -s 65 1)

# Save the password to a file
echo "$PASSWORD" > 00wifi.txt

# Generate the QR code
qrencode -o 00wifi.png "WIFI:T:WPA;S:${SSID};P:${PASSWORD};;"

# Display the generated password
echo "Generated password for ${SSID}:"
cat 00wifi.txt

# Display the QR code file path
echo "QR code saved to 00wifi.png"

To use this script, save it to a file named “generate_wifi_qr.sh” and make it executable using the following command:

chmod +x generate_wifi_qr.sh

Then, run the script with:


This script will generate a random, insanely long password, save it to a file named “00wifi.txt,” and create a QR code saved as “00wifi.png.” The QR code can be scanned by Android and iOS devices to connect to the access point with the specified SSID and generated password.

The format “WIFI:T:WPA;S:${SSID};P:${PASSWORD};;” is part of the convention for encoding Wi-Fi access point information into a QR code. The “ZXing QR Code Wi-Fi Network config format” (pronounced “zebra crossing”) is widely adopted across various QR code reader applications on both Android and iOS platforms.

In this format:

  • “T” represents the authentication type (WPA, WPA2, WEP, or nopass for open networks)
  • “S” represents the SSID (network name)
  • “P” represents the password

The double semicolons at the end indicate the end of the Wi-Fi configuration.


This error mean that the kernel driver or hardware has refused to add this client after checking the credentials was ok. In many cases this are driver bugs or hardware limits. There are some wlan chips that can only handle a limited number of connected clients. (eg. xradio xr819 can handle 5 clients)


All the crying stop when you use a sepatate wired AP.

1 Like

First, thank you for your help and ideas.

I will try it, but the other devices, all LoT devices were connected and worked as well

My devices in this network are all LoT devices which I would have to teach individually, so this solution unfortunately brings me nothing. Thank you anyway!

That sounds disgusting, don’t say such things please.
It is a WLan Card (NL80211)
Wireless 3160 (rev 83) TypeID: 8086:08b3 Driver: iwlwifi

Are there any restrictions here as well ? There are 12 devices registered on the card.

You will laugh now, but the blue network is my fourth WLAN, I have an AP for 5Ghz and an AP with 5Ghz guest network and a normal 2.4Ghz access which are connected via the green network. For the blue network I wanted to outsource the whole LoT devices so that they are only for themselves, for this I wanted to take the onboard WLAN card.

After some testings with the hints, it seems so that after 12 devices is finished, that really makes me cry now…