How to set up internal wifi (rpi 3 B)?

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
annlee
Posts: 10
Joined: Wed Nov 28, 2018 3:19 pm

How to set up internal wifi (rpi 3 B)?

Post by annlee » Fri Nov 30, 2018 8:14 am

hi I did this tutorial viewtopic.php?t=9

but for aWIFI_KEY[0]="MyWifiKey" I introduced my password,

am I supposed to introduce username there too? and how is the structure?

please let me know which files to change to make Wifi work (is already enabled in dietpi-config)

Thanks in advance

User avatar
Fourdee
Site Admin
Posts: 2785
Joined: Tue Feb 06, 2007 12:36 pm

Re: How to set up internal wifi (rpi 3 B)?

Post by Fourdee » Fri Nov 30, 2018 8:53 am

Hi,

If your WiFi router is setup with WPA/2-PSK (most common), you simply need to edit:
aWIFI_SSID[0]="MySSID"
aWIFI_KEY[0]="MyWifiKey"

If the system is already running, you can use the following to setup WiFi connection using scan:
- dietpi-config
- Goto: Networking Options: Adapters > WiFi > Scan
If you find our project or support useful, then we’d really appreciate it if you’d consider contributing to the project however you can.
Donating is the easiest – you can use PayPal and Bitcoin.

annlee
Posts: 10
Joined: Wed Nov 28, 2018 3:19 pm

Re: How to set up internal wifi (rpi 3 B)?

Post by annlee » Fri Nov 30, 2018 9:07 am

yes, I found the SSID, the question is how to fill in this field

Image

is just my wifi password? where goes the user then?

this is an univ so we have login like

Code: Select all

pwo\[email protected]:password 
I guess?

annlee
Posts: 10
Joined: Wed Nov 28, 2018 3:19 pm

Re: How to set up internal wifi (rpi 3 B)?

Post by annlee » Mon Dec 10, 2018 10:15 am

hi there, I tried a dozen of combinations but didnt work since it is a bit more advanced the password (needs user and password)

It works when use my smartphone with tethering giving WIFI thought

so can anyone tell me how is the structure to fill-in user and password?

User avatar
MichaIng
Legend
Posts: 1025
Joined: Sat Nov 18, 2017 5:21 pm

Re: How to set up internal wifi (rpi 3 B)?

Post by MichaIng » Mon Dec 10, 2018 1:57 pm

If user and password is required, you use WPA-EAP authentication. Please open:
nano /var/lib/dietpi/dietpi-wifi.db

There you should see 5 WiFi credential slots. If you already tried to configure your WiFi and scanned for the SSID, it should be already stored in the first slot, otherwise set:
aWIFI_SSID[0]='your_SSID' # I hope you have no single quote ' inside your SSID, otherwise you would need to replace it by '\'', same for user and password below.
aWIFI_KEYMGR[0]='WPA-EAP'

Then there are a bunch of EAP specific settings:
aWIFI_PROTO[0]=''
aWIFI_PAIRWISE[0]=''
aWIFI_AUTH_ALG[0]=''
aWIFI_EAP[0]=''
aWIFI_IDENTITY[0]='your_username'
aWIFI_PASSWORD[0]='you_password'
aWIFI_PHASE1[0]=''
aWIFI_PHASE2[0]=''


Identity and password are your user and password. You should be able to find the required settings from the access point (router?) or other WiFi devices. For explanations, I just found: https://wiki.ubuntuusers.de/WLAN/wpa_su ... .examples/
The settings names are the same, just capitalized and with leading "aWIFI_".
Leave those empty, where you are not sure, check the examples within the link. In many cases there are reasonable defaults, or empty means "any" method is allowed.
Please leave all set values within single quotes and in case of empty values leave the two single quotes in place as well.

After you added the required values, run /DietPi/dietpi/func/dietpi-wifidb 1 to apply changes to wpa_supplicant.
Then run:
ifdown wlan0
ifup wlan0

to reinit your WiFi interface and see if it connects correctly.

Sadly so far we have no GUI to apply WPA-EAP settings. Also it would be great if we could find a way to scan for authentication methods automatically to pre-fill most fields.

Yeah WPA-PSK is much easier, just SSID and key required and you are good to go. WPA-EAP has sooo many different internal and external methods and in many cases (e.g. my university WiFi) many of them need to be set correctly to connect.

annlee
Posts: 10
Joined: Wed Nov 28, 2018 3:19 pm

Re: How to set up internal wifi (rpi 3 B)?

Post by annlee » Mon Dec 10, 2018 2:14 pm

MichaIng wrote:
Mon Dec 10, 2018 1:57 pm
If user and password is required, you use WPA-EAP authentication. Please open:
nano /var/lib/dietpi/dietpi-wifi.db

There you should see 5 WiFi credential slots. If you already tried to configure your WiFi and scanned for the SSID, it should be already stored in the first slot, otherwise set:
aWIFI_SSID[0]='your_SSID' # I hope you have no single quote ' inside your SSID, otherwise you would need to replace it by '\'', same for user and password below.
aWIFI_KEYMGR[0]='WPA-EAP'

Then there are a bunch of EAP specific settings:
aWIFI_PROTO[0]=''
aWIFI_PAIRWISE[0]=''
aWIFI_AUTH_ALG[0]=''
aWIFI_EAP[0]=''
aWIFI_IDENTITY[0]='your_username'
aWIFI_PASSWORD[0]='you_password'
aWIFI_PHASE1[0]=''
aWIFI_PHASE2[0]=''


Identity and password are your user and password. You should be able to find the required settings from the access point (router?) or other WiFi devices. For explanations, I just found: https://wiki.ubuntuusers.de/WLAN/wpa_su ... .examples/
The settings names are the same, just capitalized and with leading "aWIFI_".
Leave those empty, where you are not sure, check the examples within the link. In many cases there are reasonable defaults, or empty means "any" method is allowed.
Please leave all set values within single quotes and in case of empty values leave the two single quotes in place as well.

After you added the required values, run /DietPi/dietpi/func/dietpi-wifidb 1 to apply changes to wpa_supplicant.
Then run:
ifdown wlan0
ifup wlan0

to reinit your WiFi interface and see if it connects correctly.

Sadly so far we have no GUI to apply WPA-EAP settings. Also it would be great if we could find a way to scan for authentication methods automatically to pre-fill most fields.

Yeah WPA-PSK is much easier, just SSID and key required and you are good to go. WPA-EAP has sooo many different internal and external methods and in many cases (e.g. my university WiFi) many of them need to be set correctly to connect.
thanks buddy, pretty complex, I will give it a try then, and get back to you :)

User avatar
MichaIng
Legend
Posts: 1025
Joined: Sat Nov 18, 2017 5:21 pm

Re: How to set up internal wifi (rpi 3 B)?

Post by MichaIng » Mon Dec 10, 2018 2:43 pm

Jep, remember how you configured WiFi for you notebook and/or mobile phone, to connect to your university WiFi, perhaps there was also a certificate required. E.g. on my university it is eduroam, WPA-EAP, aWIFI_EAP[0]='TTLS', I also needed to add an anonymous identity ([email protected]_uni_domain.org) and on some systems a certificate (if not pre-installed on the system defaults). Since our settings file does not yet have a field for anonymous identity, in case, after applying via dietpi-wifidb 1, you need to manually add this to /etc/wpa_supplicant/wpa_supplicant.conf.

Please let us know, if/how it works. I anyway aim to enhance WPA-EAP with GUI and such, but I don't know yet, which values are usually required and how to identify/check which. Note this is pretty new. In the past, via dietpi-config it was not possible to set EAP authentication at all, so this is kinda experimental, due to it's complexity ;).

Also perhaps there is a good package for Debian available that does all the scanning for authentication methods that we can use in the future :?.

gbb
Posts: 7
Joined: Sun Jun 25, 2017 12:46 am

Re: How to set up internal wifi (rpi 3 B)?

Post by gbb » Wed Dec 12, 2018 5:14 pm

I'm having Rpi 3 issues too. I upgraded via the Dietpi upgrade menu and the wifi settings seem to be wiped (I had the default superdooper in the list). Setting via the network settings woks - I had to do manual, scan does not produce results, just goes back to the menu - but the RPi will not connect - thows back the .100 address.

I just tried the /var/lib/dietpi/dietpi-wifi.db and it reports as zero bytes, but, curiously, modified this am.
Attachments
Screen Shot 2018-12-12 at 12.13.19 PM.png

Orao_22
Posts: 4
Joined: Thu Dec 20, 2018 12:41 pm

Re: How to set up internal wifi (rpi 3 B)?

Post by Orao_22 » Sun Dec 30, 2018 9:00 pm

Thanks for the in-depth description of how to set up said wifi network. I've never tried it before, but I did it right now with this thread opened in a tab, and I managed to configurate the network quickly.
I'd have been stuck at the "do not escape any magic characters" stage if not for you guys... Now I'm ready to move on to my next DietPi project!

User avatar
MichaIng
Legend
Posts: 1025
Joined: Sat Nov 18, 2017 5:21 pm

Re: How to set up internal wifi (rpi 3 B)?

Post by MichaIng » Sun Dec 30, 2018 9:28 pm

@Orao_22
Thanks for feedback.

Jep, we needed to do the magic character escaping for SSID and passwords within the script itself.
Which one needs to be escaped and which one not, depends on how the strings are handled and stored and how they need to be saved within wpa_supplicant.conf to be read correctly. To avoid any potential issues with that and making it unnecessary complicated for end users, we now simply do it internally. This as well allows us (or wpa_supplicant devs) to update the methods without the need to update the API/docs for users every time.

Post Reply