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!

  • What OS? If you are using Raspbian just select your network from the GUI. See [How to set up networking/WiFi](http://raspberrypi.stackexchange.com/a/37921/8697) – Milliways Oct 30 '18 at 09:00
  • I am using Raspbian, but my Pi doesn't recognise any networks in the GUI. I have just plugged in the Wi-Fi adapter and booted it up once with it in - I still need to configure it to the desired Wifi network – Pedro Hablespanyos Oct 30 '18 at 09:03
  • Another thing to note - my nano is v2.7.4 – Pedro Hablespanyos Oct 30 '18 at 09:06
  • Please add details of your dongle to the question, including the output of `lsusb` and `ifconfig`. And what protocol does your AP use? Is the SSID of the AP hidden? – Dirk Oct 30 '18 at 10:04
  • From the listings you give us there is no problem with your usb wifi dongle. Raspbian sees it as normal wifi interface **wlan0** so you should be able to use it. Additional you can verify if it works with `sudo iw list`, `sudo iw dev` and `sudo iw dev wlan0 scan`. Just with the last command you should see all the wifi networks from your neighbors. If so then it is only a configuration issue. Follow the instructions *Milliways* gives in his first comment. – Ingo Oct 30 '18 at 19:30

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.

  • A bit premature as an answer. The first question should be: is the dongle recognised and supported. If not, you can change all you want to any configuration file, but it will not make a difference. OP says the Pi recognises it, but I have not seen any proof yet. – Dirk Oct 30 '18 at 10:00
  • The dongle I have gotten is compatible - Edimax N150. – Pedro Hablespanyos Oct 30 '18 at 10:24
  • Also, I have added in changes to /etc/wpa_supplicant/wpa_supplicant.conf alone as stated in this tutorial - https://raspberrypi.stackexchange.com/questions/39785/dhcpcd-vs-etc-network-interfaces - where else should I edit and what exactly should I do? Where in the /etc/dhcpcd.conf file should I make edits, and what should those edits look like? I really appreciate the help! – Pedro Hablespanyos Oct 30 '18 at 10:26
  • as @Dirk mentioned, the output of `lsusb`, `ifconfig` would be useful to help you. Also, do you need DHCP or static IP for your wireless configuration? You can add these details to your question. – gustavovelascoh Oct 30 '18 at 10:29
  • I just need a static IP. – Pedro Hablespanyos Oct 30 '18 at 10:30
  • Output for lsusb - – Pedro Hablespanyos Oct 30 '18 at 10:31
  • 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 – Pedro Hablespanyos Oct 30 '18 at 10:35
  • ifconfig wlan0: flags=4099 mtu 1500 ether 74:da:38:ed:45:e9 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) – Pedro Hablespanyos Oct 30 '18 at 10:39
  • 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 – Pedro Hablespanyos Oct 30 '18 at 10:39
  • Please put this additional information in your question. – gustavovelascoh Oct 30 '18 at 10:39
  • I have done those changes, but what edits need to be made to /etc/dhcpcd.conf ? – Pedro Hablespanyos Oct 30 '18 at 10:55
  • @PedroHablespanyos So instead of connection problems it's actually about getting a static address? Anyway, see the first comment on your question by Milliways. It should give you all the information you need. – Dirk Oct 30 '18 at 11:47
  • I realised I do not need static IP necessarily - rather just basic internet connection. I have made the above changes to /etc/wpa_supplicant/wpa_supplicant.conf and it is not working. I have also looked at some more tutorials which say I can use the WiFi Config application to try connect it, however I do not have this app. When I try to get it using sudo apt install wpagui I get messages along the line of E: Failed to fetch (some raspbian website). I have tried to connect it in all these ways, including the top GUI, which still displays 'no wifi interfaces found'. – Pedro Hablespanyos Oct 31 '18 at 10:51
  • I am also really sorry for the lack of information - really my aim after all this is to be able to control my Pi remotely, and I am not too sure what exactly I need. I assume WiFi is required, but I just need a basic connection. – Pedro Hablespanyos Oct 31 '18 at 10:53