RPI as WAP. Stuck. LInks read.


22 posts
by lerner » Mon Jun 12, 2017 9:57 pm
Hi folks.

I've been trying to set up an "old" pi as a Wireless Access Point to no luck.

This is the link I am reading/using:
https://www.raspberrypi.org/documentation/configuration/wireless/access-point.md

Though mine is an OLD RPI V1 I think. With the yellow composite video output.

But its software is up to date with the sudo commands.
(And AFAIK running Jessie)


So, before I start, it is working as a machine on my network fine. Doing NTP stuff.
Oh, and it is headless.


I go through the install steps listed - though I am not exactly sure if I want FIXED IP or DNS, but anyway...... I don't think that is the cause of the problem.

Configuring a static IP

We are configuring a standalone network to act as a server, so the Raspberry Pi needs to have a static IP address assigned to the wireless port. This documentation assumes that we are using the standard 192.168.x.x IP addresses for our wireless network, so we will assign the server the IP address 192.168.0.1. It is also assumed that the wireless device being used is wlan0.


That kind of looks like what I want to do, so I continue with what is says.

This part is where I fall over:
First, the standard interface handling for wlan0 needs to be disabled. Normally the dhcpd daemon will search the network for another DHCP server to assign a IP address to wlan0. This is disabled by editing the configuration file:

sudo nano /etc/dhcpcd.conf

Add denyinterfaces wlan0 to the end of the file (but above any other added interface lines) and save the file.


Add denyinterfaces wlan0 to the end of the file (but above any other added interface lines) and save the file.
WHAT?
ENGLISH... Not geek talk.

I put it "above other added interface lines" - though even that is meaning less to me - and the machine just won't work.
It boots, but has no IP address.
There is no new wifi network available - I use a wifi scanning app, and it saw nothing new - and I had to go back and take out said lines to get the machine working again.

Now, I know it says WAP. But that too is confusing.

My network has two parts - in that:
I have a mode with wifi.
It connects to the rest of my network.
This link is not permanent. Sometimes I disconnect the link from the modem to the rest of the network.
So, on the "my side of the network" I want a WAP. Different SSID/wifi network name.

I can't see why it is not possible. Given my WAP will have a fixed IP address and there will probably ever be one or two devices connected to it at once. Basically as I see it, it is just changing the connection media from cable to wifi for that IP address.

I'll stop here as I think I have explained it as best I can and don't want to repeat myself over and over.

Help appreciated.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by DougieLawson » Mon Jun 12, 2017 10:00 pm
Is your WiFi dongle capable of running as an AP?

The docs you are following are for the RPiZW and RPi3B that both have an access point capable WiFi built-in on the main board.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.
User avatar
Posts: 28140
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
by lerner » Mon Jun 12, 2017 11:57 pm
The dongle is the "wipi" one which has the rpi stamp on it.

For the link I typed raspi wap and looked at the one which looked the better one.

I guess my luck in picking the wrong one is still as good as it ever was.

Shall explore other links soon.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by fruitoftheloom » Tue Jun 13, 2017 6:12 am
lerner wrote:The dongle is the "wipi" one which has the rpi stamp on it.

For the link I typed raspi wap and looked at the one which looked the better one.

I guess my luck in picking the wrong one is still as good as it ever was.

Shall explore other links soon.


The Official Raspberry Pi Wireless USB Adaptor supports Access Point, so the Official Guide should be applicable, if you are actually running Raspbian jessie:

http://raspi.tv/2015/new-official-raspb ... and-edimax
.
Ex Computer Repair & Service Technician.
RPi 3B, HP Envy 4500 Wireless Printer, Google Chromecast, Android Smart Phone, HD 1080p TV and 3/4G Mobile Internet make ideal companions.
Posts: 13888
Joined: Tue Mar 25, 2014 12:40 pm
Location: Bognor Regis UK
by jamesh » Tue Jun 13, 2017 9:26 am
lerner wrote:This part is where I fall over:
First, the standard interface handling for wlan0 needs to be disabled. Normally the dhcpd daemon will search the network for another DHCP server to assign a IP address to wlan0. This is disabled by editing the configuration file:

sudo nano /etc/dhcpcd.conf

Add denyinterfaces wlan0 to the end of the file (but above any other added interface lines) and save the file.


Add denyinterfaces wlan0 to the end of the file (but above any other added interface lines) and save the file.
WHAT?
ENGLISH... Not geek talk.


Not sure how to make that clearer - it basically means adds the text "deny interfaces wlan0" to the end of the file, but if there are any lines starting with interface above those. Woudl that be clearer?

This stops the Pi Wifi getting a IP address from a DHCP server. You need to have assigned a static IP address elsewhere. Note, you need to ensure that you are using wlan0 - by default is that how your Wifi adaptor appears?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Please direct all questions to the forum, I do not do support via PM.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 17210
Joined: Sat Jul 30, 2011 7:41 pm
by lerner » Tue Jun 13, 2017 9:41 pm
Well to maybe help where I am confused, here is a part of the dhcpcd.conf file:

Code: Select all
##  New stuff for WAP testing   Is this the right place
#denyinterfaces wlan0
#denyinterfaces eth0



interface eth0
static ip_address=192.168.0.86
static router=192.168.0.254
#static domain_name_servers=61.9.194.49
static domain_name_servers=192.168.0.254
option rapid_commit
option ntp_servers
require dhcp_server_identifier
slaac private
nohook lookup-hostname
static routers=192.168.0.254
#static domain_search=61.9.195.193
static domain_serach=192.168.0.254

##  Or should it be here?
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by lerner » Tue Jun 13, 2017 11:19 pm
I am now reading this on how to set up a WAP:

https://www.pi-point.co.uk/documentation/

But it would seem this too has a "problem".

Now to configure hostap. Edit /etc/hostapd/hostapd.conf (it may not already exist but this will create it, anyway) to look like this:

interface=wlan0
driver=nl80211
ssid=test
channel=1


The driver.
Doing a lsmod I get a listing/entry called cfg82011

None of the articles explain WHERE you get this nl80211 from.
So I am guessing that the "cfg82011" is the driver.
ssid - got that.
channel=1

And what happens if there is another wifi network already working on channel 1?

Again this is not really explained why a channel has to be specified.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by DougieLawson » Wed Jun 14, 2017 9:23 am
You have a choice between channel 1 and channel 13 (or 1 to 11 in the United States). If there are other APs broadcasting on channel 1 then nothing bad happens (in terms of getting connected) except that the signal may be attenuated due to the second transmitter.

Scan your area, have a look where your neighbours are broadcasting and pick a less used channel.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.
User avatar
Posts: 28140
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
by lerner » Thu Jun 15, 2017 4:29 am
Thanks much Dougie.

But not wanting to sound ungrateful, I'm still stuck with the driver's name.

That's nothing against you. Just how all the docs are written that they just seem to pluck it from the air and not explain how it is found.

Thanks in advance.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by fruitoftheloom » Thu Jun 15, 2017 11:35 am
lerner wrote:I am now reading this on how to set up a WAP:

https://www.pi-point.co.uk/documentation/

But it would seem this too has a "problem".

Now to configure hostap. Edit /etc/hostapd/hostapd.conf (it may not already exist but this will create it, anyway) to look like this:

interface=wlan0
driver=nl80211
ssid=test
channel=1


The driver.
Doing a lsmod I get a listing/entry called cfg82011

None of the articles explain WHERE you get this nl80211 from.
So I am guessing that the "cfg82011" is the driver.
ssid - got that.
channel=1

And what happens if there is another wifi network already working on channel 1?

Again this is not really explained why a channel has to be specified.


from the link

First install Raspbian from the Raspberry Pi site - http://www.raspberrypi.org/downloads – at the time of writing the current version is 'Wheezy'.


I was under the impression you are running Raspbian Jessie ?? Mix and matching old and new is a recipe for disaster ;)
.
Ex Computer Repair & Service Technician.
RPi 3B, HP Envy 4500 Wireless Printer, Google Chromecast, Android Smart Phone, HD 1080p TV and 3/4G Mobile Internet make ideal companions.
Posts: 13888
Joined: Tue Mar 25, 2014 12:40 pm
Location: Bognor Regis UK
by lerner » Thu Jun 15, 2017 11:41 am
Yes, I am running Jessie.

But sorry, I am really seeming to be missing something.


Given it was written in the time of Wheezy, fair enough.

But all the articles I am digging up and reading: They don't explain from where they get the name of the driver.

Or at least as I am seeing it.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by fruitoftheloom » Thu Jun 15, 2017 12:01 pm
lerner wrote:Yes, I am running Jessie.

But sorry, I am really seeming to be missing something.


Given it was written in the time of Wheezy, fair enough.

But all the articles I am digging up and reading: They don't explain from where they get the name of the driver.

Or at least as I am seeing it.


As you are running Raspbian Jessie and you stated you have a USB WiFi Adaptor which has the Broadcom Chipset, then at a loss why:

https://www.raspberrypi.org/documentati ... s-point.md

..is not functioning for you, it was written as part of the official documentation, you appear to be looking for something which does not exist, I am out of here :?
.
Ex Computer Repair & Service Technician.
RPi 3B, HP Envy 4500 Wireless Printer, Google Chromecast, Android Smart Phone, HD 1080p TV and 3/4G Mobile Internet make ideal companions.
Posts: 13888
Joined: Tue Mar 25, 2014 12:40 pm
Location: Bognor Regis UK
by lerner » Thu Jun 15, 2017 9:55 pm
Yikes.... sorry I wasnt trying to be difficult.

So let me check I am now understanding this whole picture:
Because it is a known chip set the driver for it (derived from the chip set etc) is that nl80211 (or what ever is written in that document). Sorry but just now I am away from the pi and am on my phone so multiple windows are not really an option.

Ah. Ok. Now I get it.

So if I use a different brand I accept the driver needs to change.

What are those steps? That way I have a bigger understanding of how it all fits together.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by lerner » Fri Jun 16, 2017 1:44 am
Well, good news and not so good news.

I've just got home and am trying it all from the get go.

I've got the WAP visible - as per the example - but am having problems connecting.
Probably I messed something up. But anyway....... I'll get back to that.

Another "Dumb question" about a WAP:
If I set up a PI up as a WAP, can I still ssh to it?

As it is, I have to boot the PI with no dongle plugged in.
I can SSH to it and do things. But the second I plug the dongle in...... It is dead from the SSH point of view.
However, the WAP name is visible and I can connect to it. Though as said above, that isn't quite 100% working.

This whole thing is going to be a bit of a waste of my time if the PI becomes "dead in the water" for SSH access from that point onwards.



Now, also Fruitoftheloom,
That link is for a Pi3 or Zero(W).
Not a Pi 2b.

No big as far as I can see. Things seem to work, but I am not having luck with the authentication.
Again: Probably something I did earlier. (Kinda nice if there was a way to go back to a point before I started messing about. As much as it pains me to say it: A bit like the "restore points" in windows.)

So, in the bigger picture: I have moved forward one square, which is good.
Now the next square's problems.


But thanks for the help/pointers all the same.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by lerner » Fri Jun 16, 2017 11:10 pm
Good news and even better news.

I played around and got the WAP working on a RPI 2B running Jessie.
And I also did the leg work to get BOTH dongles working. Obviously not at the same time, but studied what to change to allow either to work.

All good.

Now, if you are still reading, here is the "Rub":
I have an old RPI 1 on my network. It is my NTP server and it works. I added an RTC and 99% of the time it is good. It is headless - that's a given.

It is running Wheezy.
As it is powered 24/7 this would be a good unit to use as a WAP.

Given that the EDIMAX dongle is (probably) not supported in Wheezy, I shall have to pick the Wi-Pi one, as I hope it IS supported.

Alas because of my lack of knowledge of what is listed with the lsusb command and where the drivers are stored in the O/S, I am not having much luck on that side.

From my poking around with Jessie, the Wi-Pi needs/uses the "RTL2870" driver.
But when I am going through setting up the hostapd thing, it keeps failing.
There is/was a link where you run a command something like:

Code: Select all
sudo /sbin/hostapd -d /etc/hostapd/hostapd.conf


and it helps you debug what is going on.

Alas (from memory) it was complaining about the driver....... Not existing.

I don't know if it is possible to "install" the RTL2870 driver on Wheezy, and where to put it.

So, after all the posts, questions and what ever:
Can someone help me with getting the Wi-Pi (bought from E14 as the "official" wifi dongle for the Pi) dongle working on a RPI 1 running wheezy?


I'm not sure a RPI 1 would run Jessie, and I would prefer to keep what is working working as the NTP server.
Surly getting the wifi working would be the easier way.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by DougieLawson » Fri Jun 16, 2017 11:35 pm
The very latest versions of Raspbian Jessie 2017-04-10 and NOOBS2.4 are compatible with ALL models of Raspberry. There's no excuse to stick with Wheezy which has been end-of-support for more than 18 months.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.
User avatar
Posts: 28140
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
by lerner » Fri Jun 16, 2017 11:42 pm
Yeah, ok, thanks Dougie.

I just didn't want to go from one problem to another with setting up the NTP server again once I updated.

I guess that could look like a cop out, but with how little I know about the O/S, re-enforced by the wifi stuff, I just wasn't sure if updating the O/S to Jessie was going to be any easier.

It took me yonks setting up the NTP side of the Pi.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by DougieLawson » Sat Jun 17, 2017 5:05 am
ntp is built-in to Raspbian Jessie. The only complication is if your network doesn't support the "tos" stuff and you need to mangle ntp packets with an iptables rule.

sudo /sbin/iptables -t mangle -I POSTROUTING 1 -o wlan0 -p udp --dport 123 -j TOS --set-tos 0x00
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.
User avatar
Posts: 28140
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
by lerner » Sat Jun 17, 2017 9:58 am
Dougie,
et al,

Good news!

6 hours of work, and it is 99% there!

But first the problem - back story.

Yesterday's ventures were interesting.
I discovered that the WAP (wifi) IP address can't be the same as the wired one. Kinda obvious in hind sight, but.....

So, I got it up and working with the dongle and for some reason - yet unknown to me - I could surf the bigger network.
It would seem NAT was working.

Today when I got it all set up and got it working, seems the NAT isn't working.

Alas I lost the link with the EDIMAX walk through but the other links (too) didn't mention the need for NAT.

So could someone help with this final point?

Thanks in advance.

Oh, P.S.
Even last night, I never got down as far as the "bridge" part...... I simply set up the WAP, got it working and tested if I could connect.
In my "stupidity" I tried to ping my ADSL modem - different network to the wifi one - while connected on the wifi network.
Don't ask me.
(Shrug)
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by DougieLawson » Sat Jun 17, 2017 10:43 am
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

Since 2012: 1B*5, 2B*2, B+, A+, Zero*2, 3B*3

Please post ALL technical questions on the forum. Do not send private messages.
User avatar
Posts: 28140
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
by lerner » Sat Jun 17, 2017 10:25 pm
Dougie,

Yes, thanks.

Bookmarked now.

Well, on the good side of things: It seems to be working now 100% NTP and WAP!

Though weirdly when I got to the bridging part the commands fell over and weren't working, and so I never "built the bridge" yet it seems I can surf the net as well when connected to the WAP.
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am
by lerner » Sun Jun 18, 2017 11:06 pm
Oops, on my part.

It works, but with a bit of a "must have" needing to be met.
It needs a connection to the ADSL modem. That is the DHCP server.

I have the wifi channel set to a different range than the calbe side - that's been explained.
The subnet address allows (I think) 7 addresses with DHCP.

I get that I can't have 2 DHCP servers on the one network (cable) and so I suspect I need to set up something like a fixed range of addresses on the cable side that the RPI assigns to the wifi connections.

So, if I have 7 addresses on the wifi, I set up 7 reserved addresses like: .100, .101, .102, .103, .104, .105, .106
But my little knowledge doesn't know how to.

It can be done - yeah?
Posts: 328
Joined: Sun Mar 29, 2015 12:12 am