Wifi not work

Hello, I am not able to get the Pi4 to connect via WIFI.

I have fixed the addressing statically in the file /etc/network/interfaces

# WiFi
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.0.62
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.60

And configure file wpa_supplicant.conf (my network is hidden)

root@DietPi:~# 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="WLAN_XXXX"
        scan_ssid=1
        proto=RSN
        key_mgmt=WPA-PSK
        psk="XXXXXXXXX"
}

But not connect.It only connects if I manually execute the command. With raspberry PI OS it connects perfectly following the same steps

wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf

Hi,

usually you would need to activate WiF first on dietpi-config. After a reboot, this as well would be the place to configure your WiFi connection

Hello,

Thanks for the answer, what you say I have already done, and it indicates that the interface is ON but disconnected.

I have tried to leave only the wireless interface activated and to enter the data from dietpi-config but it still does not connect

can you reboot your system and have a look if the interface is started at all

journalctl -u ifup*
root@DietPi:~# journalctl -u ifup*
-- Logs begin at Thu 2019-02-14 11:11:58 CET, end at Sun 2021-04-25 10:38:01 CEST. --
Apr 25 10:35:57 DietPi systemd[1]: Starting Helper to synchronize boot up for ifupdown...
Apr 25 10:35:57 DietPi systemd[1]: Started Helper to synchronize boot up for ifupdown.
Apr 25 10:35:59 DietPi systemd[1]: Starting ifup for wlan0...
Apr 25 10:35:59 DietPi systemd[1]: Starting ifup for eth0...
Apr 25 10:35:59 DietPi sh[359]: /etc/network/if-pre-up.d/wpasupplicant: 120: /etc/network/if-pre-up.d/wpasupplicant: cannot create /dev/stderr: No such device or addres
s
Apr 25 10:35:59 DietPi sh[359]: run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Apr 25 10:35:59 DietPi sh[359]: ifup: failed to bring up wlan0
Apr 25 10:35:59 DietPi systemd[1]: ifup@wlan0.service: Main process exited, code=exited, status=1/FAILURE
Apr 25 10:35:59 DietPi systemd[1]: ifup@wlan0.service: Failed with result 'exit-code'.
Apr 25 10:35:59 DietPi systemd[1]: Failed to start ifup for wlan0.
Apr 25 10:35:59 DietPi sh[360]: eth0=eth0
Apr 25 10:35:59 DietPi ifup[455]: ifup: interface eth0 already configured
Apr 25 10:35:59 DietPi systemd[1]: Started ifup for eth0.

error seems to be with wpasupplicant as it is not able to print some messages.

Apr 25 10:35:59 DietPi sh[359]: /etc/network/if-pre-up.d/wpasupplicant: 120: /etc/network/if-pre-up.d/wpasupplicant: cannot create /dev/stderr: No such device or address

can you have a look ls -l /dev/st*

just for testing, can you do ifup wlan0

MichaIng
can you have a look as well pls

Good,

As I was already bored with the topic, at the end I installed WICD and after configuring this everything works correctly.

Greetings