m4xhere
Posts: 6
Joined: Wed Dec 05, 2012 10:07 am

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

Mon Jan 07, 2013 11:48 am

hunternet93 wrote:
Update 9 Nov: The tutorial has now been moved to: http://elinux.org/RPI-Wireless-Hotspot


Update 11/8/12: Tutorial updated to work with 10/28/12 Raspbian image.
Big thanks to hunternet93 for sharing the knowledge :) i could sucessfully build a hot spot sharing my ADSL connection.. the first steps of setting up the Access Point was quite easy and i could have the access point visible in the mobile and the laptop..

i was trying to share my ADSL connection, dial a pppoe connection and share it.. so i was masquerading the eth0 of my router and the wlan0 of the wifi card in the raspberry pi. i did this for about a day even started with a fresh Wheezy image and every thing went well but no internet.. ! i could access the connected devices from other devices..
--->The fix was that was quite simple, instead masquerade ppp0 and NOT the eth0 if you want to share the dialed connection.. Step 3 changes:

Code: Select all

    This will enable NAT in the kernel. Second, run the following commands:
    [code]sudo iptables -t nat -A POSTROUTING -o [b]ppp0[/b] -j MASQUERADE
    sudo iptables -A FORWARD -i [b]ppp0[/b] -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
    sudo iptables -A FORWARD -i wlan0 -o [b]ppp0[/b] -j ACCEPT
every other thing is same except the above thing.

Hope this may help save others who try to share the ADSL connection over the wifi..
this setup is lot more flexible, secure and *cheap when compared to a normal WiFi router..

m4xhere
Posts: 6
Joined: Wed Dec 05, 2012 10:07 am

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

Mon Jan 07, 2013 11:59 am

x2phantom wrote:Why can't I edit my previous post?

So after trying the old firmware-ralink 0.28 packages the wlan0 interface didn't even show up. I'm now installing the new firmware again (0.36).
Anyone else got the RA5370 running in AP-mode?
i got RA5370 running in AP mode on the latest Wheezy image without any firmware updates.

Chapindad
Posts: 23
Joined: Wed Dec 26, 2012 1:21 am

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

Tue Jan 08, 2013 7:39 pm

So I used this image:
http://sirlagz.net/2012/12/31/raspbian- ... rsion-2-2/

And then followed your tutorial and it worked perfectly. THANKS!

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

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

Wed Jan 09, 2013 2:20 am

Chapindad wrote:So I used this image:
http://sirlagz.net/2012/12/31/raspbian- ... rsion-2-2/

And then followed your tutorial and it worked perfectly. THANKS!
I'm glad it worked for you!

dobbers24
Posts: 2
Joined: Thu Jul 19, 2012 2:35 pm

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

Wed Jan 09, 2013 9:17 pm

Followed the tutorial on a HP2133 laptop running wheezy - I wanted to test the set up before buying my second RasPi (first is already running sweet reading my inverter using sma-tool).

Tutorial worked a treat and I have the HP2133 laptop sharing out its WiFi and routing the traffic to the ethernet port and then on through my router to the ISP. So far so good.

My question is about the next stage to install and configure squid to first of all monitor the traffic and then to apply some rules to block inappropriate sites. I have downloaded squid and installed it but does anyone have the knowledge to apply a simple (i.e. baby steps) set of rules to configure the squid config files and iptables to just monitor via the access.log the traffic flowing across the HP2133/RasPi.

regards,

dobbers

32b6b15bbf7d
Posts: 3
Joined: Wed Jan 16, 2013 1:17 pm

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

Wed Jan 16, 2013 1:33 pm

I have a RT5370 and it works. Thanks for the tutorial!

But I still have 2 questions:

1. It doesn't work sooo good anymore when many devices are connected (some devices just loose the connection etc...).
Grauhut suggested the Alfa Awus036neh.
Grauhut wrote: If you want something powerful take this one:

Alfa Awus036neh
http://www.ebay.com/sch/i.html?_nkw=awu ... &_from=R40
Does the Alfa Awus036neh works without an powered USB hub, plugged directly to the Pi?
If not which wifi adapter do you suggest which is stronger than the RT5370 but doesn't need a powered USB hub?

2. Has anyone tested to enable 802.11n support (ieee80211n)?
If yes which adapters work with 802.11n (and is their one which doesn't need a powered USB hub)?

User avatar
Tickle
Posts: 23
Joined: Thu Jan 17, 2013 2:28 pm
Location: Indianapolis, Indiana
Contact: Website

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

Thu Jan 17, 2013 7:13 pm

Sorry for not digging through this post but what USB Dongle are people using with "Access Point"?
Hunter's Pi Projects: http://www.hunterthornsberry.com/raspberrypi.html

chirag
Posts: 18
Joined: Fri Dec 14, 2012 1:04 pm

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

Sun Jan 20, 2013 10:37 am

my
/etc/network/interfaces file shows like this...

auto lo
iface lo inet loopback

#allow-hotplug wlan0
#iface wlan0 inet manual
#wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf


iface eth0 inet static
address 192.168.137.30
netmask 255.255.255.0
gateway 192.168.137.1
iface default inet dhcp


and in my /etc/hostapd/hostapd.conf

bridge=br0
interface=wlan0
#driver=zd1211
ctrl_interface=var/run/hostapd
ctrl_interface_group=0
ssid=rasp
hw_mode=g
channel=8
wpa=2
wpa_psk=928519398acf811e96f5dcac68a11d6aa876140599be3dd49612e760a2aaac0e
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP
beacon_int=100
auth_algs=3
wmm_enabled=1

and in /etc/dnsmasq.conf file
interface=wlan0
dhcp-range=192.168.137.31,192.168.137.40,255.255.255.0,12h

with these settings i am getting an hotspot from my pi with the name My_AP but when i try to connect to the network it says limited access in windows ..:( i think its not forwarding ip address and i cannot ssh into pi wirelessly....you have any idea why this happening..?? i just want to ssh wirelessy from my pi...!!

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

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

Sat Jan 26, 2013 2:45 pm

Sorry for vanishing for the last couple weeks! I've been kept pretty busy with work, life, the Universe, everything, etc. I'll try to reply to everyone in this post, if I've missed someone just let me know.
dobbers24 wrote:My question is about the next stage to install and configure squid to first of all monitor the traffic and then to apply some rules to block inappropriate sites. I have downloaded squid and installed it but does anyone have the knowledge to apply a simple (i.e. baby steps) set of rules to configure the squid config files and iptables to just monitor via the access.log the traffic flowing across the HP2133/RasPi.
Googling for "Squid tutorial" should get you started, I don't have much experience with it although I'll probably try it out eventually.
32b6b15bbf7d wrote: 1. It doesn't work sooo good anymore when many devices are connected (some devices just loose the connection etc...).
Grauhut suggested the Alfa Awus036neh.
(snip)
Does the Alfa Awus036neh works without an powered USB hub, plugged directly to the Pi?
If not which wifi adapter do you suggest which is stronger than the RT5370 but doesn't need a powered USB hub?
Although I haven't done any serious load-testing, I've found that my Pi becomes unstable after a while when not using a powered hub for the wifi dongle. The newer Pi's that don't have the 140ma fuses might be able to run without it, though.
2. Has anyone tested to enable 802.11n support (ieee80211n)?
If yes which adapters work with 802.11n (and is their one which doesn't need a powered USB hub)?
I haven't yet, I'll let you know if I do.
Tickle wrote:Sorry for not digging through this post but what USB Dongle are people using with "Access Point"?
It seems that most usb WiFi adapters support AP mode, although I've only tested a few personally. I've mainly used Ralink-based USB dongles, they've worked fine for me. I recently bought a couple of these: http://www.amazon.com/gp/product/B004BA ... 00_s00_i00 They have very good range, but should be used with a powered hub for best results.
chirag wrote:my
/etc/network/interfaces file shows like this...
(snip)
with these settings i am getting an hotspot from my pi with the name My_AP but when i try to connect to the network it says limited access in windows ..:( i think its not forwarding ip address and i cannot ssh into pi wirelessly....you have any idea why this happening..?? i just want to ssh wirelessy from my pi...!!
It appears that you used a different tutorial since you have dnsmasq installed instead of udhcpd. That shouldn't be a problem, but the easiest way to get it working would be to follow the tutorial here: http://elinux.org/RPI-Wireless-Hotspot. The problem seems to be that you don't have iptables NAT (network address translation) configured, so things connected to your Pi's wifi aren't forwarded to your Ethernet connection.[/quote]

32b6b15bbf7d
Posts: 3
Joined: Wed Jan 16, 2013 1:17 pm

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

Mon Jan 28, 2013 11:21 am

Hey hunternet93,

thanks for the answer!!!

1. Unstable connection
hunternet93 wrote:
32b6b15bbf7d wrote: [...]If not which wifi adapter do you suggest which is stronger than the RT5370 but doesn't need a powered USB hub?
Although I haven't done any serious load-testing, I've found that my Pi becomes unstable after a while when not using a powered hub for the wifi dongle. The newer Pi's that don't have the 140ma fuses might be able to run without it, though.
Okay I wrote that the connection becomes unstable when using more devices... That was rather a guess without too much testing. But now I realized that the connection is also unstable using only 1 device. Every minute I get very bad ping:

Code: Select all

Reply from 10.0.0.1: bytes=32 time=1ms TTL=64
....................
Reply from 10.0.0.1: bytes=32 time=1ms TTL=64
Reply from 10.0.0.1: bytes=32 time=1ms TTL=64
Reply from 10.0.0.1: bytes=32 time=440ms TTL=64
Reply from 10.0.0.1: bytes=32 time=249ms TTL=64
Reply from 10.0.0.1: bytes=32 time=1ms TTL=64
Reply from 10.0.0.1: bytes=32 time=220ms TTL=64
Reply from 10.0.0.1: bytes=32 time=1ms TTL=64
Reply from 10.0.0.1: bytes=32 time=1ms TTL=64
....................
On my laptop it is not really a problem, I don't notice anything while using the internet. But on my Android it seems quite a problem: For instance, Youtube Videos, music etc. load until high ping occurs and then they stop loading... So the video loads 30 seconds then stops and only continues loading when I click play again. Quite annoying.

One guess is that the SD card freezes for a few ms!? Could that be?

2. Wireless N
hunternet93 wrote:
32b6b15bbf7d wrote: 2. Has anyone tested to enable 802.11n support (ieee80211n)?
[...]
I haven't yet, I'll let you know if I do.
I have a Rpi rev2.0, so I found out that a TL-WN721N could work directly connected to the Rpi. And I found that someone managed to enable ieee80211n in hostapd using the TL-WN721N. Not on the Rpi though... but shouldn't be to much of a problem I guess.

Next week I probably have the opportunity to test a TL-WN721N. So I will let you know here.

3. Squid 3
hunternet93 wrote:
dobbers24 wrote:... apply some rules to block inappropriate sites ... simple (i.e. baby steps) set of rules to configure the squid config files and iptables ...
Googling for "Squid tutorial" should get you started, I don't have much experience with it although I'll probably try it out eventually.
You need to google for "transparent proxy squid 3".
Some good examples are:
http://www.tuxgarage.com/2011/01/how-to ... -with.html
http://www.lesismore.co.za/squid3.html

For blocking sites this tutorial is probably a good start:
http://www.labtestproject.com/linnet/sq ... dress.html

gabiX87
Posts: 4
Joined: Sun Feb 03, 2013 1:16 am

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

Sun Feb 03, 2013 11:44 pm

with udhcpd it wasn't working for me, wasn't handing out IP addresses ... I apt-get install dnsmasq instead ... now it WORKS !!!!

Doesn't work !!!!
Bus 001 Device 004: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]

Setting Access Points Using EW-7811Un Wireless Adaptor
http://www.raspberrypi.org/phpBB3/viewt ... 36&t=16849

Does work !!!
http://www.avm.de/en/Produkte/FRITZ_WLA ... /index.php
http://www.wikidevi.com/wiki/AVM_FRITZ!WLAN_USB_Stick_N
Bus 001 Device 004: ID 057c:8401 AVM GmbH Fritz!WLAN N [Atheros AR9001U]

:idea: 8-)

wfp
Posts: 1
Joined: Sun Feb 10, 2013 5:08 pm

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

Sun Feb 10, 2013 5:18 pm

I followed the tutorial and successfully created a hotspot (I can now see my Pi from my iPad). However, on my Pi, I can no longer access the net via my WiFi; if from a shell I try to ping, I get: "ping unknown host ...". Also, from the outside I can no longer get a response when I attempt to ping 192.168.42.1 (and previously I could successfully ping 10.0.1.7). Is it not possible to create a hotspot and continue to connect to the internet via WiFi? Note: I'm a bit of a novice with networking. Thanks in advance.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

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

Sun Feb 10, 2013 6:34 pm

No, that won't work. I tried with two dongles but had no luck either, sadly.

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

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

Sun Feb 10, 2013 7:33 pm

wfp wrote:I followed the tutorial and successfully created a hotspot (I can now see my Pi from my iPad). However, on my Pi, I can no longer access the net via my WiFi; if from a shell I try to ping, I get: "ping unknown host ...". Also, from the outside I can no longer get a response when I attempt to ping 192.168.42.1 (and previously I could successfully ping 10.0.1.7). Is it not possible to create a hotspot and continue to connect to the internet via WiFi? Note: I'm a bit of a novice with networking. Thanks in advance.
Unfortunately, a single WiFi dongle can only be a client (connect to a hotspot) or an access point (acting as a hotspot) at once. It is possible to use 2 USB dongles, one would connect to your main hotspot and the other would create your Pi's hotspot. I've done this before to create a WiFi repeater, it works fairly well. I'd highly recommend a powered USB hub, I had some stability issues when using an unpowered hub.
poing wrote:No, that won't work. I tried with two dongles but had no luck either, sadly.
What did you try? I can add instructions on creating a WiFi repeater if needed, it is possible.

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

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

Sun Feb 10, 2013 8:51 pm

hunternet93 wrote:
poing wrote:No, that won't work. I tried with two dongles but had no luck either, sadly.
What did you try? I can add instructions on creating a WiFi repeater if needed, it is possible.
That would be great!

What I tried was two dongles, one as wlan0 configured with the tool on the desktop and the other as wlan1 as per your tutorial. The problem was that I could not use them together although I could switch between them by starting and stopping hostapd.

What I try to do is create an embedded system that can be handled 'on the road' through an e-reader or phone (hence the AP) and when home connects to the local WiFi hotspot to send accumulated data automatically over the Internet.

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

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

Sun Feb 10, 2013 9:29 pm

poing wrote:
hunternet93 wrote:
poing wrote:No, that won't work. I tried with two dongles but had no luck either, sadly.
What did you try? I can add instructions on creating a WiFi repeater if needed, it is possible.
That would be great!

What I tried was two dongles, one as wlan0 configured with the tool on the desktop and the other as wlan1 as per your tutorial. The problem was that I could not use them together although I could switch between them by starting and stopping hostapd.

What I try to do is create an embedded system that can be handled 'on the road' through an e-reader or phone (hence the AP) and when home connects to the local WiFi hotspot to send accumulated data automatically over the Internet.
Network-Manager (the desktop tool, unless Raspbian uses something else, I'm not sure) is probably messing with various network settings, which is fine in normal cases but causes problems here. For the tutorial, you'll want to disable Network-Manager with the command:

Code: Select all

service network-manager stop
update-rc.d network-manager disable
You can connect to an access point on boot by editing /etc/network/interfaces, Debian has good instructions on how to do that here: http://wiki.debian.org/WiFi/HowToUse#Command_Line (Scroll down a bit to find instructions for connected to a WPA/WPA2 hotspot, if that's what you're doing.)
After that, you can go through the tutorial like normal, replacing "eth0" with "wlan1" (or whichever interface is connected to the internet).

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

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

Mon Feb 11, 2013 8:02 am

poing wrote:
hunternet93 wrote:
poing wrote:No, that won't work. I tried with two dongles but had no luck either, sadly.
What did you try? I can add instructions on creating a WiFi repeater if needed, it is possible.
That would be great!

What I tried was two dongles, one as wlan0 configured with the tool on the desktop and the other as wlan1 as per your tutorial. The problem was that I could not use them together although I could switch between them by starting and stopping hostapd.

What I try to do is create an embedded system that can be handled 'on the road' through an e-reader or phone (hence the AP) and when home connects to the local WiFi hotspot to send accumulated data automatically over the Internet.
I've created a web interface with this sort of use case in mind.
I'll be creating an image with it pre-installed soon but at the moment you can download it off my blog.
The web interface allows you to start/stop the hotspot, as well as allow you to setup the wifi connections that the client will use.
It's not complete yet but sounds like it would suit what you're after though.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

ems573
Posts: 1
Joined: Sun Feb 10, 2013 10:54 pm

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

Mon Feb 11, 2013 10:33 pm

Hey,
So I've tried both your tutorial on the website (http://sirlagz.net/2012/08/09/how-to-us ... er-part-1/) and on the RPi Guides listing, and both times I've gotten the same issue. I can see my wireless network on other devices, but when I try to get onto the raspberry pi's network my device never gets an IP address. I've tried with both udhcpd and dnsmasq, neither of them will hand out an IP address. If I try to start the hostapd service without having udhcpd started I get a "[FAIL]" message, so I start udhcpd first. I have everything configued exactly how it is detailed in the tutorials, so I can't imagine why this is happening. Any and all help would be greatly appreciated.

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

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

Mon Feb 11, 2013 11:13 pm

ems573 wrote:Hey,
So I've tried both your tutorial on the website (http://sirlagz.net/2012/08/09/how-to-us ... er-part-1/) and on the RPi Guides listing, and both times I've gotten the same issue. I can see my wireless network on other devices, but when I try to get onto the raspberry pi's network my device never gets an IP address. I've tried with both udhcpd and dnsmasq, neither of them will hand out an IP address. If I try to start the hostapd service without having udhcpd started I get a "[FAIL]" message, so I start udhcpd first. I have everything configued exactly how it is detailed in the tutorials, so I can't imagine why this is happening. Any and all help would be greatly appreciated.
Can you post the entire error message you're getting? Also, the output of:

Code: Select all

sudo udhcpd -d
(press Ctrl+C to stop udhcpd after running it)

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

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

Tue Feb 12, 2013 12:35 am

hunternet93 wrote:
ems573 wrote:Hey,
So I've tried both your tutorial on the website (http://sirlagz.net/2012/08/09/how-to-us ... er-part-1/) and on the RPi Guides listing, and both times I've gotten the same issue. I can see my wireless network on other devices, but when I try to get onto the raspberry pi's network my device never gets an IP address. I've tried with both udhcpd and dnsmasq, neither of them will hand out an IP address. If I try to start the hostapd service without having udhcpd started I get a "[FAIL]" message, so I start udhcpd first. I have everything configued exactly how it is detailed in the tutorials, so I can't imagine why this is happening. Any and all help would be greatly appreciated.
Can you post the entire error message you're getting? Also, the output of:

Code: Select all

sudo udhcpd -d
(press Ctrl+C to stop udhcpd after running it)
Typo! That should be:

Code: Select all

sudo udhcpd -f

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

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

Tue Feb 12, 2013 8:33 am

does wlan0 have an IP address after you start hostapd ?
If not then that's probably the issue.
You'll need to disable ifplugd for wlan0 as that messes around with things.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

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

Tue Feb 12, 2013 10:16 am

hunternet93 wrote: Network-Manager (the desktop tool, unless Raspbian uses something else, I'm not sure) is probably messing with various network settings, which is fine in normal cases but causes problems here. For the tutorial, you'll want to disable Network-Manager with the command:

Code: Select all

service network-manager stop
update-rc.d network-manager disable
It doesn't use network manager, as it says 'service not found'.
hunternet93 wrote: You can connect to an access point on boot by editing /etc/network/interfaces, Debian has good instructions on how to do that here: http://wiki.debian.org/WiFi/HowToUse#Command_Line (Scroll down a bit to find instructions for connected to a WPA/WPA2 hotspot, if that's what you're doing.)
After that, you can go through the tutorial like normal, replacing "eth0" with "wlan1" (or whichever interface is connected to the internet).
I started with a fresh 2012-12-16-wheezy-raspbian image, plugged in two of these dongles: http://www.ebay.com/itm/180880367847?ss ... 1497.l2649 and then created /etc/network interfaces like this:

Code: Select all

auto lo

iface lo inet loopback
#iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp

wpa-ssid xxxxxxxxxx
wpa-psk xxxxxxxxxxxxxx
I then yanked the Ethernet cable and rebooted, which worked for I had immediate connection trough wlan0.

Then I followed the tutorial as usual, where I replaced 'eth0' by 'wlan0' and 'wlan0' by 'wlan1'. /etc/network interfaces now looks like this:

Code: Select all

auto lo

iface lo inet loopback
#iface eth0 inet dhcp

auto wlan0
iface wlan0 inet dhcp

wpa-ssid xxxxxxxxxx
wpa-psk xxxxxxxxxxxxxx

iface wlan1 inet static
  address 192.168.42.1
  netmask 255.255.255.0

up iptables-restore < /etc/iptables.ipv4.nat
and that works as well, as after a reboot I get two IP addresses, 192.168.1.100 and 192.168.42.1 .

However, the old problem rears its ugly head, as that I can see the AP on my phone but when I try to log in it alternates between 'Verifying' and 'Getting IP address' but never makes the connection :lol:

I get this:

Code: Select all

pi@raspberrypi ~ $ sudo udhcpd -f
udhcpd (v1.20.2) started
udhcpd: max_leases=235 is too big, setting to 19
udhcpd: can't open '/var/lib/misc/udhcpd.leases': No such file or directory

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

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

Tue Feb 12, 2013 10:32 am

SirLagz wrote: I've created a web interface with this sort of use case in mind.
I'll be creating an image with it pre-installed soon but at the moment you can download it off my blog.
The web interface allows you to start/stop the hotspot, as well as allow you to setup the wifi connections that the client will use.
It's not complete yet but sounds like it would suit what you're after though.
I tried it (copied it to my working Coburn Server distro) and I see what you're trying to do, which is great! Although looking at the code it's rather complicated ;) I guess it would be possible to make a hardware button to switch between modes (my personal embedded project is to be used by non-techs BTW, so I think a setup with two dongles may be best as it's completely automatic).

Anyway it doesn't actually work in my setup as I get a lot of error reports, but then I didn't set it up like you said. IMO it would be better to make a 'building block tutorial' starting from the latest official image rather than a specialized distro.

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

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

Tue Feb 12, 2013 2:46 pm

poing wrote:
SirLagz wrote: I've created a web interface with this sort of use case in mind.
I'll be creating an image with it pre-installed soon but at the moment you can download it off my blog.
The web interface allows you to start/stop the hotspot, as well as allow you to setup the wifi connections that the client will use.
It's not complete yet but sounds like it would suit what you're after though.
I tried it (copied it to my working Coburn Server distro) and I see what you're trying to do, which is great! Although looking at the code it's rather complicated ;) I guess it would be possible to make a hardware button to switch between modes (my personal embedded project is to be used by non-techs BTW, so I think a setup with two dongles may be best as it's completely automatic).

Anyway it doesn't actually work in my setup as I get a lot of error reports, but then I didn't set it up like you said. IMO it would be better to make a 'building block tutorial' starting from the latest official image rather than a specialized distro.
Both will be available, special distro for insta-RaspAP, and building block for customising stuff.

Also, if your phone can't connect to the AP, check to make sure that the wifi NICs haven't lost their IP address.
That's happened to me multiple times where it starts off with an IP address but loses it a little bit into when I'm using the AP.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

poing
Posts: 1131
Joined: Thu Mar 08, 2012 3:32 pm

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

Tue Feb 12, 2013 3:14 pm

They still have their IP address (this is on a Model A BTW); some tests as asked earlier in the tutorial when the same happened:

Code: Select all

pi@raspberrypi ~ $ sudo ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

mon.wlan1 Link encap:UNSPEC  HWaddr 00-0F-54-0A-AC-E2-00-00-00-00-00-00-00-00-00-00
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:532 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:135932 (132.7 KiB)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:0f:54:0a:b1:72
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:109 errors:0 dropped:0 overruns:0 frame:0
          TX packets:73 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:19245 (18.7 KiB)  TX bytes:11530 (11.2 KiB)

wlan1     Link encap:Ethernet  HWaddr 00:0f:54:0a:ac:e2
          inet addr:192.168.42.1  Bcast:192.168.42.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Code: Select all

pi@raspberrypi ~ sudo ps ax | grep udhcpd
 2148 ?        Ss     0:00 /usr/sbin/udhcpd -S
 2268 pts/0    S+     0:00 grep --color=auto udhcpd

Code: Select all

pi@raspberrypi ~ $ sudo iptables --list                                         
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

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Return to “Networking and servers”