User avatar
snowred
Posts: 4
Joined: Wed Oct 17, 2012 8:00 pm

how to start wireless adapter on boot

Wed Oct 17, 2012 9:29 pm

I bought a mini wifi adapter (http://www.lefen.com/index.php/Product/views/id/321) from eBay for around $7. I connected it to my RPI and then restarted my RPI. No error message was given but I could not connect to my home wifi. Then I started X and used the GUI wifi manager where I was able to connect RPI to my home wifi by entering password and then clicking the "connect" button.

However the next time when I started RPI there was still no wifi connected and I have to again use the GUI wifi manager to click "connect". Here I'm wondering if there's a way to let my RPI wifi work on boot automatically? Thank you.

User avatar
jecxjo
Posts: 158
Joined: Sat May 19, 2012 5:22 pm
Location: Minneapolis, MN (USA)

Re: how to start wireless adapter on boot

Wed Oct 17, 2012 9:33 pm

Which distro are you running?
xmpp: [email protected]
Blog: http://jecxjo.motd.org/code

User avatar
snowred
Posts: 4
Joined: Wed Oct 17, 2012 8:00 pm

Re: how to start wireless adapter on boot

Wed Oct 17, 2012 9:52 pm

I'm using Raspbian “wheezy”.

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: how to start wireless adapter on boot

Sun Oct 21, 2012 4:58 am

snowred wrote: ... Here I'm wondering if there's a way to let my RPI wifi work on boot automatically? Thank you.
Absolutely!

Take a look at this article for installation and configuration steps. Since it's already working for you via the GUI, it sounds like you can probably just skip down to the configuration section. This article is about a different brand adapter, but the configuration steps would be identical no matter what make/model.
http://www.savagehomeautomation.com/pro ... dapte.html

Good Luck
-Robert
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: how to start wireless adapter on boot

Sun Oct 21, 2012 5:08 am

What is in:

sudo nano /etc/network/interfaces

can you post it I think you don't have auto wlan0 in it possibly can you just try that and see if it works?
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: how to start wireless adapter on boot

Sun Oct 21, 2012 5:10 am

User: malakai suggested that all he had to do after configuring via the GUI was to add the "auto wlan0" configuration parameter to the "/etc/network/interfaces" file to get it to auto connect.

See this post: http://www.raspberrypi.org/phpBB3/viewt ... 61#p198761

I have not used the GUI, so I can't confirm ... but it makes sense.

-Robert
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

User avatar
savageautomate
Posts: 225
Joined: Thu Aug 16, 2012 3:20 pm
Location: USA
Contact: Website

Re: how to start wireless adapter on boot

Sun Oct 21, 2012 5:11 am

malakai wrote:What is in:
sudo nano /etc/network/interfaces
can you post it I think you don't have auto wlan0 in it possibly can you just try that and see if it works?
You beat me to the submit :ugeek:
Robert Savage | Follow me @savageautomate
http://www.pi4j.com | http://www.pislices.com
http://www.savagehomeautomation.com

User avatar
malakai
Posts: 1382
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: how to start wireless adapter on boot

Sun Oct 21, 2012 5:29 am

I was also thinking about this setting in /etc/network/interfaces

iface wlan0 inet manual

You would think iface should be dhcp. When I tried this it gave an error "iface must be set to manual".

I wonder if you set dhcp on your wireless at home but use static at the office setting iface to dhcp or static would interfere so manual makes sense. Just a guess though.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
snowred
Posts: 4
Joined: Wed Oct 17, 2012 8:00 pm

Re: how to start wireless adapter on boot

Tue Oct 23, 2012 6:08 pm

Thank you savageautomate and everyone. The information is helpful.

what was in my /etc/network/interfaces was

iface wlan0 inet manual

no matter if I add either or both of the following

auto wlan0
iface wlan0 inet dhcp

it doesn't help. Let me deep into the links to see what else I need to modify.


ryanthelion
Posts: 1
Joined: Thu Nov 20, 2014 7:08 pm

Re: how to start wireless adapter on boot

Thu Nov 20, 2014 7:13 pm

@yourlegitman
This worked for me. Simple and easy...
http://www.linux-magazine.com/Online/Bl ... gorie%29/0
This works wonders, but I don't like that the PSK is exposed there.

I have everything set up, from this forum, http://www.savagehomeautomation.com/pro ... dapte.html

but it doesn't go into having the adapter auto connect on boot. any assistance on this when using this 2nd method?

EDIT: I got it working so I wanted to share here for completeness.

My wifi section of my /etc/network/interfaces file

Code: Select all

 auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf

iface home inet static
address 192.168.1.100
netmask 255.255.255.0
gateway 192.168.1.254
Then, in the wpa_supplicant file, I added the

Code: Select all

id_str="home"
to reference the "iface home inet static" settings i set in the /etc/network/interfaces file.

Below is the wpa_supplicant details:

Code: Select all

network={
ssid="_SSID_"
proto=RSN
key_mgmt=WPA-PSK
pairwise=CCMP TKIP
group=CCMP TKIP
psk="_WPA_SHARED_KEY_"
id_str="home"
}
I was still having issues with it setting on boot, so I chmod 600 /etc/network/interfaces in case there might be a r/w issue, and that seemed to do the trick.

cheers

Return to “General discussion”