# Pre-configured WiFi Details failed (Rpi Zero w, DietPi v6.28.0)

**URL:** https://dietpi.com/forum/t/pre-configured-wifi-details-failed-rpi-zero-w-dietpi-v6-28-0/3868
**Category:** Troubleshooting
**Created:** [21 February 2020 14:38 UTC](https://dietpi.com/forum/t/pre-configured-wifi-details-failed-rpi-zero-w-dietpi-v6-28-0/3868 "2020-02-21T14:38:46Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Dillinger](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/d/ac91a4/32.png) [@Dillinger](https://dietpi.com/forum/u/Dillinger)
#### Post date: [21 February 2020 14:38 UTC](https://dietpi.com/forum/t/pre-configured-wifi-details-failed-rpi-zero-w-dietpi-v6-28-0/3868/1 "2020-02-21T14:38:46Z")

</div>

First of all: Many thanks to all members, great work !  
This problem is reproducible (for me):  
Doing exactly the steps from “Getting started” (with the goal not to plug in keyboard / monitor and only to ssh into)

change dietpi.txt (WIFI only):  
AUTO\_SETUP\_NET\_ETHERNET\_ENABLED=0  
AUTO\_SETUP\_NET\_WIFI\_ENABLED=1

Open dietpi-wifi.txt on a WIN10 PC with wordpad (but in another try with notepad):  
Change aWIFI\_SSID[0]=‘MySSID’ and aWIFI\_KEY[0]=‘MyWifiKey’  
of course with my own SSID / Key 😉  
and so on …  
Finaly I’ve plugged in SD card, to have a nice time while dietpi and Rpi0 were both working very hard.  
But after a while there was no ping (and putty can’t login) and router doesn’t show anything new.

Not amused I search another keyboard and another monitor and take a look at console.  
ok. I found in dietpi-wifi.db:  
SSID as well as the WLAN Key both were corrupted by an ending carriage return.  
I reset SSID and WLAN key with dietpi-config manually and finally Rpi0 was connected to my WLAN.

Doing some research on dietpi/func/dietpi-wifidb and shrinking the bash script to seven lines for testing:  
#!/bin/bash  
i=0  
aWIFI\_SSID[$i]=’’  
. ./oo  
cat \<\< _EOF_ | od -bc  
aWIFI\_SSID[$i]=’${aWIFI\_SSID[$i]//’/’\’’}’  
_EOF_

run this with an also shrinked dietpi-wifi.txt named oo  
(simulating partially bash script dietpi-wifidb on it’s first run):

./oo.sh  
0000000 141 127 111 106 111 137 123 123 111 104 133 060 135 075 047 166  
a W I F I \_ S S I D [0] = ’ v  
0000020 145 162 171 123 145 143 162 145 164 120 141 163 163 167 157 162  
e r y S e c r e t P a s s w o r  
0000040 144 015 047 012  
d \r ’ \n  
0000044  
( od -bc oo shows no \r inside the plain text of oo )

Same with aWIFI\_KEY[].

Hey DietPi, I’ve a verySecretPassword but there is no carriage return at the end at all 😉  
So a workaround for me could be to kill first all carriage returns from my dietpi-wifi.txt before  
transfering my new sd card to the Rpi0 and before taking a cup of coffee.  
But perhaps it’s a bug in dietpi/func/dietpi-wifidb in the bash pattern substitution construction (above).

Did I already mentioned: many thanks to all in the team, great work !

---

<div class="post-metadata">

### Author: ![Joulinar](https://dietpi.com/forum/user_avatar/dietpi.com/joulinar/32/57_2.png) [@Joulinar](https://dietpi.com/forum/u/Joulinar)
#### Post date: [24 February 2020 23:08 UTC](https://dietpi.com/forum/t/pre-configured-wifi-details-failed-rpi-zero-w-dietpi-v6-28-0/3868/2 "2020-02-24T23:08:26Z")

</div>

Hi,

that sounds strange. Today I was testing the initial WiFi setup on my RPi3B+ without issues. I just flashed a new image, enabled WiFi on dietpi.txt + adding my WiFI credentials in dietpi-wifi.txt and all was working out of the box.

---

<div class="post-metadata">

### Author: ![voorhetgemak](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/v/bbce88/32.png) [@voorhetgemak](https://dietpi.com/forum/u/voorhetgemak)
#### Post date: [6 March 2020 12:18 UTC](https://dietpi.com/forum/t/pre-configured-wifi-details-failed-rpi-zero-w-dietpi-v6-28-0/3868/3 "2020-03-06T12:18:45Z")

</div>

On my RPi Zero W the pre-configured Wifi refuses to connect.

So I put the SD card in my RPi4, waited for the install to start and then put the SD card back in the Zero. That’s the only way I get the Wifi to connect.
