基于MT76开源WiFi驱动下的wireless增加STA配置记录



  • /etc/config/network

    config interface 'wwan'
            option proto 'dhcp'
    

    /etc/config/wireless

    config wifi-iface 'default_radio1'
            option device 'radio0'
            option network 'wwan'
            option mode 'sta'
            option ssid 'yourAP'
            option encryption 'psk2'
            option key 'yourSecret'
    


  • 配置之后ifconfig多出了wlan0,但是没有连接上AP,没有获取IP地址,怎么进一步定位问题在哪里。make menuconfig已经选中编译了kmod-mt76。
    wlan0 Link encap:Ethernet HWaddr 02:00:00:00:00:00
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)



  • @liweikui 是openwrt-18以后的固件吗?



  • 是的,使用的是gitee上最新的master分支固件。https://gitee.com/openwrt-mirror/openwrt。有什么不一样吗?多谢!



  • @liweikui 那就应该可以用的,上传你的 wireless network 配置
    以及ifconfig 输出



  • network配置:
    config interface 'loopback'
    option ifname 'lo'
    option proto 'static'
    option ipaddr '127.0.0.1'
    option netmask '255.0.0.0'

    config globals 'globals'
    option ula_prefix 'fd0c:955c:7c71::/48'

    config interface 'lan'
    option type 'bridge'
    option ifname 'eth0.1'
    option proto 'static'
    option ipaddr '192.168.1.1'
    option netmask '255.255.255.0'
    option ip6assign '60'

    config device 'lan_eth0_1_dev'
    option name 'eth0.1'
    option macaddr '56:63:bd:06:6c:27'

    config interface 'wan'
    option ifname 'eth0.2'
    option proto 'dhcp'

    config interface 'wwan'
    option proto 'dhcp'

    config device 'wan_eth0_2_dev'
    option name 'eth0.2'
    option macaddr '56:63:bd:06:6c:28'

    config interface 'wan6'
    option ifname 'eth0.2'
    option proto 'dhcpv6'

    config switch
    option name 'switch0'
    option reset '1'
    option enable_vlan '1'

    config switch_vlan
    option device 'switch0'
    option vlan '1'
    option ports '1 2 3 4 6t'

    config switch_vlan
    option device 'switch0'
    option vlan '2'
    option ports '0 6t'

    wireless配置:
    config wifi-device 'radio0'
    option type 'mac80211'
    option channel '36'
    option hwmode '11a'
    option path 'virtual/mac80211_hwsim/hwsim0'
    option htmode 'VHT80'
    option disabled '0'

    config wifi-iface 'default_radio0'
    option device 'radio0'
    option network 'lan'
    option mode 'ap'
    option ssid 'OpenWrt'
    option encryption 'none'

    config wifi-device 'radio1'
    option type 'mac80211'
    option channel 'auto'
    option hwmode '11g'
    option path 'virtual/mac80211_hwsim/hwsim1'
    option htmode 'VHT80'
    option disabled '0'

    config wifi-iface 'default_radio1'
    option device 'radio1'
    option network 'wwan'
    option mode 'sta'
    option ssid 'routerdwifi-2.4G'
    option encryption 'psk2'
    option key '260308abc'

    root@OpenWrt:/# ifconfig
    br-lan Link encap:Ethernet HWaddr 56:63:BD:06:6C:27
    inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
    inet6 addr: fe80::5463:bdff:fe06:6c27/64 Scope:Link
    inet6 addr: fd0c:955c:7c71::1/60 Scope:Global
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:1860 (1.8 KiB)

    eth0 Link encap:Ethernet HWaddr 56:59:F6:21:1A:AD
    inet6 addr: fe80::5459:f6ff:fe21:1aad/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:45522 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:15483928 (14.7 MiB)
    Interrupt:5

    eth0.1 Link encap:Ethernet HWaddr 56:63:BD:06:6C:27
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:1860 (1.8 KiB)

    eth0.2 Link encap:Ethernet HWaddr 56:63:BD:06:6C:28
    inet6 addr: fe80::5463:bdff:fe06:6c28/64 Scope:Link
    UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:31 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:6862 (6.7 KiB)

    lo Link encap:Local Loopback
    inet addr:127.0.0.1 Mask:255.0.0.0
    inet6 addr: ::1/128 Scope:Host
    UP LOOPBACK RUNNING MTU:65536 Metric:1
    RX packets:15644 errors:0 dropped:0 overruns:0 frame:0
    TX packets:15644 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:1063792 (1.0 MiB) TX bytes:1063792 (1.0 MiB)

    wlan0 Link encap:Ethernet HWaddr 02:00:00:00:00:00
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

    wlan1 Link encap:Ethernet HWaddr 02:00:00:00:01:00
    UP BROADCAST MULTICAST MTU:1500 Metric:1
    RX packets:0 errors:0 dropped:0 overruns:0 frame:0
    TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
    collisions:0 txqueuelen:1000
    RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)



  • 不好意思,配置太长,回复内容有滚动条,就不用这么长的回复了,那个是怎么实现的。



  • config wifi-device 'radio0'
    option type 'mac80211'
    option channel '36'
    option hwmode '11a'
    option path 'virtual/mac80211_hwsim/hwsim0'
    option htmode 'VHT80'
    option disabled '0'
    

    这部分不是2.4G配置啊,你的编译没按照MT7688平台?



  • 选则平台:
    Target System (MediaTek Ralink MIPS)
    --->
    Subtarget (MT76x8 based boards )

    Wireless Driver里选择mt76:
    -- k mod- mac802..................... L inux 802.11 Wi reless Networking Stack
    <
    > kmod- mac80211- hwsim........................ mac80211 HW s imulation device
    <> kmod-mt76...........
    MediaTek MT76x2/MT7603 wireless driver (metapackage )
    < > kmod-mt7601u.... .
    MT7601U-based USB dongles Wireless Driver
    -- kmod- mt7603. ............................. MediaTek MT7603 wireless driver
    < > kmod-mt76x0.......................... MediaTek MT76x0E wireless driver
    < >kmod- mt76x0u....
    MediaTek MT76x0U wireless driver
    -
    - kmod -mt76x2......
    ..... MediaTek MT76x2 wireless driver
    < >kmod-mt76x2u............................ MediaTek MT76x2U wireless driver
    < >kmod- mwifiex-pcie

    然后编译,wireless配置文件就是那样的了。

    mt76这个开源驱动,怎么编译、配置、使用,有相关的帖子或者文档吗?:)



  • <> kmod- mac802..................... L inux 802.11 Wi reless Networking Stack
    <
    > kmod- mac80211- hwsim........................ mac80211 HW s imulation device
    <*> kmod-mt76...........
    这些都是选择上的。

    我是想在openwrt上使用wps_supplicant,但是在mtk官方的wifi驱动下,这个命令用不了。所有我想用开源的wifi驱动试试。我的芯片型号是MT7628。



  • @liweikui 我感觉你可能是忘选了mac80211?


Log in to reply