You are not logged in.

#1 2019-11-01 21:25:00

jancici
Member
From: svk
Registered: 2011-12-04
Posts: 190

[SOLVED] hostapd_cli is not able to connect to hostapd

I am using my local server as wifi AP at home. There was not problem using hostapd in past. But today I did see some problems so try to check whats going on.
I did login to server and want to use hostapd_cli.

using this command as usually: sudo hostapd_cli
but I am getting this error, I did leave it for while and then press CTRL+C:

hostapd_cli v2.9
Copyright (c) 2004-2019, Jouni Malinen <j@w1.fi> and contributors

This software may be distributed under the terms of the BSD license.
See README for more details.


Selected interface 'wifina'
Warning: Failed to attach to hostapd.

Interactive mode

> 'PING' command timed out.
Connection to hostapd lost - trying to reconnect
Warning: Failed to attach to hostapd.
Connection to hostapd re-established
'PING' command timed out.
Connection to hostapd lost - trying to reconnect
Warning: Failed to attach to hostapd.
Connection to hostapd re-established
'PING' command timed out.
Connection to hostapd lost - trying to reconnect
^Celoop: could not process SIGINT or SIGTERM in two seconds. Looks like there
is a bug that ends up in a busy loop that prevents clean shutdown.
Killing program forcefully.

here is config og hostapd

ssid=xyz
channel=9
interface=wifina
country_code=XY

ieee80211d=1
ieee80211n=1

auth_algs=1

driver=nl80211
hw_mode=g
wmm_enabled=1
max_num_sta=20
ht_capab=[HT20][LDPC][SHORT-GI-20][SHORT-GI-40][TX-STBC][RX-STBC1][DSSS_CCK-40]

wpa=2
wpa_passphrase=xyzxyz
wpa_key_mgmt=WPA-PSK
wpa_group_rekey=3600
wpa_pairwise=CCMP TKIP
#wpa_pairwise=CCMP
rsn_pairwise=CCMP

logger_stdout=-1
logger_stdout_level=3
logger_syslog=-1
logger_syslog_level=3

ctrl_interface=/var/run/hostapd
ctrl_interface_group=0

wmm_ac_bk_cwmin=4
wmm_ac_bk_cwmax=10
wmm_ac_bk_aifs=7
wmm_ac_bk_txop_limit=0
wmm_ac_bk_acm=0
wmm_ac_be_aifs=3
wmm_ac_be_cwmin=4
wmm_ac_be_cwmax=10
wmm_ac_be_txop_limit=0
wmm_ac_be_acm=0
wmm_ac_vi_aifs=2
wmm_ac_vi_cwmin=3
wmm_ac_vi_cwmax=4
wmm_ac_vi_txop_limit=94
wmm_ac_vi_acm=0
wmm_ac_vo_aifs=2
wmm_ac_vo_cwmin=2
wmm_ac_vo_cwmax=3
wmm_ac_vo_txop_limit=47
wmm_ac_vo_acm=0


tx_queue_data3_aifs=7
tx_queue_data3_cwmin=15
tx_queue_data3_cwmax=1023
tx_queue_data3_burst=0
tx_queue_data2_aifs=3
tx_queue_data2_cwmin=15
tx_queue_data2_cwmax=63
tx_queue_data2_burst=0
tx_queue_data1_aifs=1
tx_queue_data1_cwmin=7
tx_queue_data1_cwmax=15
tx_queue_data1_burst=3.0
tx_queue_data0_aifs=1
tx_queue_data0_cwmin=3
tx_queue_data0_cwmax=7
tx_queue_data0_burst=1.5

I did find this message in journal

hostapd[8966]: CTRL_IFACE monitor[0]: 2 - No such file or directory

thank you for any help / tip to solve problem with connection of hostapd_cli to hostapd

Last edited by jancici (2020-01-27 14:18:28)

Offline

#2 2019-11-02 08:07:02

seth
Member
Registered: 2012-09-03
Posts: 49,950

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

It would seem that the daemon isn't running?

systemctl status hostapd

Offline

#3 2019-11-02 09:19:09

jancici
Member
From: svk
Registered: 2011-12-04
Posts: 190

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

yes, it is running, all wifi devices are connected and has access to network

sudo systemctl status hostapd.service 
● hostapd.service - Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
   Loaded: loaded (/usr/lib/systemd/system/hostapd.service; enabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/hostapd.service.d
           └─override.conf
   Active: active (running) since Fri 2019-11-01 18:54:55 CET; 15h ago
  Process: 8967 ExecStartPost=/usr/bin/iw dev wifina set txpower limit 1000 (code=exited, status=0/SUCCESS)
 Main PID: 8966 (hostapd)
    Tasks: 1 (limit: 4915)
   Memory: 2.5M
   CGroup: /system.slice/hostapd.service
           └─8966 /usr/bin/hostapd /etc/hostapd/hostapd.conf

Nov 02 04:42:27 skriatok hostapd[8966]: CTRL_IFACE monitor[1]: 2 - No such file or directory
Nov 02 04:42:27 skriatok hostapd[8966]: CTRL_IFACE monitor[2]: 2 - No such file or directory
Nov 02 04:42:27 skriatok hostapd[8966]: CTRL_IFACE monitor[3]: 2 - No such file or directory
Nov 02 04:42:27 skriatok hostapd[8966]: CTRL_IFACE monitor[4]: 2 - No such file or directory
Nov 02 04:42:27 skriatok hostapd[8966]: CTRL_IFACE monitor[5]: 2 - No such file or directory
Nov 02 04:42:27 skriatok hostapd[8966]: CTRL_IFACE monitor[6]: 2 - No such file or directory
Nov 02 04:42:27 skriatok hostapd[8966]: CTRL_IFACE monitor[7]: 2 - No such file or directory
Nov 02 04:42:27 skriatok hostapd[8966]: wifina: AP-STA-CONNECTED 60:01...
Nov 02 09:57:06 skriatok hostapd[8966]: wifina: AP-STA-CONNECTED 00:16...
Nov 02 10:11:28 skriatok hostapd[8966]: wifina: AP-STA-DISCONNECTED 00:1....

Offline

#4 2019-11-02 18:51:48

jancici
Member
From: svk
Registered: 2011-12-04
Posts: 190

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

I thinking that this could be a problem of wifi driver or kernel.
I am using mikrotik wifi card with atheros chip: Qualcomm Atheros AR958x 802.11abgn

lsmod|grep ath
ath9k                 180224  0
ath9k_common           40960  1 ath9k
ath9k_hw              512000  2 ath9k_common,ath9k
ath                    36864  3 ath9k_common,ath9k,ath9k_hw
mac80211              999424  2 ath9k,ath9k_hw
cfg80211              856064  4 ath9k_common,ath9k,ath,mac80211

what do you think?

All wifi devices are working ok only pizero is loosing connect, but that can be different reason.

Last edited by jancici (2019-11-02 19:02:27)

Offline

#5 2019-11-02 22:21:55

seth
Member
Registered: 2012-09-03
Posts: 49,950

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

The problem at hand is that the client cannot talk to the server, what can have all sorts of reasons.

stat /var/run/hostapd

Since you set the control group to "0" (root), did you run hostapd_cli as root?

Offline

#6 2019-11-03 07:39:30

jancici
Member
From: svk
Registered: 2011-12-04
Posts: 190

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

yes, I am running hostap_cli over sudo:

sudo hostapd_cli

here is stats

stat /var/run/hostapd
  File: /var/run/hostapd
  Size: 60        	Blocks: 0          IO Block: 4096   directory
Device: 16h/22d	Inode: 81770       Links: 2
Access: (0750/drwxr-x---)  Uid: (    0/    root)   Gid: (    0/    root)
Access: 2019-11-01 20:05:02.413638497 +0100
Modify: 2019-11-01 18:54:55.221580133 +0100
Change: 2019-11-01 18:54:55.221580133 +0100
 Birth: -

Offline

#7 2019-11-03 12:57:33

seth
Member
Registered: 2012-09-03
Posts: 49,950

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

So that looks sane - my last best guess would be that hostapd is locked somewhere, so you could attach strace or gdb to see what it's doing while it's (apparently) not responding.

Please clarify: did hostapd_cli use to work and recently failed or are you just trying to use it for the first time because the daemon is acting up otherwise?
In the latter case: how in particular?

Offline

#8 2019-11-03 13:58:38

jancici
Member
From: svk
Registered: 2011-12-04
Posts: 190

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

I did used hostapd_cli before and there was not any problem.

Usually I am restarting server because update of kernel (or some other important packages) and all my wifi devices are reconnected without problems.

There was update to kernel 5.3.8-arch1-1 few days ago. So I did restart server but raspberries didn;t reconnect. I did login to server and restart hostap, that did not help and raspberries was not connected. I did restart raspberries (unplug and plug power) and they did connect to wifi, everything looks OK. Then decided to restart hostapd. All wifi devices expect raspberries did reconnect without problems.

I am trying find out what is the problem using hostapd_cli but BUT it has problem to connect to daemon ...

Offline

#9 2019-11-03 15:04:10

seth
Member
Registered: 2012-09-03
Posts: 49,950

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

Can you talk to the daemon while the rpi's are off power? (In doubt after restarting it)

Offline

#10 2019-11-03 15:36:09

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

The last update to the hostapd package added the PrivateTmp directive to the service file. Does this somehow interfere?

https://git.archlinux.org/svntogit/comm … 64fd54a031

Last edited by progandy (2019-11-03 15:37:32)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#11 2019-11-03 19:16:08

jancici
Member
From: svk
Registered: 2011-12-04
Posts: 190

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

I did downgrade hostap to 2.9-1 and hostap_cli is working without problem.
I did also write new bug https://bugs.archlinux.org/task/64375

Offline

#12 2020-01-27 14:19:00

jancici
Member
From: svk
Registered: 2011-12-04
Posts: 190

Re: [SOLVED] hostapd_cli is not able to connect to hostapd

bug is closed and I can confirm that after update everything is working OK. thanks

Offline

Board footer

Powered by FluxBB