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

[SOLVED] Disconnecting is not working anymore #19

Open
Rosentine opened this issue Aug 20, 2022 · 4 comments
Open

[SOLVED] Disconnecting is not working anymore #19

Rosentine opened this issue Aug 20, 2022 · 4 comments

Comments

@Rosentine
Copy link

Rosentine commented Aug 20, 2022

Hi,

i found out that method used to disconnect STA i not valid anymore (don't know when was it changed).

Method that is used in script is wnm_disassoc_imminent and has to be changed to del_client

To make script work again, I had to modify this function:

function Device:disconnect_sta(sta)
local endpoint = "hostapd." .. self.ifname
conn:call(endpoint, "wnm_disassoc_imminent", {
addr = sta.addr,
duration = 120,
abridged = true,
})
inf("%s: disconnected %s", self.ifname, tostring(sta))
end

TO THIS:

function Device:disconnect_sta(sta)
local endpoint = "hostapd." .. self.ifname
conn:call(endpoint, "del_client", {
addr = sta.addr,
reason = 1,
deauth = true,
ban_time = 120000,
})
inf("%s: disconnected %s", self.ifname, tostring(sta))
end

@barbieri
Copy link
Owner

hi @Rosentine, as you can see in other comments in this project, I'm not using openwrt anymore (moved to UniFi access points and UDM as gateway), so I cannot test... It used to be del_client, but since b132691 it was moved to wnm_disassoc_imminent to make it bit smoother.

So maybe just get the older version?

@SirLouen
Copy link

SirLouen commented Feb 24, 2023

hi @Rosentine, as you can see in other comments in this project, I'm not using openwrt anymore (moved to UniFi access points and UDM as gateway), so I cannot test... It used to be del_client, but since b132691 it was moved to wnm_disassoc_imminent to make it bit smoother.

So maybe just get the older version?

You went to the dark side!

I needed a WAP network for my home automation devices (around 80-100 units), and I found that historically the regular WAP config, was a mess, because many of these devices were connecting with -80dB and even worse, when there was a another dumb AP better and nearer, just because many of these little gadgets were dumber than the dumb AP (many Chinese products with low quality componentes)

So I was planning to move to Omada (instead of Unify, that is way more expensive), but then I found all these things and I've set up all the OpenWRT routers I had in my storage room to work for me.

I got to say that wmn_disassoc_imminet is way better for those that use Roaming services for Wireless devices but terrible for static devices (even when blacklisting). They still kept appearing and disappearing. I'm testing @Rosentine proposal, and seem to be working better still need more testing.

EDIT: Still not working well

My wifi-iface config:

option signal_connect '-70'
option signal_stay '-72'
option signal_strikes '3'
option signal_poll_time '5'

Then I see

wifi-disconnect-low-signal: wlan0: ignored A8:03:2A:B7:1E:D4 (blacklist)
wifi-disconnect-low-signal: wlan0: A8:03:2A:B6:39:50 signal=-49dBm snr=-49dBm strikes=0 (threshold: signal_stay=-72 strikes=3): good signal

That is blacklisted, but connected in LuCI

image

So this hack has not solved the issue

I've seen that also in the OpenWRT forums someone else reported this
https://forum.openwrt.org/t/wi-fi-roaming-recipe/70538/5

@barbieri
Copy link
Owner

I have some iot devices (sonoff switches), the best solution is to add a wifi AP near them. It can be a cheap, 2.4Ghz only, you can lower the power to minimum level they "pair", but that's it. I have some with openwrt that I used before moving to UniFi, like in the kitchen and in a shaft...

Note: the blacklist is to avoid sending the disconnect, not to avoid it to be connected, see my docs:

signal_blacklist (string:""): comma-separators MAC Address prefixes to avoid applying the algorithm. Uses the subject being the uppercase without the ":" separators (string.upper(string.gsub(a, ":", ""))). If provided, only non-matching STA will be considered

@barbieri
Copy link
Owner

also, I'm not following the forums and all, but since people seems to have interest in this code and I'm not using it anymore, shall people want to move it to somewhere else, I can join in there to help with code review and stay in touch, then I delete it here an refer to the new repo where more people can contribute.

If there is no standard "openwrt repo", I can spin off a new repo and add contributors there... this one is like a "catch all my stuff that I do not bother to create a repo", thus the "playground" name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants