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
1 Like

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.

I’ve been setting up a new Zero 2 W and was having similar issues. The image (DietPi_RPi-ARMv8-Bookworm) was working fine on my 4B. Tried start it on the 4B, installing upgrades, then move it onto the Zero 2 W but that didn’t help either.

What ended up solving it was:

  1. Flash a fresh DietPi image with AUTO_SETUP_AUTOMATED, AUTO_SETUP_NET_ETHERNET_ENABLED and AUTO_SETUP_NET_WIFI_ENABLED (and configure WiFi in dietpi-wifi.txt)
  2. Attach a Micro USB Ethernet adapter and connect to the router with internet
  3. Start and let the first boot do the dist-upgrade (including firmware-iwlwifi kernel drivers)
  4. Disconnect ethernet cable and reboot

hi all,
same issue here, no connection. I tried to install DietPi_RPi-ARMv8-Bookworm on a pi zero 2w several times, using balena etcher on different pc (windows and linux), different usb card reader, different cables and different power supply. im in italy and i tried to set also “US” in the wifi country mode. tried to use an access point different from Fritzbox. changing the wifi ssid in one using only letter… nothing works!
unfortunately i dont have mini HDMI and eth-to-usb adapter. what can i try?
thanks in advance.
ps: same issue with Raspberry Pi OS.

Well :slight_smile:

hard to trouble shoot without any logs or local access. Bet to use a 2.4Ghz wifi, simple SSID and very simple password for testing. If possible connect the SD card to another Linux box to be able to extract some first setup logs.

i can read the sd from a Linux Mint pc. can this help?

yes, there you could check log files

On the mounted ext4 partition, logs are located at /var/tmp/dietpi/logs

where is this file located?

which file you are looking for?

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