DietPi fresh install WiFi issues on Raspberry Pi Zero 2 W

Required Information

  • DietPi version
    G_DIETPI_VERSION_CORE=8
    G_DIETPI_VERSION_SUB=22
    G_DIETPI_VERSION_RC=3
    G_GITBRANCH=master
    G_GITOWNER=MichaIng
  • Distro version
    bookworm
    0
  • Kernel version
    Linux DietPi 6.1.21-v8+ …
  • Architecture
    arm64
  • SBC model
    RPi Zero 2 W (aarch64)
  • Power supply used 5V 3A MacBook, Bosh 5V 1A
  • SD card used SanDisk ultra 32Gb

Steps to reproduce

  1. Followed instructions found here: How to install DietPi - DietPi.com Docs to flash, configure wifi (dietpi.txt, dietpi-wifi.txt)
  2. inserted the SD, plugged the power usb cable

Expected behaviour

  • After some waiting, it should connect to WiFi automatically and I should be able to connect to the Pi via ssh

Actual behaviour

  • The Pi does not seem to connect to WiFi so I can’t proceed with the setup. I checked for new devices in my network, pinged dietpi and I usually get an email as soon as some new device connects to my WiFi.

Extra details

If I plug in an HDMI cable and a keyboard to login I get the message that I should use dietpi-config to setup a connection for wlan0. Shouldn’t that be done through the settings in the dietpi-wifi.txt?
When I login I immediately get an error related to checking ipv4 network connectivity via ping 9.9.9.9.

If I look into the adapter Options I can see
Ethernet Not Found | Off | Disconnected (seems right)
WiFi Available | Off | Disconnected (seems odd?)
Onboard WiFi On

After choosing the menu entry stating WiFi available I am able to configure WiFi settings which do work afterwards but I thought that is not necessary since I’ve put the necessary values in the dietpi-wifi.txt.

What am I missing here?

Best,
Tizzy

Can you share the configuration you changed on both files?

Usually connecting WiFi is working during initial boot. There might be an incorrect configuration.

dietpy.txt

##### Network Options #####
# Enable Ethernet or WiFi adapter: 1=enable | 0=disable
# - If both Ethernet and WiFi are enabled, WiFi will take priority and Ethernet will be disabled.
# - If using WiFi, please edit dietpi-wifi.txt to pre-enter credentials.
AUTO_SETUP_NET_ETHERNET_ENABLED=0
AUTO_SETUP_NET_WIFI_ENABLED=1

dietpi-wifi.txt

# Entry 0
# - WiFi SSID: required, case sensitive
aWIFI_SSID[0]='TSign-Net'
# - WiFi key: If no key/open, leave this blank
aWIFI_KEY[0]='19*****************'
# - 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]=''
#---------------------------------------------------------------

Do you use any special characters on the WiFi password?

Nope. Just dots, letters and numbers.

Maybe dots are causing issues during script execution.

@MichaIng could you check pls

Only single quotes ' would cause issues and would need to be escaped, like

aWIFI_KEY[0]='Micha'\''sPassword'

Anything else should work, especially since we add it as 64-bit hex-encoded string to /etc/wpa_supplicant/wpa_supplicant.conf. Was/is this file actually created on first boot before you manually setup WiFi via dietpi-config?

I guess the allow-hotplug wlan0 line in /etc/network/interfaces is still commented then, right? Should be if the dietpi-config menu shows [Off]. Since your dietpi.txt and dietpi-wifi.txt look complete in this regards, probably the related firstboot setup log contains a hint:

cat /var/tmp/dietpi/logs/dietpi-firstboot.log

I‘m gonna do a fresh install so we can debug it. I’ll get back with the logs.

Well.
I did a fresh install again. Same image (different USB Card Reader, different Power Cable for the Pi) and suprise. It worked.
As it bugged me I did another fresh install with the exactly the same hardware used when it did not work before and suprise. It worked.

I am not sure what went wrong before but I installed the image like about 5 times without any luck - I followed the exact same procedure now and it works. I mean it’s just two files and changing 3 values. Maybe planetary constellation issues?

Would have been happy contributing some edge case but anyways. Thank you guys. :slight_smile:

indeed strange if it is working now. Hard to troubleshoot.