Cannot ssh in to OpenWrt router over wifi?

I have OpenWrt running on a Pi 4.
So far, while testing, I just have it running as another device connected to my LAN.

I am simply trying to ssh in to OpenWrt over Wifi.
I can ssh to it just fine over ethernet.

When I start with a fresh /etc/config/wireless...
wifi config
This is what I get...

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '36'
        option hwmode '11a'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option htmode 'VHT80'
        option disabled '1'

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

This is the 5GHz radio on the Pi 4... but it also has a 2.4GHz radio, why is that not also in the /etc/config/wireless? I'm confused about this part but my laptop that I want to ssh in from only supports 802.11n Wifi over 2.4GHz radio. My home router does understand 2.4 and 5GHz.

If I make some changes to that file... comment out "option disabled" and add in my county code and the encryption type and key then do this:

> wifi reload

The output of wifi status: shows that 5GHz radio is "Up" : true.
Now the wlan0 interface shows up in ifconfig however with no ip address.
Also,that 5GHz wireless network doesn't show up in my home routers admin page.

When I booted up the Pi with this firmware for the first time I DID have both radios in /etc/config/wireless ... there were two config wifi-iface and two config wifi-device sections each with a different option path xxx

This is the output of iw list

root@OpenWrt:~# iw list
Wiphy phy0
        wiphy index: 0
        max # scan SSIDs: 10
        max scan IEs length: 2048 bytes
        max # sched scan SSIDs: 16
        max # match sets: 16
        max # scan plans: 1
        max scan plan interval: 508
        max scan plan iterations: 0
        Retry short limit: 7
        Retry long limit: 4
        Coverage class: 0 (up to 0m)
        Available Antennas: TX 0 RX 0
        Supported interface modes:
                 * IBSS
                 * managed
                 * AP
                 * P2P-client
                 * P2P-GO
                 * P2P-device
        Band 1:
                Capabilities: 0x1022
                        HT20/HT40
                        Static SM Power Save
                        RX HT20 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT TX/RX MCS rate indexes supported: 0-7
                Frequencies:
                        * 2412 MHz [1] (20.0 dBm)
                        * 2417 MHz [2] (20.0 dBm)
                        * 2422 MHz [3] (20.0 dBm)
                        * 2427 MHz [4] (20.0 dBm)
                        * 2432 MHz [5] (20.0 dBm)
                        * 2437 MHz [6] (20.0 dBm)
                        * 2442 MHz [7] (20.0 dBm)
                        * 2447 MHz [8] (20.0 dBm)
                        * 2452 MHz [9] (20.0 dBm)
                        * 2457 MHz [10] (20.0 dBm)
                        * 2462 MHz [11] (20.0 dBm)
                        * 2467 MHz [12] (20.0 dBm)
                        * 2472 MHz [13] (20.0 dBm)
                        * 2484 MHz [14] (disabled)
        Band 2:
                Capabilities: 0x1062
                        HT20/HT40
                        Static SM Power Save
                        RX HT20 SGI
                        RX HT40 SGI
                        No RX STBC
                        Max AMSDU length: 3839 bytes
                        DSSS/CCK HT40
                Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
                Minimum RX AMPDU time spacing: 16 usec (0x07)
                HT TX/RX MCS rate indexes supported: 0-7
                VHT Capabilities (0x00001020):
                        Max MPDU length: 3895
                        Supported Channel Width: neither 160 nor 80+80
                        short GI (80 MHz)
                        SU Beamformee
                VHT RX MCS set:
                        1 streams: MCS 0-9
                        2 streams: not supported
                        3 streams: not supported
                        4 streams: not supported
                        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: not supported
                        3 streams: not supported
                        4 streams: not supported
                        5 streams: not supported
                        6 streams: not supported
                        7 streams: not supported
                        8 streams: not supported
                VHT TX highest supported: 0 Mbps
                Frequencies:
                        * 5170 MHz [34] (disabled)
                        * 5180 MHz [36] (20.0 dBm)
                        * 5190 MHz [38] (disabled)
                        * 5200 MHz [40] (20.0 dBm)
                        * 5210 MHz [42] (disabled)
                        * 5220 MHz [44] (20.0 dBm)
                        * 5230 MHz [46] (disabled)
                        * 5240 MHz [48] (20.0 dBm)
                        * 5260 MHz [52] (20.0 dBm) (no IR, radar detection)
                        * 5280 MHz [56] (20.0 dBm) (no IR, radar detection)
                        * 5300 MHz [60] (20.0 dBm) (no IR, radar detection)
                        * 5320 MHz [64] (20.0 dBm) (no IR, radar detection)
                        * 5500 MHz [100] (20.0 dBm) (no IR, radar detection)
                        * 5520 MHz [104] (20.0 dBm) (no IR, radar detection)
                        * 5540 MHz [108] (20.0 dBm) (no IR, radar detection)
                        * 5560 MHz [112] (20.0 dBm) (no IR, radar detection)
                        * 5580 MHz [116] (20.0 dBm) (no IR, radar detection)
                        * 5600 MHz [120] (20.0 dBm) (no IR, radar detection)
                        * 5620 MHz [124] (20.0 dBm) (no IR, radar detection)
                        * 5640 MHz [128] (20.0 dBm) (no IR, radar detection)
                        * 5660 MHz [132] (20.0 dBm) (no IR, radar detection)
                        * 5680 MHz [136] (20.0 dBm) (no IR, radar detection)
                        * 5700 MHz [140] (20.0 dBm) (no IR, radar detection)
                        * 5720 MHz [144] (disabled)
                        * 5745 MHz [149] (disabled)
                        * 5765 MHz [153] (disabled)
                        * 5785 MHz [157] (disabled)
                        * 5805 MHz [161] (disabled)
                        * 5825 MHz [165] (disabled)
        valid interface combinations:
                 * #{ managed } <= 1, #{ P2P-device } <= 1, #{ P2P-client, P2P-GO } <= 1,
                   total <= 3, #channels <= 2
                 * #{ managed } <= 1, #{ AP } <= 1, #{ P2P-client } <= 1, #{ P2P-device } <= 1,
                   total <= 4, #channels <= 1
        Supported extended features:
                * [ 4WAY_HANDSHAKE_STA_PSK ]: 4-way handshake with PSK in station mode
                * [ 4WAY_HANDSHAKE_STA_1X ]: 4-way handshake with 802.1X in station mode
                * [ DFS_OFFLOAD ]: DFS offload
                * [ SAE_OFFLOAD ]: SAE offload support
root@OpenWrt:~#

So this does see both 2.4 and 5GHz radios.

Here is my /etc/config/network:

config interface 'wan'
        option ifname 'eth1'
        option proto 'dhcp'

config interface 'lan'
        option ifname 'eth0'
        option type 'bridge'
        option proto 'dhcp'

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

So I guess I have two questions:

  1. Why does wifi config create an /etc/config/wireless file with only the 5GHz radio?
  2. How do I set this up so I can ssh to the OpenWrt over Wifi connection?

Thank you,

Flex

That's an issue.

I'd troubleshoot this first?

Did you upgrade the OpenWrt recently?

Hello lleachii,

Yes I installed the rpi-4-ext4-factory.img.gz snapshot two days ago... 29th Nov 2020 I think.

When I first installed it and booted up the Pi 4 my /etc/config/wireless file did have both radios in it.. I made a backup of it. But now when I delete that file and do

wifi config

it only detects the 5GHz radio not the 2.4GHz.

I'm very new to all this... for now I just have the Pi4 OpenWrt box connected as another host in my LAN. I can ssh in fine with it connected by ethernet to my LAN via eth0. I would like to also be able to ssh over wifi to it. I currently connect from my laptop to my home router over wifi. So I think I need the router to connect to the OpenWrt device over Wifi.

How do I set that up? Does the OpenWrt need to be a client or an Access Point I'm not sure? And is there anything else I can try/debug about wifi config not seeing the 2.4Ghz radio on the Pi 4?

Thank you,

Flex

The Pi has a single radio which can operate on 2.4 or 5, but not both at the same time. To change to 2.4 change the option hwmode to '11g' and htmode to 'HT20' or (if you have absolutely no neighbors) HT40, and select a channel in the 2.4 band.

Also for best results set your country code with option country.

There are different ways to connect over wifi. Having a wired lan connection and also setting up an access point will make the Pi an extra access point, i.e. a coverage extender. The other major use case is to make the built in wifi a client of your home network and put it on the wan side. This allows the Pi and anything wired to it to access the Internet, but to log in from the home network you would need to open the firewalled port(s) in OpenWrt.

1 Like

Thanks a lot mk24,

Yes I definitely want to get OpenWrt working as a client to my home router as well but for now I'm trying to get it working as an access point so I can connect to it directly from my laptop.

My laptop wifi adapter can only work at 802.11n at 2.4GHz band and 20MHz (htmode I think)

But no matter what I try I can't get the Pi 4 radio to work at 2.4GHz. (It will create an AP on 5GHz)

This config never comes "up":

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        #option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option channel '2'
        option hwmode '11g'
        option htmode 'HT20'
        option country 'IE'

config wifi-iface 'wifinet2'
        option device 'radio0'
        option mode 'ap'
        option encryption 'psk2'
        option key 'mypassword'
        option network 'lan'
        option ssid 'OpenWrt-2.4G'

When I delete the /etc/config/wireless and do: wifi config I get this:

config wifi-device 'radio0'
        option type 'mac80211'
        option channel '34'
        option hwmode '11a'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option htmode 'VHT80'
        option disabled '1'

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

It's like OpenWrt cannot see the 2.4GHz mode on the Pi4. I wonder is that a bug? Hopefully it's something I'm doing wrong.

These are some errors I see in the System log

Tue Dec  1 23:11:35 2020 daemon.notice netifd: radio0 (10779): Could not find PHY for device 'radio0'
Tue Dec  1 23:11:35 2020 daemon.notice netifd: radio0 (10795): WARNING: Variable 'data' does not exist or is not an array/object
Tue Dec  1 23:14:40 2020 daemon.notice netifd: radio0 (10975): Could not find PHY for device 'radio0'
Tue Dec  1 23:14:40 2020 daemon.notice netifd: radio0 (10988): WARNING: Variable 'data' does not exist or is not an array/object
Tue Dec  1 23:15:10 2020 daemon.err uwsgi[946]: *** has_emperor mode detected (fd: 8) ***
Tue Dec  1 23:15:10 2020 daemon.err uwsgi[946]: [uWSGI] getting INI configuration from /etc/uwsgi/vassals/luci-cgi_io.ini
Tue Dec  1 23:15:10 2020 daemon.err uwsgi[946]: Tue Dec  1 23:15:10 2020 - [emperor] vassal /etc/uwsgi/vassals/luci-cgi_io.ini has been spawned
Tue Dec  1 23:15:10 2020 daemon.err uwsgi[946]: Tue Dec  1 23:15:10 2020 - [emperor] vassal /etc/uwsgi/vassals/luci-cgi_io.ini is ready to accept requests

Maybe I need to fill in wpa_supplicant details as discussed in this GitHub thread or install a missing module? There is also a thread on these OpenWrt forums about the same thing looks like. I tried those fixes but still can't bring up 2.4GHz wifi.

Thank you,

Flex

Why did you change the hardware path? Don't change the hardware path. Could not find PHY means the chip was not found. There is only one chip so it will have the same path.

1 Like

Ok I changed the hardware path back to:
option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'

I thought that other hardware path:
option path 'platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'

.. was somehow linked to the 2.4GHz radio. I got those two hardware paths from the /etc/wireless/config after installing OpenWrt for the first time so I figured each radio had a different hardware path.. Guess I was wrong?

Because...

platform/soc/fe300000.mmcnr... seems to be linked to the 5GHz radio?

When I make /etc/wireless/config like this:

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        #option path 'platform/soc/3f300000.mmc/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option channel '36'
        option hwmode '11g'
        option htmode 'HT20'
        option country 'IE'

config wifi-iface 'wifinet1'
        option device 'radio0'
        option mode 'ap'
        option encryption 'psk2'
        option key 'mypassword'
        option network 'lan'
        option ssid 'OpenWrt-2.4G'

I get this in Luci

Even though I set the hwmode to 11g it still switches on the 5GHz radio except that doesn't appear in my phone so I cannot connect to it. (My phone is compatible with 5GHz, my laptop is 2.4GHz only). Also, not sure why it's Client Mode when I asked for "AP" and Channel 34 when I asked for "36"?

And here is the System log...

Tue Dec  1 23:54:16 2020 daemon.notice netifd: radio0 (2034): command failed: No error information (-524)
Tue Dec  1 23:54:17 2020 daemon.notice netifd: radio0 (2034): command failed: I/O error (-5)
Tue Dec  1 23:54:18 2020 daemon.notice hostapd: Configuration file: /var/run/hostapd-phy0.conf (phy wlan0) --> new PHY
Tue Dec  1 23:54:18 2020 kern.info kernel: [  321.295957] br-lan: port 2(wlan0) entered blocking state
Tue Dec  1 23:54:18 2020 kern.info kernel: [  321.301306] br-lan: port 2(wlan0) entered disabled state
Tue Dec  1 23:54:18 2020 kern.info kernel: [  321.306752] device wlan0 entered promiscuous mode
Tue Dec  1 23:54:18 2020 daemon.notice hostapd: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Tue Dec  1 23:54:18 2020 daemon.notice hostapd: Could not determine operating frequency
Tue Dec  1 23:54:18 2020 daemon.notice hostapd: wlan0: interface state COUNTRY_UPDATE->DISABLED
Tue Dec  1 23:54:18 2020 daemon.notice hostapd: wlan0: AP-DISABLED
Tue Dec  1 23:54:18 2020 daemon.err hostapd: wlan0: Unable to setup interface.
Tue Dec  1 23:54:18 2020 daemon.notice hostapd: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Tue Dec  1 23:54:18 2020 kern.info kernel: [  321.324864] device wlan0 left promiscuous mode
Tue Dec  1 23:54:18 2020 kern.info kernel: [  321.329360] br-lan: port 2(wlan0) entered disabled state
Tue Dec  1 23:54:19 2020 daemon.notice hostapd: wlan0: CTRL-EVENT-TERMINATING
Tue Dec  1 23:54:19 2020 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan0 wasn't started
Tue Dec  1 23:54:19 2020 daemon.notice netifd: radio0 (2034): Command failed: Invalid argument

Could not determine operating frequency?

Any ideas, thanks very much for help,

Flex

You're asking it to tune a 5 GHz channel (36) while in g mode and it can't do that.

When hwmode is 11g the channel needs to be in the 2.4 band, numbers 1-11. (12 and 13 are allowed in some countries but don't try that yet).

1 Like

I have tried channel 1,2 and 3 so far. Still trying the others (up to 13).

I do wifi reload and check for errors with uci show wireless > /dev/null each time. Sometimes I reboot. Still it's stuck on thinking the radio is 5GHz instead of 2.4GHz.

Here is some of the System log when I rebooted after changing to channel 3.

Wed Dec  2 00:56:12 2020 daemon.notice netifd: radio0 (2821): Command failed: Invalid argument
Wed Dec  2 00:56:13 2020 daemon.notice netifd: radio0 (2821): command failed: No error information (-524)
Wed Dec  2 00:56:13 2020 daemon.notice netifd: radio0 (2833): command failed: No error information (-524)
Wed Dec  2 00:56:13 2020 daemon.notice netifd: radio0 (2833): command failed: I/O error (-5)
Wed Dec  2 00:56:18 2020 daemon.notice hostapd: Configuration file: /var/run/hostapd-phy0.conf (phy wlan0) --> new PHY
Wed Dec  2 00:56:18 2020 kern.info kernel: [  722.008260] br-lan: port 2(wlan0) entered blocking state
Wed Dec  2 00:56:18 2020 kern.info kernel: [  722.013593] br-lan: port 2(wlan0) entered disabled state
Wed Dec  2 00:56:18 2020 kern.info kernel: [  722.019049] device wlan0 entered promiscuous mode
Wed Dec  2 00:56:18 2020 daemon.notice hostapd: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Wed Dec  2 00:56:18 2020 daemon.err hostapd: Driver does not support configured HT capability [SHORT-GI-40]
Wed Dec  2 00:56:18 2020 daemon.notice hostapd: wlan0: interface state COUNTRY_UPDATE->DISABLED
Wed Dec  2 00:56:18 2020 daemon.notice hostapd: wlan0: AP-DISABLED
Wed Dec  2 00:56:18 2020 daemon.err hostapd: wlan0: Unable to setup interface.
Wed Dec  2 00:56:18 2020 daemon.notice hostapd: nl80211: deinit ifname=wlan0 disabled_11b_rates=0
Wed Dec  2 00:56:18 2020 kern.info kernel: [  722.038213] device wlan0 left promiscuous mode
Wed Dec  2 00:56:18 2020 kern.info kernel: [  722.042731] br-lan: port 2(wlan0) entered disabled state
Wed Dec  2 00:56:18 2020 daemon.notice hostapd: wlan0: CTRL-EVENT-TERMINATING
Wed Dec  2 00:56:18 2020 daemon.err hostapd: hostapd_free_hapd_data: Interface wlan0 wasn't started
Wed Dec  2 00:56:18 2020 daemon.notice netifd: radio0 (2833): Command failed: Invalid argument
Wed Dec  2 00:56:44 2020 daemon.err uwsgi[941]: *** has_emperor mode detected (fd: 8) ***
Wed Dec  2 00:56:44 2020 daemon.err uwsgi[941]: [uWSGI] getting INI configuration from /etc/uwsgi/vassals/luci-cgi_io.ini
Wed Dec  2 00:56:44 2020 daemon.err uwsgi[941]: Wed Dec  2 00:56:44 2020 - [emperor] vassal /etc/uwsgi/vassals/luci-cgi_io.ini has been spawned
Wed Dec  2 00:56:44 2020 daemon.err uwsgi[941]: Wed Dec  2 00:56:44 2020 - [emperor] vassal /etc/uwsgi/vassals/luci-cgi_io.ini is ready to accept requests

Should I be concerned about the messages?

daemon.err hostapd: Driver does not support configured HT capability [SHORT-GI-40]
wlan0: Unable to setup interface.

The short-GI-40 was reported before.

Maybe there is a hardware fault on the Pi 4 with its 2.4GHz radio? How else can I check if the 2.4GHz radio is really working on my Pi? Or is it a firewall issue?

Thank you,

Flex

I finally got my Pi 4 running OpenWrt to create a 2.4GHz Access Point !

I tried many combinations of things.

To set up a 2.4GHz Access Point, this is my /etc/config/wireless...

config wifi-device 'radio0'
        option type 'mac80211'
        option path 'platform/soc/fe300000.mmcnr/mmc_host/mmc1/mmc1:0001/mmc1:0001:1'
        option hwmode '11g'
        option country 'IE'
        option channel '7'

config wifi-iface 'radio024'
        option device 'radio0'
        option mode 'ap'
        option ssid 'OpenWrt-2.4G'
        option encryption 'psk2'
        option key 'mysecretpwd'
        option network 'lan'

In addition to this a key point is to set the Mode to Legacy.
After applying the new configuration you may also need to reboot the device. I don't think wifi reload was enough.

image

I also read advice to turn off 5GHz on the router came from here but I didn't find that was needed.
The hint to turn the Mode to "Legacy" came from here and here.
Other people have reported problems with getting Wifi to work on a Pi running OpenWrt.

Thanks to mk24 and IIeachii for help,

Flex

Yes I was going to suggest that. I don't know where the [SHORT-GI-40] comes from; it must have something to do with /lib/netifd/hostapd.sh which translates /etc/config/wireless into /var/run/hostapd-phy0.conf. But a quick grep of the script does not find that phrase.

Going to legacy mode removes all HT-related configs. Of course it also cuts the performance back to g rates.

This is apparently a bug. The generated config should not automatically add things that the driver will reject.

That's disappointing. Well hopefully it's being looked into.. seems to have been a problem since 2018 at least. Maybe it's not considered urgent because most people have devices that can work with 5GHz.

Flex

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.