I'm trying to set up my Raspberry Pi2 as an access point. hostapd and isc-dhcp-server run without any errors. I see the network, but I can't connect with any device, it just times out or tells me it can't connect.

And the strange thing is, I don't see ANY activity of the DHCP server in the syslog of the Pi, so I'm not sure if the hostapd or the dhcp-server is causing the error. Can anyone help me?

output ifconfig:

eth0      Link encap:Ethernet  HWaddr b8:27:eb:38:f4:25
          inet addr:192.168.8.55  Bcast:192.168.8.255  Mask:255.255.255.0
          inet6 addr: fe80::ba27:ebff:fe38:f425/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1646 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3974 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:113231 (110.5 KiB)  TX bytes:4730604 (4.5 MiB)

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:12 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:720 (720.0 B)  TX bytes:720 (720.0 B)

wlan0     Link encap:Ethernet  HWaddr 74:da:38:35:86:51
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::76da:38ff:fe35:8651/64 Scope:Link
          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:7 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

hostapd.conf:

interface=wlan0
driver=rtl871xdrv
ssid=NAME
hw_mode=g
channel=6
macaddr_acl=0
auth_algs=3
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=PASSWORD
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
rsn_pairwise=CCMP

dhcpd.conf:

default-lease-time 600;
max-lease-time 7200;
authoritative;

subnet 192.168.1.0 netmask 255.255.255.0 {
  range 192.168.1.2 192.168.1.200;
  option domain-name-servers 8.8.8.8;
  option domain-name "local";
  option routers 192.168.1.1;
  option broadcast-address 192.168.1.255;
  default-lease-time 600;
  max-lease-time 7200;
}
  • My hostapd.conf containts wpa_pairwise=TKIP and it's working well. This doesn't explain why it's not working, but it might be worth a shot. Are the devices associating with the AP but simply not getting an IP address, or not associating at all? – bobstro Sep 24 '15 at 17:05
  • @bobstro: tried that too, didn't change anything....I don't know what you mean with "associating", Windows Vista tells me "could not connect", same does Android, and thats all I have here to test it.... – mischa.mole Sep 24 '15 at 17:52
  • I really don't know how to find out if the problem is the access point itself (hostapd) or just the dhcp... – mischa.mole Sep 24 '15 at 17:52
  • There are 2 steps to connecting via wifi: 1. Associating to the AP, 2. Getting IP address via DHCP. If you can complete step 1 (how to verify varies by connecting device) but not 2, it's a DHCP server problem. If you can't complete step 1, its a hostapd problem. Try this: Stop the hostapd server with sudo stop service hostapd, then run it with verbose debug output sudo hostapd -d /etc/hostapd/hostapd.conf (correcting for wherever your hostapd.conf actually lives). You should see a lot of diagnostic messages which may show whether your device is associating. What wifi adapter are you using? – bobstro Sep 24 '15 at 18:10
up vote 3 down vote accepted

Same thing happened to me. I came to the conclusion that the dhcp-server was causing the problem. I solved it by using hostapd and dnsmasq instead of hostapd and isc-dhcp-server according to this site. http://blog.claytonn.com/raspberry-pi-creating-access-point/

Cheers,

Try to use trivial hostapd config without security.

interface=wlan0
ssid=Raspberry_Free
hw_mode=g
channel=6
auth_algs=1
wmm_enabled=0

Then try to check isc-dhcp-server log if it process any dhcp requests.

had this problem today youtube and google would not connect, finally noticed that chromium has allowed an ap extension to be installed called ublock it appears as an icon on the the right side of the screen where the lighning bold appears on occasion. I removed the extension and all was good I can now connect to my hotspot successfully.

Haleyja

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.