0

Yesterday, I decided to finally set up my Raspberry Pi which had just been sitting in a drawer waiting to be used.

Even though I didn't have a working screen for it, I was able to use mobaXterm to install a VNC on it, and use VNC Viewer in conjunction with my laptop and an Ethernet cable.

When I tried setting up the Wi-Fi, I ran into issues, in that, even though my Router would be detected, it would not issue a "proper" IP address.

ifconfig

After looking for a while today, I found numerous threads on various forums, saying that if the Router security is WEP, then it may not work. I set up my phone temporarily to create a WPA2 hotspot, and my Pi connected perfectly. However, that is not ideal for me naturally.

My questions are as follows:

Why would the adapter connect to my router perfectly when used on other devices, but not when used for my Pi?

Is there any solution which would let me connect my Pi to WEP (since for various reasons I cannot change the security of the router at this time?

Is there a different solution to my issue which does not involve changing my router security?

Frog6666
  • 31
  • 1
  • 4

3 Answers3

1

Warning The changes to /etc/network/interfaces file will prevent dhcpcd running. Wireless settings should be made by editing /etc/wpa_supplicant/wpa_supplicant.conf. Also init.d commands are obsolete in Raspbian Jessie.

WEP is unsecure and very hackeable, not going to judge, but if you need to set it up I'll try to help a little.

Take in mind that these comands should be used with as root permisión, or with sudo.

First check if your wifi doondle is started:

$ sudo iwconfig 

> lo        no wireless extensions. eth1      no wireless extensions.
> wlan0     IEEE 802.11bg  ESSID:"testessid"  
>           Mode:Managed  Frequency:2.462 GHz  Access Point: 00:2A:3B:24:1A:ED   
>           Bit Rate=1 Mb/s   Tx-Power=23 dBm   
>           Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
>           Power Management:off
>           Link Quality=67/100  Signal level:-61 dBm  
>           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
>           Tx excessive retries:0  Invalid misc:0   Missed beacon:

If an info similiar to this appear is that your wifi adaptor is detected, but not configured.

We are going to set up you encripted WIFI. Let’s suppose your ESSID is testessid and your password is safestpasswordever

$ sudo iwconfig wlan0 essid testessid key s:safestpasswordever 

In this command, we tell wlan0 the name of our essid, and our password in plain text. If you want to use your WEP password (ASCII string) instead of the true WEP hex key, then you must use the s: prefix. After a seconds, you may check that your interface has been associated to the Access point:

$ sudo iwconfig

> lo        no wireless extensions. eth1      no wireless extensions.
> wlan0     IEEE 802.11bg  ESSID:" testessid "  
>           Mode:Managed  Frequency:2.462 GHz  Access Point: 00:2A:3B:24:1A:ED   
>           Bit Rate=1 Mb/s   Tx-Power=23 dBm   
>           Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
>           Power Management:off
>           Link Quality=67/100  Signal level:-61 dBm  
>           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
>           Tx excessive retries:0  Invalid misc:0   Missed beacon:0

We have Access to it, but it is still not configured. We wake up the interface with ifconfig, and after that we ask for an IP from the DHCP client

$ sudo ifconfig wlan0 up
$ sudo dhclient3 wlan0

> There is already a pid file /var/run/dhclient.pid with pid 11426
> killed old client process, removed PID file Internet Systems
> Consortium DHCP Client V3.1.1 Copyright 2004-2008 Internet Systems
> Consortium. All rights reserved. For info, please visit
> http://www.isc.org/sw/dhcp/
> 
> Listening on LPF/wlan0/10:90:6a:37:ae:cc Sending on  
> LPF/wlan0/10:90:6a:37:ae:cc Sending on   Socket/fallback DHCPREQUEST
> of 192.168.4.4 on wlan0 to 255.255.255.255 port 67 DHCPACK of
> 192.168.4.4 from 192.168.4.1 bound to 192.168.4.4 -- renewal in 104602 seconds.

OK from now. Let’s imagine you want to start your wifi from the start. You need to modify your /etc/network/interfaces file.

First, we need to get rid of your ascii password and use it in HEX mode. You can covert any text to hexadecimal from console with:

$printf “yourpassword”|od –t x1

> 0000000 79 6f 75 72 20 70 61 73 73 77 6f 72 64 
> 0000015

Your password in HEX should be 79 6f 75 72 20 70 61 73 73 77 6f 72 64

Select the editor more convenient to you (vi, nano, emacs..) and edit the file /etc/network/interfaces

You should focus on the lines where wlan0 appear, you need to add this information with your personal essid and hex password

$ sudo vi /etc/network/interfaces

[...] 
auto wlan0 
iface wlan0 inet dhcp
    wireless-essid testessid
    wireless-key 9 6f 75 72 20 70 61 73 73 77 6f 72 64

Now it should be ready if you restart your raspi, or just if you restart the network service

$ sudo /etc/init.d/networking stop

>  * Deconfiguring network interfaces...                                
> [ OK ]

$ sudo /etc/init.d/networking start

>  * Configuring network interfaces... Internet Systems Consortium DHCP
> Client V3.1.1 Copyright 2004-2008 Internet Systems Consortium. All
> rights reserved. For info, please visit http://www.isc.org/sw/dhcp/
> 
> Listening on LPF/wlan0/10:90:6a:37:ae:cc Sending on  
> LPF/wlan0/10:90:6a:37:ae:cc Sending on   Socket/fallback DHCPDISCOVER
> on wlan0 to 255.255.255.255 port 67 interval 7 DHCPOFFER of
> 192.168.4.4 from 192.168.4.1 DHCPREQUEST of 192.168.4.4 on wlan0 to 255.255.255.255 port 67 DHCPACK of 192.168.4.4 from 192.168.4.1 bound to 192.168.4.4 -- renewal in 126729 seconds.

And it should be done...

Milliways
  • 59,890
  • 31
  • 101
  • 209
Jesus Cepeda
  • 399
  • 1
  • 9
0

You should be able to get it to work by manually editing /etc/wpa_supplicant/wpa_supplicant.conf. Reading man wpa_supplicant.conf will show the options available.

I can't explicitly answer as I haven't used WEP, but know it is mentioned in the documentation.

Milliways
  • 59,890
  • 31
  • 101
  • 209
  • Thank you. I'll check it out later. (As a side note, your avatar is calming. It's helped me before.) – Frog6666 Mar 29 '16 at 23:38
0

Update: I got Wi-Fi set up with WEP.

This thread helped me.

I saw something like this earlier, but when I did it, I never rebooted.

Frog6666
  • 31
  • 1
  • 4
  • You should include the exact settings you used (not actual password) for the benefit of future readers. – Milliways Mar 30 '16 at 23:17