ap-hotspot works but nothing can connect

I have been searching forever regarding this issue, and I'm not finding anyone with my unique circumstances. I'm trying to set up a wifi hotspot using Ubuntu. I was able to do this via Windows 7, however my laptop doesn't have Win7, so I'm trying to create the same setup on my laptop.

The adapter I am using is an ALFA AWUS036NHR V.2. As far as I can tell the drivers are pre-installed in Ubuntu, as it is able to connect to networks.

I set up the ap-hotspot per various instructions around the web.

I am using the command

sudo ap-hotspot config

sudo ap-hotspot start

All of my devices can see the network, however the android gets an authentication error, the iphone keeps getting "wrong passcode" and the raspberry pi is going in a "4 way handshake (station)" disconnect/reconnect loop.

When I went through this excercise on Windows 7, I had to manually force the adapter to use different drivers until I found one that worked as a hotspot. I'm concerned this may be the issue here as well, however I can't even get my system to install the drivers from the alfa.com.tw website. I am using a fresh Ubuntu 12.04 install on an HP Elitebook 8530 laptop. Below is the output of ap-hotspot debug

sudo ap-hotspot debug
Starting Wireless Hotspot...
* Stopping DNS forwarder and DHCP server dnsmasq
* (not running)
update-rc.d: warning: hostapd start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: hostapd stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)
Disabling system startup links for /etc/init.d/hostapd ...
Removing any system startup links for /etc/init.d/hostapd ...
/etc/rc0.d/K20hostapd
/etc/rc1.d/K20hostapd
/etc/rc2.d/K80hostapd
/etc/rc3.d/K80hostapd
/etc/rc4.d/K80hostapd
/etc/rc5.d/K80hostapd
/etc/rc6.d/K20hostapd
Adding system startup for /etc/init.d/hostapd ...
/etc/rc0.d/K20hostapd -> ../init.d/hostapd
/etc/rc1.d/K20hostapd -> ../init.d/hostapd
/etc/rc6.d/K20hostapd -> ../init.d/hostapd
/etc/rc2.d/K80hostapd -> ../init.d/hostapd
/etc/rc3.d/K80hostapd -> ../init.d/hostapd
/etc/rc4.d/K80hostapd -> ../init.d/hostapd
/etc/rc5.d/K80hostapd -> ../init.d/hostapd
update-rc.d: warning: dnsmasq start runlevel arguments (none) do not match LSB Default-Start values (2 3 4 5)
update-rc.d: warning: dnsmasq stop runlevel arguments (none) do not match LSB Default-Stop values (0 1 6)
Disabling system startup links for /etc/init.d/dnsmasq ...
Removing any system startup links for /etc/init.d/dnsmasq ...
/etc/rc0.d/K85dnsmasq
/etc/rc1.d/K85dnsmasq
/etc/rc2.d/K85dnsmasq
/etc/rc3.d/K85dnsmasq
/etc/rc4.d/K85dnsmasq
/etc/rc5.d/K85dnsmasq
/etc/rc6.d/K85dnsmasq
Adding system startup for /etc/init.d/dnsmasq ...
/etc/rc0.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc1.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc6.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc2.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc3.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc4.d/K85dnsmasq -> ../init.d/dnsmasq
/etc/rc5.d/K85dnsmasq -> ../init.d/dnsmasq
* Restarting DNS forwarder and DHCP server configuration syntax check
...fail!
net.ipv4.ip_forward = 1
Wireless Hotspot active

I'm fairly new at this so I'm not sure what is wrong, but it appears to be very many things. Please let me know if there's any further information needed.


Solution 1:

Short answer: you probably have another instance of dnsmasq running. So kill all instances :

Edit 1 (thx to Andrea):

$ sudo killall dnsmasq

Original answer:

$ sudo netstat -taunp | grep -w LISTEN | grep dnsmasq | awk '{print $7}' | sed -r "s/([0-9]+).*/\1/" | xargs kill -9

and try to start the hotspot again :

$ sudo ap-hotspot debug

Starting Wireless Hotspot...
* Stopping DNS forwarder and DHCP server dnsmasq
* (not running)

[...]

* Restarting DNS forwarder and DHCP server dnsmasq
...done.
net.ipv4.ip_forward = 1
Wireless Hotspot active