Issue connecting to Wifi via WPA2 on openwrt

Hello,

I’m having issues connecting my Raspberry Pi 4 to my wifi network. I have 2 radios, both on WPA2. Screenshot of my openwrt settings below. What settings do I configure for the dietpi-wifi.txt file? Do I have to do WPA-EAP instead? If so what do I fill in? It was minimal setup on my router for WPA2.




# Entry 0
# - WiFi SSID: required, case sensitive
aWIFI_SSID[0]='Wireless'
# - WiFi key: If no key/open, leave this blank
aWIFI_KEY[0]='
# - Key type: NONE (no key/open) | WPA-PSK | WEP | WPA-EAP (then use settings below)
aWIFI_KEYMGR[0]='WPA-PSK'
# - WPA-EAP options: Only fill if WPA-EAP is set above
aWIFI_PROTO[0]=''
aWIFI_PAIRWISE[0]=''
aWIFI_AUTH_ALG[0]=''
aWIFI_EAP[0]=''
aWIFI_IDENTITY[0]=''
aWIFI_PASSWORD[0]=''
aWIFI_PHASE1[0]=''
aWIFI_PHASE2[0]=''
# - Path to the certificate file, e.g.: /boot/mycert.cer
aWIFI_CERT[0]=''

No, you don’t have WPA-EAP, use the WPA-PSK.
Be careful cause you have posted the WPA Key in the post above.

For further troubleshooting post from OpenWrt the uci export wireless (redact the WPA keys from there as well)



 root@OpenWrt:~# uci export wireless
package wireless

config wifi-device 'radio0'
        option type 'mac80211'
        option hwmode '11a'
        option path 'soc/1b500000.pci/pci0000:00/0000:00:00.0/0000:01:00.0'
        option legacy_rates '0'
        option htmode 'VHT80'
        option channel 'auto'

config wifi-iface 'default_radio0'
        option device 'radio0'
        option network 'lan'
        option mode 'ap'
        option key ''
        option ieee80211w '1'
        option ssid '0'
        option encryption 'sae-mixed'

config wifi-device 'radio1'
        option type 'mac80211'
        option hwmode '11g'
        option path 'soc/1b700000.pci/pci0001:00/0001:00:00.0/0001:01:00.0'
        option channel 'auto'
        option legacy_rates '0'
        option htmode 'HT40'

config wifi-iface 'default_radio1'
        option device 'radio1'
        option network 'lan'
        option mode 'ap'
        option key ''
        option ssid 'Wss'
        option encryption 'psk-mixed+ccmp'

Hi,

Many thanks for your message. Is DietPi already running? Or do you like to configure WiFi together with the initial setup?

I ended up switching one of my WiFi settings to be WPA-PSK on the router for the 2.4 band, so I’m setup and running on that.

My question is how can I connect to my 5.0 band network that now runs with WPA2/WPA3? It seems like only WPA-PSK security works and nothing higher with just using a password

Hi,

I tested it with my RPi3B+ without issues. I created an unique 5GHz WiFi using WP2/WPA3 and could connect with the RPi using WPA-PSK without issues. The RPi was connected using WPA2.

picture1.PNG

root@DietPi3:~# ip a
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether xxx brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.70/24 brd 192.168.0.255 scope global dynamic wlan0
       valid_lft 86372sec preferred_lft 86372sec
root@DietPi3:~#



root@DietPi3:~# cat /etc/wpa_supplicant/wpa_supplicant.conf
# Grant all members of group "netdev" permissions to configure WiFi, e.g. via wpa_cli or wpa_gui
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
# Allow wpa_cli/wpa_gui to overwrite this config file
update_config=1
network={
        ssid="Home WLAN5"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="xxx"
}

root@DietPi3:~#

Hey so I tried changing my 2.4 network to be WPA2-PSK and that worked fine… but I still can’t connect to my 5.0 network on WPA2.
I tried switching my 5.0 network to WPA-PSK and that connected fine, but WPA2 I’m still having issues.

What am I missing? Below are the 2 commands you ran:

root@DietPi:~# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether dc:a6:32:05:1d:4f brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:05:1d:50 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.108/24 brd 192.168.1.255 scope global dynamic wlan0
       valid_lft 43068sec preferred_lft 43068sec
    inet6 fd8d:da28:f427:0:dea6:32ff:fe05:1d50/64 scope global dynamic mngtmpaddr 
       valid_lft forever preferred_lft forever
    inet6 2605:e000:1521:9248:dea6:32ff:fe05:1d50/64 scope global dynamic mngtmpaddr 
       valid_lft 603130sec preferred_lft 603130sec
    inet6 fe80::dea6:32ff:fe05:1d50/64 scope link 
       valid_lft forever preferred_lft forever
root@DietPi:~#



  GNU nano 3.2        /etc/wpa_supplicant/wpa_supplicant.conf                   

# Grant all members of group "netdev" permissions to configure WiFi, e.g. via w$
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
# Allow wpa_cli/wpa_gui to overwrite this config file
update_config=1
network={
        ssid="Wireless 5.0"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="XXXX"
}

network={
        ssid="Wireless 2.4"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="XXXX"
}

So I got my WPA2 to work, I had to add freq_list= to my wpa_supplicant

Here’s the example:

# Grant all members of group "netdev" permissions to configure WiFi, e.g. via wpa_cli or wpa_gui
ctrl_interface=DIR=/run/wpa_supplicant GROUP=netdev
# Allow wpa_cli/wpa_gui to overwrite this config file
update_config=1

freq_list=5170 5180 5190 5200 5210 5220 5230 5240 5260 5280 5300 5320 5500 5520 5540 5560 5580 5600 5620 5640 5660 5680 5700

network={
        ssid="Wireless 5.0"
        scan_ssid=1
        key_mgmt=WPA-PSK
        psk="XXXX"
}

What channel you are running the 5GHz Network? Mine is running on channel 36.

I had issues on other channels for sure, 36 was best

I’m having a new issue on this now, I wanted to flash the beta 64 bit build on my Pi 4. I can’t connect to wifi with just putting my wifi name and password, I’m on WPA2 channel 36 for the 5.0GHz

How do I specify my wifi channel 36 in dietpi-wifi.txt file when setting up wifi for the first time?

ok looks like there is an issue on the 64bit BETA image. Seems wlan0 interface is soft-blocked on first boot. Similar to this one https://github.com/MichaIng/DietPi/issues/3601#issuecomment-643700699

You could implement the workaround, if you have screen and keyboard attached

BTW: you can’t pin a client to a specific channel. This is done one the AP :wink:

just wanted to add that I solved a similar issue by keeping the WIFI antenna right.

it looked like wrong WPA PSK etc. and it was confusong that it was able to search for the SSID / network before…