mattlongman / Hassio-Access-Point

Hass.io addon to let you create a WiFi access point, perfect for using WiFi devices on off-grid installations.
MIT License
81 stars 63 forks source link

clients disconnected one-by-one and add-on fails to stop/restart #75

Open henkkakay opened 1 month ago

henkkakay commented 1 month ago

Help please!

Version info:

Core 2024.5.3
Supervisor 2024.05.1
Operating System 12.3
Frontend 20240501.1

Hass.io Access Point version 0.5.2.1 - though I only upgraded from an earlier version (0.5.0?) after the problem below started.
I had since uninstalled the Add-On and re-installed. Problem persists

Symptoms below started around time when I upgraded everything to 2024.5 Before that everything worked very well and very stably Hardware is a TP-Link USB stick - if it is important I can dig out the model number

After system startup, one by one, my devices would get disconnected from the AP, and eventually the AP stops broadcasting and then everything gets disconnected. Attempts to stop the add-on to start again does not work. The only workaround is to physically reboot the whole system (a RaspPi 4) and it works for a while (up to maybe 6 or 8 hours?) then it happens again.

this is the log I get for when the devices are disconnected one by one...

wlp1s0u1u3: AP-STA-DISCONNECTED bb:cc:dd:ee:ff:aa
wlp1s0u1u3: STA bb:cc:dd:ee:ff:aa IEEE 802.11: disassociated due to inactivity
wlp1s0u1u3: STA bb:cc:dd:ee:ff:aa IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
wlp1s0u1u3: AP-STA-DISCONNECTED bb:cc:dd:ee:ff:cc
wlp1s0u1u3: STA bb:cc:dd:ee:ff:cc IEEE 802.11: disassociated due to inactivity
wlp1s0u1u3: STA bb:cc:dd:ee:ff:cc IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
wlp1s0u1u3: AP-STA-DISCONNECTED bb:cc:dd:ee:ff:bb
wlp1s0u1u3: STA bb:cc:dd:ee:ff:bb IEEE 802.11: disassociated due to inactivity
wlp1s0u1u3: AP-STA-DISCONNECTED bb:cc:dd:ee:ff:dd
wlp1s0u1u3: STA bb:cc:dd:ee:ff:dd IEEE 802.11: disassociated due to inactivity
wlp1s0u1u3: STA bb:cc:dd:ee:ff:bb IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
wlp1s0u1u3: STA bb:cc:dd:ee:ff:dd IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
wlp1s0u1u3: INTERFACE-DISABLED 
rfkill: Cannot open RFKILL control device
wlp1s0u1u3: INTERFACE-ENABLED 
Failed to set beacon parameters
wlp1s0u1u3: INTERFACE-DISABLED 
wlp1s0u1u3: INTERFACE-ENABLED 
nl80211: kernel reports: key not allowed
Failed to set beacon parameters

Snippet of log for when I try to shut down the add-on - the last line is the last log I get even if I wait for a long'ish time (log is from different session)

s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped
wlp1s0u1u3: interface state ENABLED->DISABLED
Stopping Hass.io Access Point
wlp1s0u1u3: AP-STA-DISCONNECTED aa:aa:aa:aa:aa:aa
wlp1s0u1u3: AP-STA-DISCONNECTED aa:aa:aa:aa:aa:ab
ifdown: interface wlp1s0u1u3 not configured
wlp1s0u1u3: AP-STA-DISCONNECTED aa:aa:aa:aa:aa:ac
wlp1s0u1u3: AP-STA-DISCONNECTED aa:aa:aa:aa:aa:ad
Failed to set beacon parameters
wlp1s0u1u3: AP-DISABLED 
wlp1s0u1u3: CTRL-EVENT-TERMINATING 
nl80211: deinit ifname=wlp1s0u1u3 disabled_11b_rates=0

Then when I try to start the add-on again this is what I get.. this seems to be where things start to go wrong

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
s6-rc: info: service legacy-services successfully started
Starting Hass.io Access Point Addon
# Setup interface:
Add to /etc/network/interfaces: iface wlp1s0u1u3 inet static
Run command: nmcli dev set wlp1s0u1u3 managed no
Warning: nmcli (1.44.4) and NetworkManager (1.44.2) versions don't match. Restarting NetworkManager is advised.
Run command: ip link set wlp1s0u1u3 down
Add to /etc/network/interfaces: address 192.168.xxx.1
Add to /etc/network/interfaces: netmask 255.255.255.0
Add to /etc/network/interfaces: broadcast 192.168.xxx.255
Run command: ip link set wlp1s0u1u3 up
ip: ioctl 0x8914 failed: Resource busy
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped
s6-rc: info: service legacy-cont-init: stopping
s6-rc: info: service legacy-cont-init successfully stopped
s6-rc: info: service fix-attrs: stopping
s6-rc: info: service fix-attrs successfully stopped
s6-rc: info: service s6rc-oneshot-runner: stopping
s6-rc: info: service s6rc-oneshot-runner successfully stopped

It seems the shutdown command couldnt finish and so the startup also count be completed.

I have added skip_inactive_poll=1 to the hostapd custom config and that seems to have extended a bit the time before inactive but still didnt fix the problem.

MegaBarf commented 1 month ago

Same here. Funny thing is that the Network is working for some minutes after a restart before it starts breaking.

I got it working by downgrading Home Assistant OS to 12.2 I used a terminal addon and did "ha os update --version 12.2"

Downgrading the Supervisor before did not help.

henkkakay commented 1 month ago

Thanks @MegaBarf - doesnt the Home Assistant OS do auto-upgrade so it will again upgrade itself to 12.3?

edit: ok it is the core/supervisor that auto-updates, not the OS edit2: also did the same thing - it seems to be work and be ok - but need to monitor for a while

ROBOT0-VT commented 1 month ago

I'll investigate when I have time again next weekend. Thanks for bringing this to my attention.