0

I am trying to connect my Raspberry pi 1 model b to the internet using an Edimax adapter. My pi recognises the adapter, but when I try to configure my pi to connect to my WIFI by using

sudo nano /etc/network/interfaces

My screen comes up with:

# Please note that this file is written to be used with dhcpcd.
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'.

and some other comments. When I use the command:

sudo nano /etc/dhcpcd.conf

The following appears:

# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS. 
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per 
RFC4361.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
# Some interface drivers reset when changing the MTU so disabled by 
default.
#option interface_mtu

lsusb comes up with:

Bus 001 Device 008: ID 046:c31c Logitech, Inc. Keyboard K120 
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS] 
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter 
Bus 001 Device 002: ID 0424:9524 Standard Microsystems Corp. SMC9514 Hub 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

ifconfig comes up with (For the wlan0 section):

wlan0: flags=4099<UP, BROADCAST MULTICAST> mtu 1500 
ether 74:da:38:ed:45:e9 txqueuelen 1000 (Ethernet) 
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 12 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) 
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 

I really am not sure what to do from here. I do apologise if this is an obvious problem, but I am new to Raspberry Pi, so if you could explain to me in a simple way how to configure the Wifi network I would really appreciate it.

Thanks!

1 Answers1

2

I think this has nothing to do with your nano, but you have to modify other files. I will take a part of an answer from this post. As is stated, there was some confusion when updating from Wheezy to Jessie, regarding interfaces and dhcpcd.conf files for configuring networks.

When to use which file?

I'm going to make the assumption that you are suffering from a general degree of confusion that is occurring at the moment (in the wider Raspberry Pi community) with the introduction of Debian 'Jessie' in place of Debian 'Wheezy'. This change has made a large number of tutorials at worst obsolete and at best confusing.

The answer to the question is that when using Wheezy it was normal to make changes to the /etc/network/interfaces file for the purposes of setting up network interfaces (go figure). When using Jessie, it will be necessary to make changes to '/etc/dhcpcd.conf'. However, if making changes to a wireless connection (wlan0) you will also need to make changes to /etc/wpa_supplicant/wpa_supplicant.conf which is where you add the network ssid and password.


  • Add to dhcpcd.conf file:

interface wlan0 static ip_address=192.168.0.10/24 # Your static IP configuration static routers=192.168.0.1 # Your default gateway static domain_name_servers=192.168.0.1 8.8.8.8 # DNS servers

  • Edit the file /etc/wpa_supplicant/wpa_supplicant.conf adding this to the bottom:

network={ ssid="YOUR_SSID" psk="YOUR_PASSWORD" }

  • Reconfigure the interface using wpa_cli -i wlan0 reconfigure or reboot

This post will give you a deeper explanation if you need it.