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

mediatek-mt7622: Add support for D-Link EAGLE PRO AI R32 A1 #3332

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RolandoMagico
Copy link
Contributor

@RolandoMagico RolandoMagico commented Aug 14, 2024

  • Must be flashable from vendor firmware
    • Web interface
    • TFTP
    • Other: D-Link recovery web interface
  • Must support upgrade mechanism
    • Must have working sysupgrade
      • Must keep/forget configuration (sysupgrade [-n], firstboot)
    • Gluon profile name matches autoupdater image name
      (lua -e 'print(require("platform_info").get_image_name())')
  • Reset/WPS/... button must return device into config mode
  • Primary MAC address should match address on device label (or packaging)
    (https://gluon.readthedocs.io/en/latest/dev/hardware.html#hardware-support-in-packages)
    • When re-adding a device that was supported by an earlier version of Gluon, a
      factory reset must be performed before checking the primary MAC address, as
      the setting from the old version is not reset otherwise.
  • Wired network
    • should support all network ports on the device
    • must have correct port assignment (WAN/LAN)
      • if there are multiple ports but no WAN port:
        • the PoE input should be WAN, all other ports LAN
        • otherwise the first port should be declared as WAN, all other ports LAN
  • Wireless network (if applicable)
    • Association with AP must be possible on all radios
    • Association with 802.11s mesh must work on all radios
    • AP+mesh mode must work in parallel on all radios
  • LED mapping
    • Power/system LED
    • Radio LEDs
      • Should map to their respective radio
      • Should show activity
    • Switch port LEDs
      • Should map to their respective port (or switch, if only one led present)
      • Should show link state and activity
  • Outdoor devices only:
    • Added board name to is_outdoor_device function in package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
  • Cellular devices only:
    • Added board name to is_cellular_device function in package/gluon-core/luasrc/usr/lib/lua/gluon/platform.lua
    • Added board name with modem setup function setup_ncm_qmi to package/gluon-core/luasrc/lib/gluon/upgrade/250-cellular
  • Docs:
    • Added Device to docs/user/supported_devices.rst

@github-actions github-actions bot added 3. topic: docs Topic: Documentation 3. topic: hardware Topic: Hardware Support labels Aug 14, 2024
@blocktrron
Copy link
Member

Radio LEDs are not working?

@RolandoMagico
Copy link
Contributor Author

RolandoMagico commented Aug 16, 2024

Radio LEDs are not working?

Not as I would expect. 2.4G is on by default and it's flickering while there is traffic on 2.4GHz. 5G is off by default and there is also no change during traffic on 5GHz wifi.

Update: also tried to get a defined behavior in OpenWrt using the LED settings, but also no success there.

@blocktrron
Copy link
Member

Sorry for the late reply - if the LEDs are not working, please add the broken flag and remove the device from the documentation. Everything else LGTM.

@RolandoMagico RolandoMagico force-pushed the D-Link_R32 branch 2 times, most recently from cc999d0 to e5077a2 Compare November 18, 2024 17:42
@github-actions github-actions bot removed the 3. topic: docs Topic: Documentation label Nov 18, 2024
@RolandoMagico
Copy link
Contributor Author

Sorry for the late reply - if the LEDs are not working, please add the broken flag and remove the device from the documentation. Everything else LGTM.

Done

@Djfe
Copy link
Contributor

Djfe commented Dec 10, 2024

This is pretty much ready to be merged. This device is marked as broken so it won't be backported into the last stable release 2023.2.x. and main's next release is going to be based on OpenWrt 24.10 which was merged a few days ago.
Please help us out and rebase your PR a second time. Then retest the device (due to the new OpenWrt release).

It's likely that the new OpenWrt release (candidate) broke some stuff so that will need fixing anyways so it's only in your interest for this to be tested. (issues that might affect other mt7622 devices as well)
Since OpenWrt adjusted how MAC addresses are loaded (definition is now in the dts as you probably know) please retest whether the primary mac on firstboot is still the mac address which is silkscreened onto the device.

If you don't have the time to do the tests, then please tell us :)

@RolandoMagico
Copy link
Contributor Author

RolandoMagico commented Dec 13, 2024

@Djfe: I rebased and built the image. What I saw so far:

  • Primary MAC is correct
  • Wifi LED issue still present
  • Wifi was not working. Also in config mode, there were errors reported when trying to configure wifi:
    image
    image

I'm not an expert in gluon. Do you know if is related to my build setup or it is a general issue?

My build environment:
https://github.com/RolandoMagico/site-ffrgb/tree/R32-Test

Command I used:
make GLUON_TARGETS=mediatek-mt7622 BROKEN=1
Thanks
Roland

@Djfe
Copy link
Contributor

Djfe commented Dec 13, 2024

there were one or two issues fixed very recently
openwrt/openwrt@1be18c6
openwrt/openwrt@00860e4
atleast the first one is essential and wasn't merged into gluon main, yet.
We still have to test lots of stuff around the next OpenWrt release to find bugs like these.

I had the same issue you experienced with the netgear wax206. Thanks for confirming that more device than one are affected.
So it's either the issue above or in some way target related.
Thanks for reporting back.

I'll check on my WAX206 soon (with the fix above)
Once the issue has been cleared I'm going to inform you again over the forum.

@rotanid
Copy link
Member

rotanid commented Dec 25, 2024

the issues should be fixed by the latest 24.10 updates in gluon main, no?
@RolandoMagico could you rebase and test again?

@github-actions github-actions bot added 3. topic: docs Topic: Documentation 3. topic: package Topic: Gluon Packages labels Dec 25, 2024
@github-actions github-actions bot removed 3. topic: docs Topic: Documentation 3. topic: package Topic: Gluon Packages labels Dec 25, 2024
@RolandoMagico
Copy link
Contributor Author

RolandoMagico commented Dec 25, 2024

@rotanid: The problem was already gone when creating the PR for the M30. But I'll build and test to be sure.

Update: Problem still exits :-(

@rotanid rotanid added the 2. status: blocked Marked as blocked because it's waiting on something label Dec 25, 2024
@rotanid
Copy link
Member

rotanid commented Dec 25, 2024

@RolandoMagico the error 500? did you do a full clean build to be sure?
@Djfe @blocktrron any ideas?

@RolandoMagico
Copy link
Contributor Author

@rotanid: Yes Same error as before. I did a clean build

@maurerle
Copy link
Member

maurerle commented Dec 28, 2024

@RolandoMagico can you post the output of iwinfo and iw phy?

And play around with this lua snippet, to see what is wrong with the phyname:

iwinfo = require 'iwinfo'
t = iwinfo.nl80211.phyname("radio0")
print(t)

@RolandoMagico
Copy link
Contributor Author

@maurerle: I did a rebase and checked that the problem still exists -> yes it does.
After flashing, I entered config mode:

  • Output of iwinfo (yes, nothing):
  • Output of iw phy
Wiphy phy1
        wiphy index: 1
        max # scan SSIDs: 4
        max scan IEs length: 2190 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports AP-side u-APSD.
        Device supports T-DLS.
        Available Antennas: TX 0xf RX 0xf
        Configured Antennas: TX 0xf RX 0xf
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * mesh point
                 * P2P-client
                 * P2P-GO
        Band 2:
                Capabilities: 0x9ff
                        RX LDPC
                        HT20/HT40
                        SM Power Save disabled
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 7935 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 4 usec (0x05)
                HT TX/RX MCS rate indexes supported: 0-31
                VHT Capabilities (0x739b79f1):
                        Max MPDU length: 7991
                        Supported Channel Width: 160Mhz (1/2 NSS)
                        RX LDPC
                        short GI (80 MHz)
                        short GI (160/80+80 MHz)
                        TX STBC
                        SU Beamformer
                        SU Beamformee
                        MU Beamformer
                        MU Beamformee
                        RX antenna pattern consistency
                        TX antenna pattern consistency
                VHT RX MCS set:
                        1 streams: MCS 0-9
                        2 streams: MCS 0-9
                        3 streams: MCS 0-9
                        4 streams: MCS 0-9
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT RX highest supported: 0 Mbps
                VHT TX MCS set:
                        1 streams: MCS 0-9
                        2 streams: MCS 0-9
                        3 streams: MCS 0-9
                        4 streams: MCS 0-9
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT TX highest supported: 0 Mbps
                VHT extended NSS: supported
                HE Iftypes: managed
                        HE MAC Capabilities (0x08011a000040):
                                +HTC HE Supported
                                Trigger Frame MAC Padding Duration: 2
                                OM Control
                                Maximum A-MPDU Length Exponent: 3
                                A-MSDU in A-MPDU
                        HE PHY Capabilities: (0x4c700e926d0bf3164e3f00):
                                HE40/HE80/5GHz
                                HE160/5GHz
                                242 tone RUs/5GHz
                                Device Class: 1
                                LDPC Coding in Payload
                                HE SU PPDU with 1x HE-LTF and 0.8us GI
                                NDP with 4x HE-LTF and 3.2us GI
                                STBC Tx <= 80MHz
                                STBC Rx <= 80MHz
                                DCM Max Constellation: 2
                                DCM Max Constellation Rx: 2
                                SU Beamformer
                                SU Beamformee
                                Beamformee STS <= 80Mhz: 3
                                Beamformee STS > 80Mhz: 3
                                Sounding Dimensions <= 80Mhz: 3
                                Sounding Dimensions > 80Mhz: 1
                                Codebook Size SU Feedback
                                Codebook Size MU Feedback
                                Triggered CQI Feedback
                                Partial Bandwidth Extended Range
                                Partial Bandwidth DL MU-MIMO
                                PPE Threshold Present
                                Power Boost Factor ar
                                HE SU PPDU & HE PPDU 4x HE-LTF 0.8us GI
                                Max NC: 2
                                20MHz in 40MHz HE PPDU 2.4GHz
                                20MHz in 160/80+80MHz HE PPDU
                                80MHz in 160/80+80MHz HE PPDU
                                DCM Max BW: 1
                                Longer Than 16HE SIG-B OFDM Symbols
                                Non-Triggered CQI Feedback
                                TX 1024-QAM
                                RX 1024-QAM
                                RX Full BW SU Using HE MU PPDU with Compression SIGB
                                RX Full BW SU Using HE MU PPDU with Non-Compression SIGB
                        HE RX MCS and NSS set <= 80 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: MCS 0-11
                                4 streams: MCS 0-11
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        HE TX MCS and NSS set <= 80 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: MCS 0-11
                                4 streams: MCS 0-11
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        HE RX MCS and NSS set 160 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: not supported
                                4 streams: not supported
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        HE TX MCS and NSS set 160 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: not supported
                                4 streams: not supported
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        PPE Threshold 0x3b 0x1c 0xc7 0x71 0x1c 0xc7 0x71 0x1c 0xc7 0x71
                HE Iftypes: AP
                        HE MAC Capabilities (0x00051a081044):
                                +HTC HE Supported
                                TWT Responder
                                BSR
                                OM Control
                                Maximum A-MPDU Length Exponent: 3
                                BQR
                                A-MSDU in A-MPDU
                                OM Control UL MU Data Disable RX
                        HE PHY Capabilities: (0x0c200e926f0baf10000c00):
                                HE40/HE80/5GHz
                                HE160/5GHz
                                LDPC Coding in Payload
                                NDP with 4x HE-LTF and 3.2us GI
                                STBC Tx <= 80MHz
                                STBC Rx <= 80MHz
                                DCM Max Constellation: 2
                                DCM Max Constellation Rx: 2
                                SU Beamformer
                                SU Beamformee
                                MU Beamformer
                                Beamformee STS <= 80Mhz: 3
                                Beamformee STS > 80Mhz: 3
                                Sounding Dimensions <= 80Mhz: 3
                                Sounding Dimensions > 80Mhz: 1
                                Codebook Size SU Feedback
                                Codebook Size MU Feedback
                                Triggered SU Beamforming Feedback
                                Triggered MU Beamforming Feedback
                                Partial Bandwidth Extended Range
                                PPE Threshold Present
                                Max NC: 2
                                TX 1024-QAM
                                RX 1024-QAM
                        HE RX MCS and NSS set <= 80 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: MCS 0-11
                                4 streams: MCS 0-11
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        HE TX MCS and NSS set <= 80 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: MCS 0-11
                                4 streams: MCS 0-11
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        HE RX MCS and NSS set 160 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: not supported
                                4 streams: not supported
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        HE TX MCS and NSS set 160 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: not supported
                                4 streams: not supported
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        PPE Threshold 0x3b 0x1c 0xc7 0x71 0x1c 0xc7 0x71 0x1c 0xc7 0x71
                HE Iftypes: mesh point
                        HE MAC Capabilities (0x00011a000040):
                                +HTC HE Supported
                                OM Control
                                Maximum A-MPDU Length Exponent: 3
                                A-MSDU in A-MPDU
                        HE PHY Capabilities: (0x0c200c0000000000008000):
                                HE40/HE80/5GHz
                                HE160/5GHz
                                LDPC Coding in Payload
                                STBC Tx <= 80MHz
                                STBC Rx <= 80MHz
                        HE RX MCS and NSS set <= 80 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: MCS 0-11
                                4 streams: MCS 0-11
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        HE TX MCS and NSS set <= 80 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: MCS 0-11
                                4 streams: MCS 0-11
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        HE RX MCS and NSS set 160 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: not supported
                                4 streams: not supported
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                        HE TX MCS and NSS set 160 MHz
                                1 streams: MCS 0-11
                                2 streams: MCS 0-11
                                3 streams: not supported
                                4 streams: not supported
                                5 streams: not supported
                                6 streams: not supported
                                7 streams: not supported
                                8 streams: not supported
                Frequencies:
                        * 5180.0 MHz [36] (23.0 dBm)
                        * 5200.0 MHz [40] (23.0 dBm)
                        * 5220.0 MHz [44] (23.0 dBm)
                        * 5240.0 MHz [48] (23.0 dBm)
                        * 5260.0 MHz [52] (20.0 dBm) (radar detection)
                        * 5280.0 MHz [56] (20.0 dBm) (radar detection)
                        * 5300.0 MHz [60] (20.0 dBm) (radar detection)
                        * 5320.0 MHz [64] (20.0 dBm) (radar detection)
                        * 5500.0 MHz [100] (26.0 dBm) (radar detection)
                        * 5520.0 MHz [104] (26.0 dBm) (radar detection)
                        * 5540.0 MHz [108] (26.0 dBm) (radar detection)
                        * 5560.0 MHz [112] (26.0 dBm) (radar detection)
                        * 5580.0 MHz [116] (26.0 dBm) (radar detection)
                        * 5600.0 MHz [120] (26.0 dBm) (radar detection)
                        * 5620.0 MHz [124] (26.0 dBm) (radar detection)
                        * 5640.0 MHz [128] (26.0 dBm) (radar detection)
                        * 5660.0 MHz [132] (26.0 dBm) (radar detection)
                        * 5680.0 MHz [136] (26.0 dBm) (radar detection)
                        * 5700.0 MHz [140] (26.0 dBm) (radar detection)
                        * 5720.0 MHz [144] (13.0 dBm) (radar detection)
                        * 5745.0 MHz [149] (13.0 dBm)
                        * 5765.0 MHz [153] (13.0 dBm)
                        * 5785.0 MHz [157] (13.0 dBm)
                        * 5805.0 MHz [161] (13.0 dBm)
                        * 5825.0 MHz [165] (13.0 dBm)
                        * 5845.0 MHz [169] (13.0 dBm)
                        * 5865.0 MHz [173] (13.0 dBm)
                        * 5885.0 MHz [177] (disabled)
        valid interface combinations:
                 * #{ IBSS } <= 1, #{ AP, mesh point } <= 16, #{ managed } <= 19,
                   total <= 19, #channels <= 1, STA/AP BI must match, radar detect widths: { 20 MHz (no HT), 20 MHz, 40 MHz, 80 MHz, 160 MHz }

        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        max # scan plans: 1
        max scan plan interval: -1
        max scan plan iterations: 0
        Supported extended features:
                * [ VHT_IBSS ]: VHT-IBSS
                * [ RRM ]: RRM
                * [ BEACON_RATE_LEGACY ]: legacy beacon rate setting
                * [ BEACON_RATE_HT ]: HT beacon rate setting
                * [ BEACON_RATE_VHT ]: VHT beacon rate setting
                * [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
                * [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
                * [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
                * [ ACK_SIGNAL_SUPPORT ]: ack signal level support
                * [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
                * [ SCAN_RANDOM_SN ]: use random sequence numbers in scans
                * [ SCAN_MIN_PREQ_CONTENT ]: use probe request with only rate IEs in scans
                * [ CAN_REPLACE_PTK0 ]: can safely replace PTK 0 when rekeying
                * [ AIRTIME_FAIRNESS ]: airtime fairness scheduling
                * [ AQL ]: Airtime Queue Limits (AQL)
                * [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
                * [ DEL_IBSS_STA ]: deletion of IBSS station support
                * [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
                * [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
                * [ FILS_DISCOVERY ]: FILS discovery frame transmission support
                * [ UNSOL_BCAST_PROBE_RESP ]: unsolicated broadcast probe response transmission support
                * [ BEACON_RATE_HE ]: HE beacon rate support (AP/mesh)
                * [ BSS_COLOR ]: BSS coloring support
                * [ RADAR_BACKGROUND ]: Radar background support
                * [ POWERED_ADDR_CHANGE ]: can change MAC address while up
Wiphy phy0
        wiphy index: 0
        max # scan SSIDs: 4
        max scan IEs length: 2304 bytes
        max # sched scan SSIDs: 0
        max # match sets: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Device supports AP-side u-APSD.
        Device supports T-DLS.
        Available Antennas: TX 0xf RX 0xf
        Configured Antennas: TX 0xf RX 0xf
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * AP/VLAN
                 * monitor
                 * mesh point
                 * P2P-client
                 * P2P-GO
        Band 1:
                Capabilities: 0x1ff
                        RX LDPC
                        HT20/HT40
                        SM Power Save disabled
                        RX Greenfield
                        RX HT20 SGI
                        RX HT40 SGI
                        TX STBC
                        RX STBC 1-stream
                        Max AMSDU length: 3839 bytes
                        No DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: No restriction (0x00)
                HT TX/RX MCS rate indexes supported: 0-31
                Frequencies:
                        * 2412.0 MHz [1] (20.0 dBm)
                        * 2417.0 MHz [2] (20.0 dBm)
                        * 2422.0 MHz [3] (20.0 dBm)
                        * 2427.0 MHz [4] (20.0 dBm)
                        * 2432.0 MHz [5] (20.0 dBm)
                        * 2437.0 MHz [6] (20.0 dBm)
                        * 2442.0 MHz [7] (20.0 dBm)
                        * 2447.0 MHz [8] (20.0 dBm)
                        * 2452.0 MHz [9] (20.0 dBm)
                        * 2457.0 MHz [10] (20.0 dBm)
                        * 2462.0 MHz [11] (20.0 dBm)
                        * 2467.0 MHz [12] (20.0 dBm)
                        * 2472.0 MHz [13] (20.0 dBm)
                        * 2484.0 MHz [14] (disabled)
        valid interface combinations:
                 * #{ IBSS } <= 1, #{ managed, AP, mesh point, P2P-client, P2P-GO } <= 16,
                   total <= 16, #channels <= 1, STA/AP BI must match, radar detect widths: { 20 MHz (no HT), 20 MHz, 40 MHz, 80 MHz, 80+80 MHz, 160 MHz }

        HT Capability overrides:
                 * MCS: ff ff ff ff ff ff ff ff ff ff
                 * maximum A-MSDU length
                 * supported channel width
                 * short GI for 40 MHz
                 * max A-MPDU length exponent
                 * min MPDU start spacing
        max # scan plans: 1
        max scan plan interval: 0
        max scan plan iterations: 0
        Supported extended features:
                * [ VHT_IBSS ]: VHT-IBSS
                * [ RRM ]: RRM
                * [ SET_SCAN_DWELL ]: scan dwell setting
                * [ FILS_STA ]: STA FILS (Fast Initial Link Setup)
                * [ CQM_RSSI_LIST ]: multiple CQM_RSSI_THOLD records
                * [ CONTROL_PORT_OVER_NL80211 ]: control port over nl80211
                * [ TXQS ]: FQ-CoDel-enabled intermediate TXQs
                * [ CAN_REPLACE_PTK0 ]: can safely replace PTK 0 when rekeying
                * [ AIRTIME_FAIRNESS ]: airtime fairness scheduling
                * [ AQL ]: Airtime Queue Limits (AQL)
                * [ CONTROL_PORT_NO_PREAUTH ]: disable pre-auth over nl80211 control port support
                * [ DEL_IBSS_STA ]: deletion of IBSS station support
                * [ SCAN_FREQ_KHZ ]: scan on kHz frequency support
                * [ CONTROL_PORT_OVER_NL80211_TX_STATUS ]: tx status for nl80211 control port support
                * [ POWERED_ADDR_CHANGE ]: can change MAC address while up

@RolandoMagico
Copy link
Contributor Author

Output of iwinfo phy0 info:

phy0      ESSID: unknown
          Access Point: 00:00:00:00:00:00
          Mode: Unknown  Channel: unknown (unknown)  HT Mode: HT20
          Center Channel 1: unknown 2: unknown
          Tx-Power: unknown  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11b/g/n
          Hardware: embedded [MediaTek MT7622]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy0
  • Output of iwinfo phy1 info
phy1      ESSID: unknown
          Access Point: 00:00:00:00:00:00
          Mode: Unknown  Channel: unknown (unknown)  HT Mode: HT20
          Center Channel 1: unknown 2: unknown
          Tx-Power: unknown  Link Quality: unknown/70
          Signal: unknown  Noise: unknown
          Bit Rate: unknown
          Encryption: unknown
          Type: nl80211  HW Mode(s): 802.11ac/ax/n
          Hardware: 14C3:7915 14C3:7915 [MediaTek MT7915E]
          TX power offset: none
          Frequency offset: none
          Supports VAPs: yes  PHY name: phy1

@RolandoMagico
Copy link
Contributor Author

@maurerle

Code:

iwinfo = require 'iwinfo'
t = iwinfo.nl80211.phyname("radio0")
print(t)

Output:
nil

Code:

iwinfo = require 'iwinfo'
t = iwinfo.nl80211.phyname("phy0")
print(t)

Output:
phy0

Code:

iwinfo = require 'iwinfo'
t = iwinfo.nl80211.phyname("phy1")
print(t)

Output:
phy1

@maurerle
Copy link
Member

Weird, can you show uci show wireless output?

@RolandoMagico
Copy link
Contributor Author

RolandoMagico commented Dec 28, 2024

Weird, can you show uci show wireless output?

Sure:

wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.phy='wl0'
wireless.radio0.band='2g'
wireless.radio0.channel='1'
wireless.radio0.htmode='HT20'
wireless.radio0.disabled='1'
wireless.default_radio0=wifi-iface
wireless.default_radio0.device='radio0'
wireless.default_radio0.network='lan'
wireless.default_radio0.mode='ap'
wireless.default_radio0.ssid='OpenWrt'
wireless.default_radio0.encryption='none'
wireless.radio1=wifi-device
wireless.radio1.type='mac80211'
wireless.radio1.phy='wl1'
wireless.radio1.band='5g'
wireless.radio1.channel='36'
wireless.radio1.htmode='HE80'
wireless.radio1.disabled='1'
wireless.default_radio1=wifi-iface
wireless.default_radio1.device='radio1'
wireless.default_radio1.network='lan'
wireless.default_radio1.mode='ap'
wireless.default_radio1.ssid='OpenWrt'
wireless.default_radio1.encryption='none'

Can it be related to openwrt/openwrt#14207? I tried already reverting the commit causing the issue but then I don't have any wireless settings in gluon instead (tabs for wifi configuration are not present anymore).

@maurerle
Copy link
Member

So the root of the problem is that

is nil. It typically is called with radio0 and radio1 there.

On a Ubiquity Unifi 6 LR v3 - which also names the radios as wl0 and wl1 - with older firmware,
I get this uci output from uci show wireless:

wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.path='platform/18000000.wmac'
wireless.radio0.channel='11'
wireless.radio0.band='2g'
wireless.radio0.htmode='HT20'
wireless.radio0.country='DE'
wireless.radio0.legacy_rates='0'
wireless.radio1=wifi-device
wireless.radio1.type='mac80211'
wireless.radio1.path='1a143000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0'
wireless.radio1.channel='44'
wireless.radio1.band='5g'
wireless.radio1.htmode='HE20'
wireless.radio1.country='DE'

Note that a path exists, but a wireless.radio0.phy='wl0' does not exist.

iwinfo.nl80211.phyname("radio0") should return wl0 (so should iwinfo nl80211 phyname radio0).

So I suspect something going wrong in get_phyname of iwinfo ..

https://github.com/openwrt/iwinfo/blob/9ff15f7ee3a0cb3a56c3e34561fc8b219cc8b1cc/iwinfo_nl80211.c#L2016

Though it looks fine to access .phy if .path does not exist when getting the name from uci:

https://github.com/openwrt/iwinfo/blob/9ff15f7ee3a0cb3a56c3e34561fc8b219cc8b1cc/iwinfo_nl80211.c#L404

I don't know what else could go wrong here

@rotanid
Copy link
Member

rotanid commented Dec 29, 2024

@blocktrron do you have an idea based on the information and analysis already done?

@RolandoMagico
Copy link
Contributor Author

Not sure if it helps but that's what I also see in OpenWrt when running uci show wireless:
image

Left side is OpenWrt 23.05.5 where the wireless device names are shown correctly in LuCI, right side is from 24.10rc4 where "Generic Unkown" is shown.

But after enabling wifi interfaces in LuCI in 24.10rc4, the path entry is still not present in uci show wireless

@Djfe

This comment was marked as outdated.

@RolandoMagico
Copy link
Contributor Author

@Djfe : Now I'm running out of git and building skills.
Tried to build gluon next branch, but it fails:

#
# configuration written to .config
#
make[3]: Leaving directory '/home/roland/R32/site-ffrgb/gluon-build/openwrt'
Configuration failed:
 * unable to set '# CONFIG_SECCOMP is not set'
make[2]: *** [Makefile:190: config] Fehler 1
make[2]: Verzeichnis „/home/roland/R32/site-ffrgb/gluon-build“ wird verlassen
make[1]: *** [Makefile:40: build] Fehler 2
make[1]: Verzeichnis „/home/roland/R32/site-ffrgb“ wird verlassen
make: *** [Makefile:30: all] Fehler 2

Also seems not be easy to cherry-pick openwrt/openwrt@2e03c7d in the OpenWrt 24.10 branch.

Any tips how to build current OpenWrt main?
Thanks
Roland

@maurerle
Copy link
Member

Hi @RolandoMagico
The mebtioned commit by @Djfe fixes a related error in hostapd - I don't think that it is directl related to the error you were seeing.

I would rather flash openwrt-snapshot and take a look at iwinfo nl80211 phyname radio0 output there, as this issue should be reproducible without gluon as well :)

@RolandoMagico
Copy link
Contributor Author

Thanks @maurerle
The output from OpenWrt SNAPSHOT r28444-1aae1dfaf2 / LuCI Master 24.365.05279~f843014 after flashing (Wifi is disabled):

root@OpenWrt:~# iwinfo nl80211 phyname radio0
Phy not found

The output after enabling wifi0 in LuCI:

iwinfo nl80211 phyname radio0
wl0

Same output with OpenWrt 24.10.0-rc4 r28211-d55754ce0d / LuCI openwrt-24.10 branch 24.357.59006~41cbd31

For comparision, the output of OpenWrt 23.05.5 r24106-10cc5fcd00 / LuCI openwrt-23.05 branch git-24.264.56413-c7a3562:

  • After flashing (wifi disabled):
iwinfo nl80211 phyname radio0
phy0
  • After enabling wifi:
iwinfo nl80211 phyname radio0
wl0

All tests were done with the recovery image from the OpenWrt firmware selector.

@rotanid rotanid added the 2. status: waiting-on-upstream Waiting for upstream changes label Dec 31, 2024
@rotanid
Copy link
Member

rotanid commented Dec 31, 2024

so this proves it's not an Issue in Gluon, but was introduced in OpenWrt main some time after 23.05 was branched.

@RolandoMagico
Copy link
Contributor Author

so this proves it's not an Issue in Gluon, but was introduced in OpenWrt main some time after 23.05 was branched.

If the output of iwinfo nl80211 phyname radio0 is a reliable indicator for the problem:

iwinfo nl80211 phyname radio0
phy0
iwinfo nl80211 phyname radio0
Phy not found

So there seems to be a relation between the issue I face here and openwrt/openwrt#14207

Would be great if anyone can confirm that the problem is also present on other MT7622 devices, to be sure it's not related to the M32 only.

I also tried to revert the changes from openwrt/openwrt@b993a00 in the current OpenWrt main. But as mentioned already earlier, wifi doesn't work at all anymore. I assume that there have been multiple changes in the wifi scripts since, so it's hard for me to track down what else was changed and relies on the changes of openwrt/openwrt@b993a00

@maurerle
Copy link
Member

wifi doesn't work at all anymore

In Gluon right?
In OpenWrt everything works fine?

So I think, that this is a Gluon-only issue and we should add an additional fallback in

function M.find_phy(config)
return iwinfo.nl80211.phyname(config['.name'])
end

to get the wl0 name from something else as the upstream behavior changed, to only return if the wifi interface is up as well?
Probably something like we did before 29e281f

I don't have an additional mt7622 device I can test on - though I am quite confident that this is the right spot and that this will apply to all devices which have wl0 instead of phy0.

Related issue is #3020 which was fixed in #3223 (the aforementioned gluon commit).

@neocturne - as you did the previous patch, maybe you have a good idea here?

@RolandoMagico
Copy link
Contributor Author

In OpenWrt everything works fine?

No, it’s an issue in OpenWrt: after reversing the changes from the mentioned commit in OpenWrt main, WiFi doesn’t work anymore. There is also no wireless menu in LuCI anymore

@maurerle maurerle mentioned this pull request Dec 31, 2024
@maurerle
Copy link
Member

oh okay, so #3408 will not fix it either..? Hm, sorry then - I don't quite know what to do further

@neocturne
Copy link
Member

I'll have to check the iwinfo code again

@RolandoMagico
Copy link
Contributor Author

My assumption: As soon as openwrt/openwrt#14207 is fixed in OpenWrt, you won't have any issues in gluon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2. status: blocked Marked as blocked because it's waiting on something 2. status: waiting-on-upstream Waiting for upstream changes 3. topic: hardware Topic: Hardware Support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants