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

ffac-ssid-changer: rewrite in lua, use wifi reconf #138

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

maurerle
Copy link
Member

@maurerle maurerle commented Nov 3, 2024

This is a lua rewrite of the ffac-ssid-changer, which uses uci set wireless.$network.ssid and wifi reconf instead of the hostapd reload approach.

As we then can use uci revert and reconf, this is much lighter to handle and does only reload the radios for which a change is requested.

OWE radios are turned off when offline.

The other parts should stay the same.
This is not yet thoroughly tested, but works fine in first functionality tests by copying the script onto a gluon node and going offline and online again.

@maurerle
Copy link
Member Author

maurerle commented Nov 3, 2024

@blocktrron mentioned on IRC that the upcoming openwrt 24.x will have a way to do a dynamic wifi reconf without teardown of a reconfigured interface.
For now, clients are disconnected as the SSID changes.

I tried various things like
ubus call hostapd config_set '{"phy": "phy1", "config": "/var/run/hostapd-phy1.conf.new"}' to set a new config, which did set the config in hostapd (as Set new config for phy phy1: /var/run/hostapd-phy1.conf.new is logged).
However this change is not applied and ubus call hostapd.client0 reload did then reload the config from the /var/run again, so I don't know how config_set can work.

The most easiest way which works similar to the former behavior of reloading the hostapd with a changed config, can be done using:

uci set wireless.client_radio1.ssid='OfflineSSID'
wifi reconf

# now offline ssid exists

uci revert wireless
wifi reconf

# online ssid is used again

The rewrite does basically exactly this.

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

Successfully merging this pull request may close these issues.

1 participant