smeloh
Posts: 18
Joined: Tue Oct 15, 2013 6:23 pm

Wifi captive portal on Raspbian

Tue Oct 15, 2013 6:28 pm

Hi everybody

I would like to make this : http://blog.tonybox.net/blog/2013/03/31 ... ve-portal/

So i just followed the tutorial... However this tutorial doesn't work for me. I got an error with Hostapd when i ran it. I though it was because i used this wifi dongle : http://www.adafruit.com/products/814 which needs some conf that i have not done.

In order to correctly conf my dongle i followed this tutorial : http://learn.adafruit.com/setting-up-a- ... youll-need but the wifi doesn't want to connect (connecting...).

Anyone knows why ? Or anyone can tell me where i make a mistake ?

I'm a beginner on Linux and Raspberry, so be cool ;)

Thanks and regards
Smeloh

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

Re: Wifi captive portal on Raspbian

Wed Oct 16, 2013 7:45 am

How does the wifi not want to connect ?
What device are you connecting from ?
What distribution are you using ?
Have you tried to restart the dhcp server and hostapd ?
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

smeloh
Posts: 18
Joined: Tue Oct 15, 2013 6:23 pm

Re: Wifi captive portal on Raspbian

Wed Oct 16, 2013 8:12 am

Hello SirLagz,

Thanks for your answer.
How does the wifi not want to connect ?
What device are you connecting from ?
What distribution are you using ?
Have you tried to restart the dhcp server and hostapd ?
1) If i just follow this tutorial http://learn.adafruit.com/setting-up-a- ... youll-need i get a pretty good access point which is OK. But when i add :

Code: Select all

sudo apt-get install dnsmasq nginx
With dnsmasq.conf :

Code: Select all

# ...
interface=wlan1
# ...
dhcp-range=10.1.0.50,10.1.0.200,12h
# ...
address=/#/10.1.0.1
# ...
And I run :

Code: Select all

/etc/init.d/hostapd start
ifconfig wlan0 10.1.0.1
/etc/init.d/nginx start
/etc/init.d/dnsmasq start
iptables -t nat -A PREROUTING -s 10.1.0.1/24 -p tcp -j DNAT --to-destination 10.1.0.1
I get an error at the start of Hostapd...

2) I'm connecting my cellphone Android on the wifi access point of the Rpi
3) I'm using Debian Wheezy distro
4) Yes i tried DHCP-server Restart but i got a fail

Smeloh

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

Re: Wifi captive portal on Raspbian

Wed Oct 16, 2013 8:17 am

What errors do you get when you restart dnsmasq ? and what erros when you start hostapd ?
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

smeloh
Posts: 18
Joined: Tue Oct 15, 2013 6:23 pm

Re: Wifi captive portal on Raspbian

Thu Oct 17, 2013 9:20 am

Hello

I've reset my SD card with a clean new Debian Wheezy. At time, i've just followed this tutorial : http://blog.tonybox.net/blog/2013/03/31 ... ve-portal/ and i get this error :

Code: Select all

[email protected] ~ $ sudo /etc/init.d/hostapd start
[....] Starting advanced IEEE 802.11 management: hostapdSegmentation fault
 failed!
All the others run are ok :

Code: Select all

[email protected] ~ $ sudo ifconfig wlan0 10.1.0.1
[email protected] ~ $ sudo /etc/init.d/nginx start
Starting nginx: nginx.
[email protected] ~ $ sudo /etc/init.d/dnsmasq start
[ ok ] Starting DNS forwarder and DHCP server: dnsmasq[....] (already running).
[email protected] ~ $ 
Thx

smeloh
Posts: 18
Joined: Tue Oct 15, 2013 6:23 pm

Re: Wifi captive portal on Raspbian

Thu Oct 17, 2013 10:17 am

Small upadate, i've followed this tutorial to run Hostapd :
Update hostapd
Before we can run the access point software, we have to update it to a version that supports the WiFi adapter.
First get the new version by typing in
wget http://www.adafruit.com/downloads/adafruit_hostapd.zip
to download the new version (check the next section for how to compile your own updated hostapd) then
unzip adafruit_hostapd.zip
to uncompress it. Move the old version out of the way with
sudo mv /usr/sbin/hostapd /usr/sbin/hostapd.ORIG
And move the new version back with
sudo mv hostapd /usr/sbin
set it up so its valid to run with
sudo chmod 755 /usr/sbin/hostapd
That works !

But now, when i want to connec my Mac to the hostpot i get this error message :
Could not join XXXXX : A connection timeout occurred.

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

Re: Wifi captive portal on Raspbian

Sat Oct 19, 2013 7:12 am

What IP address does the Pi have when your Mac is trying to connect ?
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

Return to “Beginners”