bendylegs
Posts: 10
Joined: Tue Apr 28, 2015 10:19 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Fri Nov 13, 2015 11:57 pm

Cheers I'll try that. Even with the changes to rc.local it only seems to work on boot half the time. I tried your tip of putting it in its own special if script but then it didn't work on boot at all, so I left the up down assign ip dance in rc.local.

None of this seems an issue in wheezy, is jessie a bit too fresh? My pi has to work controlling an art installation with limited capacity for me getting it working if / when it falls over.

bendylegs
Posts: 10
Joined: Tue Apr 28, 2015 10:19 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sat Nov 14, 2015 1:56 am

Ok it seems to boot up reliably now as a wireless access point but I have to bring my eth0 down and back up again before I can get it assigned an ip allowing me to ssh over wired. If I add this to rc.local then it won't finish booting at all if not's wired.

I suppose a script that checked if it was wired and brought it down and back up again if it was would work...

Can ifplugd be configured to just leave wlan0 alone and just look after bringing up eth0?

On a wider note why is this happening to eth0 anyway, is it something to with uninstalling ifplugd and raspberrypi-net-mods?

cwcharlick
Posts: 1
Joined: Sat Nov 21, 2015 4:35 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sat Nov 21, 2015 11:22 pm

Hello!

Just got my first RPi (RPi 2 model B) running Jessie.

I'm an absolute noob in all things Raspbian/linux etc. I have followed this tutorial, but I do not even see a hotspot being created. If anyone can help I'd really appreciate it! As I don't really understand what any of the tutorial is really doing I can't really trouble shoot so not sure what part this would be, just want it to work as a hotspot :)

Thanks,

Chris

G109B
Posts: 21
Joined: Thu Sep 12, 2013 9:57 am

More observations

Sun Nov 22, 2015 2:48 pm

More on this troubling subject:

1. I believe these problems are due to a race condition during startup. Before my additions to rc.local there were just two possible outcomes after boot-up: the correct ip address or the default (incorrect) address, and these two outcomes occurred randomly - my definition of a race condition. I believe Jessie has stopped using the run-level based startup system in favour of following the dependency tree which allows multiple un-related service starts. So the problem, and its fix, lies in the dependency tree and can only be fixed by the authors.

2. The Raspi 2B is six time faster than the B+ which I am using, so it is no surprise to me that it has come down heavily on the wrong side of the race.

3. My statement that "I don't use ifplugd" was not entirely correct, because it was based on running "ps -ef | grep ifplugd". If I run "sudo service ifplugd status" I can see that the start script ran successfully but made some sensible decisions:

Code: Select all

Nov 21 23:20:16 raspi2 ifplugd[508]: Network Interface Plugging Daemon...skip eth0...skip wlan0...done.
Nov 21 23:20:16 raspi2 systemd[1]: Started LSB: Brings up/down network automatically.
4. I also have a Raspi 2B running Wheezy with only a normal wlan0 interface active, and it does report ifplugd running. Unfortunately it is not available for empirical testing.

5. I dumped the recommended dhcp server and installed isc-dhcp-server, from the same stable as the normal dhcp client which we are all using. You need the client to obtain an address on your home network, and the server to allocate addresses to the clients of your hotspot. The daemons have confusingly similar names: client:dhcpcd, server:dhcpd.

6. I can unplug then plug my eth0 i/f without upsetting hostapd, but the jury is out on the effect this had on dhcpd (hotspot dhcp server), clouded by the ability of my iPhone to continue using the address it had yesterday while showing "connecting" on the settings page and no address info.

So I am "sort of happy" but wishing 'they' would sort it all out.

bendylegs
Posts: 10
Joined: Tue Apr 28, 2015 10:19 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Nov 22, 2015 2:53 pm

The whole ifplugd thing seemed to be a red herring for me. The only way I got it to work reliably was to put a script in to rc.local that brought down wlan0 put it back up, assigned ip and restarted hostapd and dhcp servers. Which is a bit rubbish. I suspect your race condition suggestion is correct.

Code: Select all

/sbin/ifdown wlan0
/bin/sleep 1
/sbin/ifup wlan0
/bin/sleep 1
/sbin/ifconfig wlan0 192.168.42.1
/bin/sleep 1
/usr/sbin/service hostapd stop
/usr/sbin/service udhcpd stop
/bin/sleep 1
/usr/sbin/service hostapd start
/usr/sbin/service udhcpd start

G109B
Posts: 21
Joined: Thu Sep 12, 2013 9:57 am

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Nov 22, 2015 4:15 pm

Yes, I like this one. My 'cheaper' version works for me, but this is the one to go for if all else fails.

noiseboy90
Posts: 5
Joined: Sat Oct 17, 2015 3:38 am

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 26, 2015 4:20 pm

hey guys,

has anyone used this? is anyone able to tell me if it works without an internet connection? do you still get the splash page?

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Nov 26, 2015 7:10 pm

noiseboy90 wrote:hey guys,

has anyone used this? is anyone able to tell me if it works without an internet connection? do you still get the splash page?
It was written with Raspbian Wheezy in mind, but I haven't tested it with Jessie yet. If I get some free time (a rare commodity for me these days) I'll update the tutorial.

It'll work just fine without an internet connection, allowing connected devices to communicate with the Pi and with each other. I'm not sure what "splash page" you're referring to, but if you run a web server on the Pi you'll be able to access it by the Pi's IP address.

vpnDN
Posts: 1
Joined: Thu Dec 10, 2015 4:56 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Dec 10, 2015 5:06 pm

Hello guys,

I've just saw this tutorial and read a couple of pages.

My question is, finally is it possible to make a Hotspot with Wi-fi dongle, which doesn't have AP or Master mode ?
Example: my wi-fi is supporting only "monitor" and 'managed' modes

Cheers

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

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Dec 13, 2015 11:09 am

Hi all,

here is my take on setting up a wireless access point on the Raspberry Pi for a Logilink wl0084b dongle/nl80211 chipset:
http://www.knight-of-pi.org/setup-a-ras ... b-nl80211/

Works good, but i am still trying to run it on Jessie.
Check out www.knight-of-pi.org for many beginner-friendly tutorials!

kenwey
Posts: 2
Joined: Mon Dec 21, 2015 3:07 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Dec 21, 2015 3:43 pm

I have the problem that I have a wireless hotspot but my phones try but can't login because\ they can't get an ip address. I know this is an old problem but I cannot find an answer which works on the forum.

I cut and past from the tutorial to the files so there should not be any typos. I have also double checked. Everything is identical to the tutorial except In /etc/files/interfaces iface wlan0 inet dhcp is not present. I also do not have the lines wpa-roam etc and eface default etc. But I do have similar lines for wlan0 which i have hashed out.

I will be away from the internet for 4 months and want to run my pi headless from an android tablet to carry out a robot project. Even if I get this working is this the best way to do this? I can do it via wired usb but the robot really should not have a wire attached.

Any help for a beginner much appreciated.


[email protected] ~ $ ifconfig
eth0 Link encap:Ethernet HWaddr b8:27:eb:9b:78:7f
inet addr:192.168.1.13 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::ba27:ebff:fe9b:787f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1809 errors:0 dropped:0 overruns:0 frame:0
TX packets:1586 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1052920 (1.0 MiB) TX bytes:284507 (277.8 KiB)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:136 errors:0 dropped:0 overruns:0 frame:0
TX packets:136 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:11472 (11.2 KiB) TX bytes:11472 (11.2 KiB)

wlan0 Link encap:Ethernet HWaddr 04:a1:51:5e:5d:4d
inet addr:192.168.42.1 Bcast:192.168.42.255 Mask:255.255.255.0
inet6 addr: fe80::7cf3:c123:4dce:7bc2/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:107 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:26240 (25.6 KiB)

[email protected] ~ $

hunternet93
Posts: 336
Joined: Mon Dec 12, 2011 4:34 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Dec 21, 2015 10:26 pm

kenwey wrote:I have the problem that I have a wireless hotspot but my phones try but can't login because\ they can't get an ip address. I know this is an old problem but I cannot find an answer which works on the forum.
Sounds like the DHCP server probably isn't running, to check run this command:

Code: Select all

pgrep udhcpd
If it returns a number then the DHCP server is running and the problem is elsewhere. If it doesn't do anything and just returns you to a prompt, then try manually starting the server with:

Code: Select all

sudo udhcpd -f /etc/udhcpd.conf
If it gives you any error messages please post them here, if it works properly then something's keeping it from starting on boot. Debian Jessie changed the way programs are started at boot, I have yet to update the tutorial to account for that.

kenwey
Posts: 2
Joined: Mon Dec 21, 2015 3:07 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Tue Dec 22, 2015 2:57 pm

Thanks, Hunternet for coming back so quickly, it is very much appreciated.

Below is copied from the terminal. I ran the second command and then was able to connect my tablet which is great and shown in the last two lines. Can you help me to adjust udhcpd and then get it running on boot as I will not have a monitor until I connect to the tablet.

[email protected] ~ $ pgrep udhcpd
[email protected] ~ $ sudo udhcpd -f /etc/udhcpd.conf
udhcpd (v1.22.1) started
udhcpd: max_leases=235 is too big, setting to 19
Sending OFFER of 192.168.42.19
Sending ACK to 192.168.42.19
^[email protected] ~ $

capedcrusader029
Posts: 2
Joined: Wed Dec 23, 2015 6:57 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Wed Dec 23, 2015 7:25 pm

im trying to install hostapd in ubuntu-core (berryboot) but I get the following error
Package hostapd has no installation candidate


how to fix this.. plz help..

gummyni
Posts: 1
Joined: Mon Jan 18, 2016 11:30 am

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Jan 18, 2016 11:54 am

mentalwall wrote:Cheers for the help.

I've spent a bit of time trying to get 'n' enabled. For anyone that's interested add the following to hostapd.config :

Code: Select all

wme_enabled=1
ieee80211n=1
This got me to 65mb/s then I installed iw (http://wireless.kernel.org/en/users/Documentation/iw) to find the hardware modes of the adapter adding:

Code: Select all

ht_capab=[HT40+][SHORT-GI-40]
Has got me to 72mb/s. I believe that my dongle is capable of 150 mb/s so I'm not sure where the excess bandwidth has gone but hopefully this helps someone out.

With regards to keeping track of who's connect a little webpage would be amazing but I guess it would require installing apache and a reasonable amount of time.
My RT5730 USB WiFi adapter is also 72Mbps max as a HostAP, but RTL8188CUS is 150Mbps max as a HostAP. I think the driver named rt2800usb has some bugs.

Code: Select all

ht_capab=[HT40+]
or

Code: Select all

ht_capab=[HT40-]
is no effect for RT5730 now.

LEVII777
Posts: 2
Joined: Mon Feb 01, 2016 4:18 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Tue Feb 02, 2016 1:45 pm

Hi I followed this tutorial and im able to connect to the pi but i dont seem to have access to the internet, anyone know how i could fix this?

Thanks

mrodsilva
Posts: 5
Joined: Wed Mar 16, 2016 7:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Wed Mar 16, 2016 7:28 pm

Hi,

I did setup my Pi to run as router. The configuration is as follows:

Huawei E3276 - 4G internet connection (ppp0)
WiFi RTL8188CUS - Connection share (wlan0)

My iptables is as follows:

Code: Select all

sudo iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
sudo iptables -A FORWARD -i ppp0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
sudo iptables -A FORWARD -i wlan0 -o ppp0 -j ACCEPT
Everything is working fine (thanks to the tutorial).

It turns out that I have a webserver running on my Pi as well. I am able to reach the webserver from any attached device (my mac, my phone) through the wlan0 interface (10.0.0.1 - the static IP address of my Pi). But I can't reach the webserver from outside (using the internet IP address). Does anyone know if there is any iptable rule that should do the trick?

Thanks

G109B
Posts: 21
Joined: Thu Sep 12, 2013 9:57 am

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Mar 17, 2016 2:38 pm

If you are running apache2 you need to create a site in /etc/apache2/sites-available and link it to sites-enabled using a2ensite.
I copied the default site and modified it accordingly. Otherwise read the docs for your server software, or ditch it and use apache.

mrodsilva
Posts: 5
Joined: Wed Mar 16, 2016 7:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Mar 17, 2016 6:04 pm

Hi,

As matter of fact I'm running an application written in python that listen on a specific port. So if I browse to:

http://10.0.0.1:1234

I'm able to reach the app, but if I try the Internet IP address from out side my network:

http://191.247.231.50:1234

Then it just doesn't work

I've tried to ping my address too without success

Thanks

G109B
Posts: 21
Joined: Thu Sep 12, 2013 9:57 am

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Thu Mar 17, 2016 7:16 pm

Have you told your router to forward port 1234 to 10.0.0.1 ?

mrodsilva
Posts: 5
Joined: Wed Mar 16, 2016 7:15 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Fri Mar 18, 2016 12:52 pm

I've tried as follows:

Code: Select all

iptables -A PREROUTING -t nat -i ppp0 -p tcp --dport 1234 -j DNAT --to 10.0.0.1:1234
iptables -A FORWARD -p tcp -d 10.0.0.1 --dport 1234 -j ACCEPT
It didn't work.

My network interfaces is configured as follows:

Code: Select all

eth0      Link encap:Ethernet  Endereço de HW b8:27:eb:2f:7e:5e  
          endereço inet6: fe80::5045:6703:ceb3:c8c8/64 Escopo:Link
          UP BROADCASTMULTICAST  MTU:1500  Métrica:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

lo        Link encap:Loopback Local  
          inet end.: 127.0.0.1  Masc:255.0.0.0
          endereço inet6: ::1/128 Escopo:Máquina
          UP LOOPBACKRUNNING  MTU:65536  Métrica:1
          RX packets:118 errors:0 dropped:0 overruns:0 frame:0
          TX packets:118 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:0 
          RX bytes:10492 (10.2 KiB)  TX bytes:10492 (10.2 KiB)

ppp0      Link encap:Protocolo Ponto-a-Ponto  
          inet end.: 10.213.196.88  P-a-P:10.64.64.64  Masc:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1500  Métrica:1
          RX packets:3739 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3736 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:3 
          RX bytes:3819901 (3.6 MiB)  TX bytes:457642 (446.9 KiB)

wlan0     Link encap:Ethernet  Endereço de HW 00:13:ef:70:13:c4  
          inet end.: 10.0.0.1  Bcast:10.0.0.255  Masc:255.255.255.0
          endereço inet6: fe80::968f:5da4:a039:2fda/64 Escopo:Link
          UP BROADCASTRUNNING MULTICAST  MTU:1500  Métrica:1
          RX packets:5665 errors:0 dropped:12 overruns:0 frame:0
          TX packets:3998 errors:0 dropped:29 overruns:0 carrier:0
          colisões:0 txqueuelen:1000 
          RX bytes:787500 (769.0 KiB)  TX bytes:3996451 (3.8 MiB)

wwan0     Link encap:Ethernet  Endereço de HW 0c:5b:8f:27:9a:64  
          inet end.: 169.254.160.49  Bcast:169.254.255.255  Masc:255.255.0.0
          endereço inet6: fe80::584f:751f:bb3e:e26b/64 Escopo:Link
          UP BROADCASTRUNNING MULTICAST  MTU:1500  Métrica:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:51 errors:0 dropped:0 overruns:0 carrier:0
          colisões:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:12228 (11.9 KiB)
And iptables list:

Code: Select all

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     all  --  anywhere             anywhere             state RELATED,ESTABLISHED
ACCEPT     all  --  anywhere             anywhere            
ACCEPT     tcp  --  anywhere             10.0.0.1             tcp dpt:1234

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination 

Matiz
Posts: 1
Joined: Mon Mar 21, 2016 5:23 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Mar 21, 2016 5:34 pm

Not sure what I actually have to do, to fix this:

Configuration file: /etc/hostapd/hostapd.conf
Line 2: invalid/unknown driver 'nl80211'
1 errors found in configuration file '/etc/hostapd/hostapd.conf'


I have the WI-PI wi-fi dongle, which appear as:
Bus 001 Device 004: ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter
and use the nl80211 driver if i'm not mistaken ??

-thx

dmstewart
Posts: 7
Joined: Thu Mar 17, 2016 1:37 am

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Mar 27, 2016 12:13 am

Piminiuser wrote:No1 can help me? :cry:
When you ran lsusb it gave you the driver id for the hostapd.conf file. When it gave you the driver error you were most likely following a tutorial. But that is for one specific brand of wifi receiver. So try this:

open up the hostapd.conf with:

sudo nano /etc/hostapd/hostapd.conf

Then change line 2, the one with the incorrect driver ID to what lsusb showed. In the previous post it was reading as "RTL8188SU"

Change line 2 to that. try it with capital letters first and then without. It may recognize it.

CutPi
Posts: 4
Joined: Sun Apr 03, 2016 8:55 pm

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Sun Apr 03, 2016 9:09 pm

Hello,

Has anyone tried turning their Raspberry Pi 3 into a wifi hotspot?

I used the file "install" found here: https://github.com/CutEdge/RPI-Wireless-Hotspot

Here's the issue: I installed everything on the pi, and I turned on the pi, and it boots up. I know it's broadcasting a signal, because I can find the Wifi signal on my Dell laptop computer (using Debian Jessie, with the "Wicd" network manager). But when I go to connect to "RaspberryPiFi", it gets stuck on the "Obtaining IP Address..." stage.

Any ideas?

Thanks!

DirkS
Posts: 9845
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: [Tutorial] Using the RasPi as a WiFi hostspot (8 Nov 12)

Mon Apr 04, 2016 8:03 pm

CutPi wrote:Has anyone tried turning their Raspberry Pi 3 into a wifi hotspot?
Yes, loads of people have done that and succeeded.
I used the file "install" found here: https://github.com/CutEdge/RPI-Wireless-Hotspot
that's 2 years old and is pre-Jessie. I wouldn't use it.

Top hit using Google (https://www.google.co.uk/search?hl=en&s ... gws_rd=ssl) is
https://frillip.com/using-your-raspberr ... h-hostapd/
It works.

Return to “Networking and servers”