User avatar
riverpi
Posts: 3
Joined: Fri Jul 20, 2012 4:23 pm
Location: Milwaukee, WI USA
Contact: Website

Connect to wifi on startup

Fri Jun 06, 2014 9:37 pm

I am starting work on a project with my raspberry pi, and decided that a basic command line only interface -- such as that provided but arch by default -- would be perfect for my needs. I have an edimax USB Wifi dongle attached, and have it running just fine, but am having an issue getting it to automatically connect to my wifi.

I have been using the
wifi-menu -o
command to log in to my wifi, and have managed to figure out how to have sshd start up with the pi, but not the wifi connection. Any ideas or suggestions?
/***
* RiverPi
*/

pepedog
Posts: 1043
Joined: Fri Oct 07, 2011 9:55 am

Re: Connect to wifi on startup

Sat Jun 07, 2014 10:34 am

First let me tell how wired interface is started

Code: Select all

systemctl enable netctl-ifplugd@eth0
What this means is it looks thru all files in /etc/netctl/ and if these lines match, and network starts, it stops looking at other files
Interface=eth0
Connection=ethernet
You are probably going to disable this service
It is coincidence that the file in /etc/netctl is called eth0

Now you used wifi-menu to connect, and it created a profile.
The equivalent to above for wifi is

Code: Select all

systemctl enable netctl-auto@wlan0
https://wiki.archlinux.org/index.php/Ne ... f_profiles

User avatar
riverpi
Posts: 3
Joined: Fri Jul 20, 2012 4:23 pm
Location: Milwaukee, WI USA
Contact: Website

Re: Connect to wifi on startup

Tue Jun 10, 2014 5:15 pm

I tried that it did not seem to work for me. I even wend so far as to write my own service for a script that runs

Code: Select all

netctl start Homebase

(my wifi-menu profile is called Homebase)

The script ran after I reboot but did not seem to work (initially throwing a '[failed]'). Though when I ran it with the sh command to test my work it worked fine, so I corrected the '.service' file to reflect the 'sh' command. I didn't get a failed this time, but it still did not start automatically and I had to login on the pi itself to connect to the web so I could remote in through putty.
/***
* RiverPi
*/

sdjf
Posts: 1395
Joined: Fri Mar 16, 2012 5:20 am
Location: California
Contact: Website

Re: Connect to wifi on startup

Wed Jun 11, 2014 3:02 pm

when your wifi is up and running, run ifconfig to see what the interface is called at that point. that has to match what you have in the profile.

ifconfig
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B

User avatar
riverpi
Posts: 3
Joined: Fri Jul 20, 2012 4:23 pm
Location: Milwaukee, WI USA
Contact: Website

Re: Connect to wifi on startup

Wed Jun 11, 2014 3:29 pm

Well apparently I overthought your reply, when I copied and pasted your original command into putty (since it called it wlan0), it worked like a charm.

Thanks.
/***
* RiverPi
*/

Return to “Arch”