HolyGuacamole
Posts: 15
Joined: Sat Dec 20, 2014 10:22 am

Setting up a wifi network on the pi 3 without the GUI

Sun May 08, 2016 9:21 am

Hello forum,

I am trying to tether the internet from the ethernet port to a new wifi network.
The device is a raspberry pi 3 b, which has an onboard wifi module.
I am accessing the pi using SSH. This means that using the GUI (graphical user interface) is not that easy.

I want to use the CLI (command line interface) version for managing (and tethering) the connections of the pi instead of the GUI.
- what is it called?
- where can I find it?
- how does it work?

Thanks in advance.

B.Goode
Posts: 6544
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Setting up a wifi network on the pi 3 without the GUI

Sun May 08, 2016 9:36 am

The Raspberry Pi Foundation documentation probably precedes the RPi3, but it looks as though it is still applicable:
https://www.raspberrypi.org/documentati ... ess-cli.md

(Disclaimer: reference to documentation only - I don't have an RPi3 to check with.)

HolyGuacamole
Posts: 15
Joined: Sat Dec 20, 2014 10:22 am

Re: Setting up a wifi network on the pi 3 without the GUI

Sun May 08, 2016 10:14 am

B.Goode wrote:The Raspberry Pi Foundation documentation probably precedes the RPi3, but it looks as though it is still applicable:
https://www.raspberrypi.org/documentati ... ess-cli.md
the title of the page is
Setting WiFi up via the command line
but it appears to be about connecting to an existing wifi network.
What I want to do is create a new wifi network using the raspberry pi as the wireless access point.
So I can connect to the wifi network with another device.

MrEngman
Posts: 3735
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Setting up a wifi network on the pi 3 without the GUI

Sun May 08, 2016 11:08 am

Take a look here viewtopic.php?p=948118#p948118. This describes how I set up a basic Access Point which works on a variety of different Pi. I have tried a Pi 3B, 2B, B+ and Pi 1 with 512MB ram and it works on all four.

I basically talks about using a TP-Link TL-WN725N wifi adapter but if you go to the end of the post, last paragraph or two, you will see I have also tested it with a Pi 3B using the built in Broadcom wifi.



MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

B.Goode
Posts: 6544
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Setting up a wifi network on the pi 3 without the GUI

Sun May 08, 2016 11:16 am

HolyGuacamole wrote: What I want to do is create a new wifi network using the raspberry pi as the wireless access point.
So I can connect to the wifi network with another device.
I misunderstood the point of your query, and as a result my reply was irrelevant. My apologies.

HolyGuacamole
Posts: 15
Joined: Sat Dec 20, 2014 10:22 am

Re: Setting up a wifi network on the pi 3 without the GUI

Sun May 08, 2016 1:54 pm

B.Goode wrote: I misunderstood the point of your query, and as a result my reply was irrelevant. My apologies.
Thanks anyway! :D
Any attempt at helping is always welcome.

HolyGuacamole
Posts: 15
Joined: Sat Dec 20, 2014 10:22 am

Re: Setting up a wifi network on the pi 3 without the GUI

Sun May 08, 2016 2:47 pm

MrEngman wrote:Take a look here viewtopic.php?p=948118#p948118. This describes how I set up a basic Access Point which works on a variety of different Pi. I have tried a Pi 3B, 2B, B+ and Pi 1 with 512MB ram and it works on all four.

I basically talks about using a TP-Link TL-WN725N wifi adapter but if you go to the end of the post, last paragraph or two, you will see I have also tested it with a Pi 3B using the built in Broadcom wifi.



MrEngman
I don't understand it.
Why are all those steps necessary?

MrEngman
Posts: 3735
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Setting up a wifi network on the pi 3 without the GUI

Sun May 08, 2016 3:07 pm

HolyGuacamole wrote:
MrEngman wrote:Take a look here viewtopic.php?p=948118#p948118. This describes how I set up a basic Access Point which works on a variety of different Pi. I have tried a Pi 3B, 2B, B+ and Pi 1 with 512MB ram and it works on all four.

I basically talks about using a TP-Link TL-WN725N wifi adapter but if you go to the end of the post, last paragraph or two, you will see I have also tested it with a Pi 3B using the built in Broadcom wifi.



MrEngman
I don't understand it.
Why are all those steps necessary?
To get it to work, what else.

However, if you are using the Pi 3 B built in Broadcom wifi then you can ignore loading the driver for the TL-WN725N.



MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

HolyGuacamole
Posts: 15
Joined: Sat Dec 20, 2014 10:22 am

Re: Setting up a wifi network on the pi 3 without the GUI

Tue May 10, 2016 8:36 pm

Got anything simpler?

MrEngman
Posts: 3735
Joined: Fri Feb 03, 2012 2:17 pm
Location: Southampton, UK

Re: Setting up a wifi network on the pi 3 without the GUI

Tue May 10, 2016 9:02 pm

OK, striped out the bits you don't need.

So, first I formatted the SD card with SDFormatter v4.0 on my Windows 7 laptop, using full overwrite and Format Size Adjustment ON. I then copied the image, 2016-03-18-raspbian-jessie-lite, to the SD card using Win32DiskImager 0.9.5.

I inserted the card into the Pi, connected the Pi to my network using an ethernet cable and powered on the Pi. I connected to the Pi from my laptop using SSH and started to set it up. First ran

Code: Select all

sudo raspi-config
and expanded the file system, set timezone, hostname and boot to desktop. Then rebooted.

After booting ran

Code: Select all

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install rpi-update
sudo rpi-update
and rebooted.

You should now be able to check the wifi is working with command

Code: Select all

sudo iwlist wlan0 scan
This should show a list of wifi networks, provided of course there are any near you.

Now to configure the AP, first installing the necessary packages and files required.

Code: Select all

sudo apt-get update
sudo apt-get install bridge-utils hostapd
and now update hostapd to handle the realtek wifi

Code: Select all

wget https://dl.dropboxusercontent.com/u/80256631/hostapd
sudo mv hostapd /usr/sbin/hostapd
sudo chown root.root /usr/sbin/hostapd
sudo chmod 755 /usr/sbin/hostapd
Now set up the /etc/network/interfaces file like

Code: Select all

auto lo
iface lo inet loopback

iface eth0 inet dhcp

auto br0
iface br0 inet dhcp
bridge_ports eth0 wlan0
and the /etc/hostapd/hostapd.conf file like

Code: Select all

interface=wlan0
driver=nl80211
bridge=br0
ssid=Network-Name
channel=1
wmm_enabled=0
wpa=1
wpa_passphrase=Network-Password
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
auth_algs=1
macaddr_acl=0 
substituting the network name and password you want to use.

The set up should now be ready to test so first reboot your Pi.

After logging in run command

Code: Select all

sudo hostapd -dd /etc/hostapd/hostapd.conf
to start the AP. I tested my AP by connecting my Windows laptop to the AP.
Once you determine the AP is working edit file /etc/default/hostapd to get the AP to automatically start when the Pi boots. In file /etc/default/hostapd uncomment line

Code: Select all

#DAEMON_CONF=""
and change it to

Code: Select all

DAEMON_CONF="/etc/hostapd/hostapd.conf"
After rebooting the AP should automatically start.



MrEngman
Simplicity is a prerequisite for reliability. Edsger W. Dijkstra

Please post ALL technical questions on the forum. Please Do Not send private messages.

Return to “Beginners”