Bosse_B
Posts: 918
Joined: Thu Jan 30, 2014 9:53 am

How to make a Pi2 a WiFi AP for local network

Fri Nov 13, 2015 8:48 am

I would like to make an RPi2 run as a WiFi Access point for a local network without Internet access.
The hardware would be a Raspberry Pi2B (running Raspbian Jessie) and an EdiMax EW-7811Un USB WiFi plug.
The Pi2B will be connected by Ethernet to a wired network with Internet access via a router. So the RPi2 would have Internet connection.

I want the Pi2 to act as an Access Point for a number of devices to connect and then talk to each other and the Pi2 but not to the Internet.
I will run a TCP service on the Pi2 for these devices to use so they need to be able to connect to this service and to each other as well, but they must NOT be able to connect to the wired network or the Internet via the RPi2.

Say the wired Ethernet network is using 192.168.117.0 as network and the WiFi AP network is on 192.168.213.0 and there should be no routing from the AP network to the Internet.

Can this be done (I assume the answer is yes) and if so how should I go about it?
Bo Berglund
Sweden

drgeoff
Posts: 10316
Joined: Wed Jan 25, 2012 6:39 pm

Re: How to make a Pi2 a WiFi AP for local network

Fri Nov 13, 2015 2:26 pm

Easier, neater and cheaper to buy a $15 AP from ebay and don't connect it to the internet. :)

Zorac
Posts: 25
Joined: Wed Nov 04, 2015 4:04 am

Re: How to make a Pi2 a WiFi AP for local network

Fri Nov 13, 2015 2:33 pm

there is an openwrt image for raspberry pi.

http://wiki.openwrt.org/toh/raspberry_p ... spberry_pi

probably the easiest way to go, although i havent tried it myself yet.

Bosse_B
Posts: 918
Joined: Thu Jan 30, 2014 9:53 am

Re: How to make a Pi2 a WiFi AP for local network

Fri Nov 13, 2015 2:38 pm

drgeoff wrote:Easier, neater and cheaper to buy a $15 AP from ebay and don't connect it to the internet. :)
OK, so how do I put the TCP service software programmed with Free-Pascal onto that cheap AP?
It is compiled for the ARM7 on a Pi2.
Bo Berglund
Sweden

drgeoff
Posts: 10316
Joined: Wed Jan 25, 2012 6:39 pm

Re: How to make a Pi2 a WiFi AP for local network

Fri Nov 13, 2015 8:26 pm

Bosse_B wrote:
drgeoff wrote:Easier, neater and cheaper to buy a $15 AP from ebay and don't connect it to the internet. :)
OK, so how do I put the TCP service software programmed with Free-Pascal onto that cheap AP?
It is compiled for the ARM7 on a Pi2.
You have not explained why any ordinary unmodified Wi-Fi AP is not adequate for your needs. It provides IP connectivity between its clients and if it is not plugged into an internet feed those clients cannot access the internet.

What have you not stated?

Bosse_B
Posts: 918
Joined: Thu Jan 30, 2014 9:53 am

Re: How to make a Pi2 a WiFi AP for local network

Fri Nov 13, 2015 11:30 pm

I found a website describing just about all I wanted to do here:
Adafruit WiFi AP description
I have started following it and will report back when I am finished.
Bo Berglund
Sweden

Bosse_B
Posts: 918
Joined: Thu Jan 30, 2014 9:53 am

Re: How to make a Pi2 a WiFi AP for local network

Sun Nov 15, 2015 11:47 pm

Got through most of the AdaFruit AP instructions but skipped the replacement of hostapd for the adafruit version because I am running Jessie and it should have an up-to-date hostapd.

Problem is that when I try to start the AP using the command line I get an error:

Code: Select all

pi@rpi2-jessie ~ $ sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf
Configuration file: /etc/hostapd/hostapd.conf
Line 3: invalid/unknown driver 'rtl8192cu'
1 errors found in configuration file '/etc/hostapd/hostapd.conf'
Failed to set up interface with /etc/hostapd/hostapd.conf
Failed to initialize interface
I have changed the driver in that file to a number of different names taken from various threads here but none works.
I have an EdiMax EW-7811Un adapter and lsusb shows this about the adapter:

Code: Select all

pi@rpi2-jessie ~ $ lsusb
Bus 001 Device 004: ID 1ea7:0002
Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS
Does someone here know how I can find out which driver the WiFi dongle actually uses?
It works perfectly well as a WiFi network interface for connecting to my local wlan, so I am sure Jesssie has a working driver, but I need to know its name to put into the hostapd.conf file...
Bo Berglund
Sweden

User avatar
Hove
Posts: 1205
Joined: Sun Oct 21, 2012 6:55 pm
Location: Cotswolds, UK
Contact: Website

Re: How to make a Pi2 a WiFi AP for local network

Mon Nov 16, 2015 7:49 am

Bosse_B wrote:Got through most of the AdaFruit AP instructions but skipped the replacement of hostapd for the adafruit version because I am running Jessie and it should have an up-to-date hostapd.
I still need the updated hostapd for Jessie as only the updated hostapd uses the right ioctl calls to enable WAP in the RealTek driver.
www.pistuffing.co.uk - Raspberry Pi and other stuffing!

Bosse_B
Posts: 918
Joined: Thu Jan 30, 2014 9:53 am

Re: How to make a Pi2 a WiFi AP for local network

Mon Nov 16, 2015 10:50 am

Hi,
I created a new thread in the Raspbian subforum to ask about the driver.
In this I got some replies that led to a solution regarding the hostapd and driver issues.
You might want to have a look there even though I am not completely done yet (DHCP is not working).
Bo Berglund
Sweden

User avatar
Hove
Posts: 1205
Joined: Sun Oct 21, 2012 6:55 pm
Location: Cotswolds, UK
Contact: Website

Re: How to make a Pi2 a WiFi AP for local network

Mon Nov 16, 2015 1:44 pm

Bosse_B wrote:You might want to have a look there even though I am not completely done yet (DHCP is not working).
Sorry, I wasn't clear - what I meant to say was that by using the hostapd I linked to, WAP worked with Jessie.
www.pistuffing.co.uk - Raspberry Pi and other stuffing!

Bosse_B
Posts: 918
Joined: Thu Jan 30, 2014 9:53 am

Re: How to make a Pi2 a WiFi AP for local network

Mon Nov 16, 2015 1:55 pm

Hove wrote: Sorry, I wasn't clear - what I meant to say was that by using the hostapd I linked to, WAP worked with Jessie.
I did not see any link in the post you made above...
Bo Berglund
Sweden

Bosse_B
Posts: 918
Joined: Thu Jan 30, 2014 9:53 am

Re: How to make a Pi2 a WiFi AP for local network

Mon Nov 16, 2015 1:56 pm

By the way, I managed to get it going in the end. See the thread I linked to above.
Bo Berglund
Sweden

User avatar
Hove
Posts: 1205
Joined: Sun Oct 21, 2012 6:55 pm
Location: Cotswolds, UK
Contact: Website

Re: How to make a Pi2 a WiFi AP for local network

Mon Nov 16, 2015 1:58 pm

Bosse_B wrote:By the way, I managed to get it going in the end. See the thread I linked to above.
Oops, sorry - I meant to include this link: http://www.jenssegers.be/43/Realtek-RTL ... spberry-Pi
www.pistuffing.co.uk - Raspberry Pi and other stuffing!

User avatar
KnightOfPi
Posts: 50
Joined: Sun Dec 28, 2014 12:57 pm
Location: Vienna - Austria
Contact: Website

Re: How to make a Pi2 a WiFi AP for local network

Mon May 02, 2016 5:52 pm

Hey Hove,

here is my tutorial for setting up a WAP with Raspbian Jessie/a Raspberry Pi 3:
http://www.knight-of-pi.org/configure-t ... an-jessie/

Have fun!
Check out www.knight-of-pi.org for many beginner-friendly tutorials!

User avatar
Hove
Posts: 1205
Joined: Sun Oct 21, 2012 6:55 pm
Location: Cotswolds, UK
Contact: Website

Re: How to make a Pi2 a WiFi AP for local network

Mon May 02, 2016 6:19 pm

Thanks KnightOfPi, I was just about to post how to do this - you've answered my question before I asked it.

Do you still need to run client DHCP (dhcpcd) for this to work, given that my WAP does not bridge to the internet? If not, how to do stop it running at boot time?
www.pistuffing.co.uk - Raspberry Pi and other stuffing!

Return to “Networking and servers”