need help configuring wifi after first boot

Have some feedback, questions, suggestions, or just fancy a chat? Pop it in here.
Post Reply
onebigear
Posts: 3
Joined: Wed Apr 17, 2019 9:37 pm

need help configuring wifi after first boot

Post by onebigear »

hello everyone, this is my first time configuring DietPi, I have a question for how to configure wifi after first boot. Initially, I looked at this post "Setting up WiFi over SSH, without using DietPi-config" post for advice, but after some steps I didn't follow through.
viewtopic.php?f=9&t=340

Code: Select all

/etc/network/interfaces

Code: Select all

# Wifi
auto wlan0
iface wlan0 inet dhcp
address 192.168.0.100
netmask 255.255.255.0
gateway 192.168.0.1
wireless-essid MyWiFiRouter
wireless-key MyWiFiKey
wireless-mode Managed
wireless-power off
wpa-ssid MyWiFiRouter
wpa-psk MyWiFiKey
#dns-nameservers 8.8.8.8 8.8.4.4
but the results I get after doing

Code: Select all

ifup wlan0
was

Code: Select all

wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
ifup: failed to bring up wlan0
I wonder how could I proceed?

I am using RPi 3B+ and DietPi v6.19.7

thank you!
onebigear
Posts: 3
Joined: Wed Apr 17, 2019 9:37 pm

Re: need help configuring wifi after first boot

Post by onebigear »

I tried to edit the /sbin/wpa_supplicant file, but it's unreadable (attached screenshot)
Attachments
屏幕快照 2019-04-17 下午10.17.58.png
onebigear
Posts: 3
Joined: Wed Apr 17, 2019 9:37 pm

Re: need help configuring wifi after first boot

Post by onebigear »

and I also tried to find the dietpi-wifi.txt file under /boot, entered router and password I do, and rebooted, still getting same error.
User avatar
MichaIng
Site Admin
Posts: 2295
Joined: Sat Nov 18, 2017 6:21 pm

Re: need help configuring wifi after first boot

Post by MichaIng »

@onebigear
Why do you want to not use dietpi-config? This is the easiest and failsafe method to configure WiFi after first boot.
/boot/dietpi-wifi.txt is only used ON first boot, so is only applied if you want/need to configure WiFi before booting up the first time, e.g. WiFi-only devices and such. It does not have any effect afterwards.

The way you configured /etc/network/interfaces contains some mixed wpa_supplicant + non-wpa_supplicant statements, which makes it fail most likely. DietPi-Config will separate connection and authentication settings, so all wpa_supplicant related (SSID, key, etc) is moved into a separate wpa_supplicant.conf. That keeps things cleaner and avoids incompatible syntax.

So in short, use dietpi-config, disable Ethernet, enable WiFi and configure it according to your needs :).



/sbin/wpa_supplicant is a binary file, no text file, which is why you see the cryptic binary chars ;). The binary is not the issue, but as mentioned above the settings you applied to it via /etc/network/interfaces.
Janice M. Burns
Posts: 1
Joined: Wed May 08, 2019 10:30 am

Re: need help configuring wifi after first boot

Post by Janice M. Burns »

You should use diet-config, disable Ethernet, enable WiFi and configure it as per your needs. It is the best way to configure WiFi after first boot.
/boot/dietpi-wifi.txt will be used in the first boot; it may be applied only when it is required to configure WiFi before booting up the first time. WiFi-only devices don’t have any effect afterward.
You may as configured /etc/network/interfaces contain mixed wpa_supplicant+non-wpa_supplicant statements, which makes it fail most likely. dietpi-config, it separate connection and authentication settings, then all wpa_supplicant, that related is moved into a separate wpa_supplicant.conf.That keeps things cleaner and avoids incompatible syntax.

ADMIN EDIT: Removed embedded spam link. If this required a second time, this account will be removed!
Post Reply