Connect to Wifi network automatically at boot

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
User avatar
Sciamano
Posts: 264
Joined: Sat Oct 15, 2016 12:18 pm
Location: Italy

Connect to Wifi network automatically at boot

Post by Sciamano »

Hello!
First time I have a board with onboard wifi and I was wondering whether there is a quick way to set it to connect to a specific wifi network at boot.
I've set up the network adapter section in dietpi-config, but when I reboot it will not automatically connect to the network (it does after I set it manually in dietpi-config, though).
All this on an OPi Zero, if this helps.
Thanks.
User avatar
Fourdee
Site Admin
Posts: 2782
Joined: Tue Feb 06, 2007 1:36 pm

Re: Connect to Wifi network automatically at boot

Post by Fourdee »

Sciamano wrote:Hello!
First time I have a board with onboard wifi and I was wondering whether there is a quick way to set it to connect to a specific wifi network at boot.
I've set up the network adapter section in dietpi-config, but when I reboot it will not automatically connect to the network (it does after I set it manually in dietpi-config, though).
All this on an OPi Zero, if this helps.
Thanks.
Hi,

Yep known issue with OPi Zero currently. Workaround is here:
WiFi: If you experience issues with the WiFi module not loading during boot, please try this workaround: https://github.com/Fourdee/DietPi/issue ... -266006050
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 or become a DietPi patron.
User avatar
Sciamano
Posts: 264
Joined: Sat Oct 15, 2016 12:18 pm
Location: Italy

Re: Connect to Wifi network automatically at boot

Post by Sciamano »

Fact is I have already applied that workaround...
My problem is not that the board loses the "wifi card" at boot (it does not after using the workaround) but "simply" that it does not autoconnect to my wifi network at boot.

Code: Select all

root@OPiZero:/etc/samba# systemctl status xradio_wlan.service 
● xradio_wlan.service - xradio_wlan
   Loaded: loaded (/etc/systemd/system/xradio_wlan.service; enabled)
   Active: active (exited) since Thu 2017-02-09 14:57:34 CET; 32min ago
 Main PID: 1020 (code=killed, signal=TERM)
   CGroup: /system.slice/xradio_wlan.service

Feb 09 14:57:33 OPiZero bash[1020]: Error for wireless request "Set Encode" (8B2A) :
Feb 09 14:57:33 OPiZero bash[1020]: invalid argument "xxxxx".
Feb 09 14:57:34 OPiZero systemd[1]: Started xradio_wlan.
root@OPiZero:/etc/samba# 
Also, I can't seem to set the country in the wifi settings, it errors out:

Code: Select all

Error: Country Code ├───────────────┐                                                    
│                                                     │                                                    
│ Country code (GB) could not been applied. Please    │                                                    
│ check the country code and try again.   
User avatar
Sciamano
Posts: 264
Joined: Sat Oct 15, 2016 12:18 pm
Location: Italy

Re: Connect to Wifi network automatically at boot

Post by Sciamano »

OK, I think I've solved... but I think there is something wrong in the dietpi setup in a particular situation. Ill try to explain:

- fresh install of DietPi
- selected "Rome" for the Timezone
- set up wifi workaround
- set up wifi config...

Here comes the problems, because it seems that moving the timezone to Rome caused the locale to be set to it-IT_UTF8.UTF8 even though this had never been installed.

I don't know why but this also caused the wifi country not to be settable.
As soon as I installed the IT_UTF8 locale, everything went back to normal (and it also autoconnect to the wifi network now).

An important question: is there a way to have wifi take precedence over ethernet while still keeping ethernet enabled?
I have noticed that in order to make the Zero autoconnect to the wifi at boot the ethernet card has to be disabled, but it would be much better IMO if one could keep it enabled in order to be able to connect to the board via ethernet in case the wifi connection does not work for any reason.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: Connect to Wifi network automatically at boot

Post by johnvick »

You've probably done this - and it may not fix this problem - but after I upgraded to latest kernel my two OP Zero's have had much more stable wifi connections (one runs DietPi the other Armbian).

John
User avatar
Sciamano
Posts: 264
Joined: Sat Oct 15, 2016 12:18 pm
Location: Italy

Re: Connect to Wifi network automatically at boot

Post by Sciamano »

johnvick wrote:You've probably done this - and it may not fix this problem - but after I upgraded to latest kernel my two OP Zero's have had much more stable wifi connections (one runs DietPi the other Armbian).

John
How do you do that? Thanks.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: Connect to Wifi network automatically at boot

Post by johnvick »

It was just apt-get update apt-get upgrade
User avatar
Sciamano
Posts: 264
Joined: Sat Oct 15, 2016 12:18 pm
Location: Italy

Re: Connect to Wifi network automatically at boot

Post by Sciamano »

Oh, OK... I guess I have already done that, then :)
User avatar
Sciamano
Posts: 264
Joined: Sat Oct 15, 2016 12:18 pm
Location: Italy

Re: Connect to Wifi network automatically at boot

Post by Sciamano »

This question is still unanswered:
is there a way to have wifi take precedence over ethernet while still keeping ethernet enabled?
I have noticed that in order to make the Zero autoconnect to the wifi at boot the ethernet card has to be disabled, but it would be much better IMO if one could keep it enabled in order to be able to connect to the board via ethernet in case the wifi connection does not work for any reason.
I think this is an important issue. ;)
Post Reply