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

gluon-core: lua: wireless: use libiwinfo-lua for find_phy() #3223

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

neocturne
Copy link
Member

find_phy() did not match OpenWrt's logic for PHY names anymore, and could not handle PHYs that don't match the 'phyX' naming scheme. Instead of trying to add more complex logic to our own code, simply do what OpenWrt does and use iwinfo to resolve UCI sections to PHY names.

Supersedes #3155
Closes #3020

Draft: This is entirely untested. Will test on an FB4040 tomorrow - would be great to get a test on a device with wifiX PHY names as well.

There is some subsequent cleanup possible by passing around only UCI section names instead of the whole section table (which may not even need to be queried at all in some cases), but that will happen as a separate PR, so this one can be backported to 2023.2.x.

find_phy() did not match OpenWrt's logic for PHY names anymore, and
could not handle PHYs that don't match the 'phyX' naming scheme. Instead
of trying to add more complex logic to our own code, simply do what
OpenWrt does and use iwinfo to resolve UCI sections to PHY names.
@maurerle
Copy link
Member

I just tested the fix by manually editing the patch into the lua on a Ubiquiti UniFi 6 LR v3 - which has a working status page now.
I also tested this on a COVR-X1860 which works well too.

Copy link
Member

@maurerle maurerle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I knew there would be an easy working way to achieve this 😊

@kpanic23
Copy link
Contributor

Tested on Xiaomi AX3200, works flawlessly!

@neocturne
Copy link
Member Author

Thanks for testing. By the way, does the PHY renaming only happen when the WiFi is enabled, or also in Config Mode?

If would be good to have some more tests of the affected code paths:

  • gluon-reconfigure runs without errors in config mode
  • WLAN settings in the config mode Advanced Settings are displayed correctly

@maurerle
Copy link
Member

gluon-reconfigure works fine too (on afffected, as well as on a not-affected device) - I do not have physical access to a wlX device, so I can not test config mode.

@rotanid
Copy link
Member

rotanid commented Mar 19, 2024

@kpanic23 are you able to do the additional tests, too? would be great :)

@Djfe
Copy link
Contributor

Djfe commented Mar 20, 2024

in-case anyone needs a build:
https://firmware.freifunk-aachen.de/firmware/test-mt7622-fix/

Djfe pushed a commit to Djfe/site that referenced this pull request Mar 20, 2024
Djfe pushed a commit to Djfe/site that referenced this pull request Mar 20, 2024
Djfe pushed a commit to Djfe/site that referenced this pull request Mar 21, 2024
freifunk-gluon/gluon#3223

also fix issue building threetime-reboot package
@kpanic23
Copy link
Contributor

image
Config mode works flawlessly!

@neocturne
Copy link
Member Author

@kpanic23 Please also check the things I asked in a comment above:

  • How are the PHYs named in config mode (shown in iw phy)?
  • Does gluon-reconfigure show any error messages in config mode?

@rotanid
Copy link
Member

rotanid commented Mar 26, 2024

@kpanic23 Please also check the things I asked in a comment above:

* How are the PHYs named in config mode (shown in `iw phy`)?

* Does `gluon-reconfigure` show any error messages in config mode?

@neocturne i tested this on a Xiaomi AX3200 with the ffac images provided by @Djfe .

results:
https://paste.tecff.de/?1e7437d45d420825#4EzXr1CQ455jTuVDHCU6JtXQWyA1xEq1zrVCULaiqrBU
https://paste.tecff.de/?2d9355d02cd3a407#EADo2BK8zLEYAUzpTUZfsBF2qVShVGKukrfGHjCjNUL7

any other test or info needed for this PR?

@neocturne neocturne marked this pull request as ready for review March 26, 2024 17:25
@neocturne
Copy link
Member Author

Thanks! Everything looking as I expected, so this should be ready. A bit confusing that PHY names are different between config mode and regular operation (because renaming happens when the WiFi is started), but that is on OpenWrt, and AFAIK we don't display the PHY names anywhere in the config UI or status page.

@rotanid rotanid merged commit 28951a0 into freifunk-gluon:master Mar 26, 2024
9 checks passed
@neocturne neocturne deleted the find_phy-iwinfo branch March 26, 2024 22:47
@neocturne neocturne added the backport v2023.2.x Backport this pull request to v2023.1.x label Mar 26, 2024
Copy link

Successfully created backport PR for v2023.2.x:

Copy link

Git push to origin failed for v2023.2.x with exitcode 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. topic: package Topic: Gluon Packages backport v2023.2.x Backport this pull request to v2023.1.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UniFi 6 LR status page - internal server error 500
5 participants