Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

daemon.err wifi-presence[6693]: Error: unable to connect to hostapd control socket "/var/run/hostapd/wlan0": ping error: read error from "PING" command: read unixgram /tmp/wp.wlan0->/var/run/hostapd/wlan0: i/o timeout #10

Open
pablomarquesmendez opened this issue Oct 24, 2022 · 7 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@pablomarquesmendez
Copy link

Hello there

I get this error in the logs when I start wifi-presence:

daemon.err wifi-presence[6693]: Error: unable to connect to hostapd control socket "/var/run/hostapd/wlan0": ping error: read error from "PING" command: read unixgram /tmp/wp.wlan0->/var/run/hostapd/wlan0: i/o timeout

ls -lrt /var/run/hostapd/

srwxrwx--- 1 network network 0 Oct 23 17:45 global
srwxrwx--- 1 network network 0 Oct 23 17:45 wlan0
srwxrwx--- 1 network network 0 Oct 23 17:45 wlan1

@pablomarquesmendez
Copy link
Author

something to do with ujail

@pablomarquesmendez
Copy link
Author

Temporary solution, delete or move /etc/capabilities/wpad.json file:
root@OpenWrt:~# mv /etc/capabilities/wpad.json ./

@awilliams
Copy link
Owner

awilliams commented Nov 21, 2022

Please try running wifi-presence using ujail with the same configuration options as hostapd.

For example, on my OS I see hostapd being run with these settings:

# ps w | grep hostapd | grep ujail
 1575 root      2656 S    {hostapd} /sbin/ujail -t 5 -n hostapd -U network -G network -C /etc/capabilities/wpad.json -c -- /usr/sbi

I'm then able to run wifi-presence in a similar way:

# /sbin/ujail -U network -G network -C /etc/capabilities/wpad.json -n wifi-presence /tmp/wifi-presence -mqtt.addr=tcp://mosquitto:1883 -verbose=1

Once there's more documentation for ujail I'll work on incorporating this into the run script.

Thanks for the bug report.

@awilliams awilliams added bug Something isn't working good first issue Good for newcomers labels Nov 21, 2022
@Ordspilleren
Copy link

I also ran intro this issue and discovered that simply running the service as the network user solves the problem by adding procd_set_param user network to the init file.

Alternatively, running wifi-presence in a jail with the same capabilities as hostapd also seems to solve the issue:

procd_add_jail fdfd log requirejail
procd_set_param capabilities /etc/capabilities/wpad.json

@presidentio
Copy link

I have the same issue

@presidentio
Copy link

Seems like this issue is fixed in the latest version(0.3.0)

@aiac
Copy link

aiac commented Aug 18, 2023

Even at 0.3.0 I had to do the procd_set_param user network trick in /etc/init.d/wifi-presence

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants