clients can't connect to hostapd on raspberry pi

17,001

SOLVED! I can connect to the AP now. The problem was wlan0 wasn't up and assigned an IP & subnet mask. It needs to be up before dnsmasq and hostapd starts. I'm running this setup in a script and stupidly had ifconfig wlan0 10.1.1.1 netmask 255.255.255.0 up as the last command instead of the first command before dnsmasq and hostapd.

Hope this helps someone.

Share:
17,001
crashintoty
Author by

crashintoty

Updated on September 18, 2022

Comments

  • crashintoty
    crashintoty over 1 year

    I can't get any device (Win7, Win8 or Android) to connect to my poor man's wireless access point (raspberry pi + rtl8192cu chipset USB adapter (Belkin N300 micro) + hostapd + dnsmasq). After clicking/tapping "Connect" I simply get an error message saying its unable to connect. Assigning a static IP and then connecting is also unsuccessful so its not a IP/DHCP/dnsmasq issue. sudo hostapd -dd /etc/hostapd/hostapd.conf doesn't offer any clues; there's no error messages when clients are trying to connect. /etc/hostapd/hostapd.conf is dead simple with only interface, ssid and channel declared. I'm not doing any bridging, NAT or getting on the Internet with this setup... I just need it to be an access point so I connect to it via a web browser while in the car (my Android doesn't do ad-hoc unfortunately). Here is hostapd's output (that's me terminating the program towards the end):

    random: Trying to read entropy from /dev/random
    Configuration file: /etc/hostapd/hostapd.conf
    drv->ifindex=3
    l2_sock_recv==l2_sock_xmit=0x0x1f85648
    BSS count 1, BSSID mask 00:00:00:00:00:00 (0 bits)
    Allowed channel: mode=1 chan=1 freq=2412 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=2 freq=2417 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=3 freq=2422 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=4 freq=2427 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=5 freq=2432 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=6 freq=2437 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=7 freq=2442 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=8 freq=2447 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=9 freq=2452 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=10 freq=2457 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=11 freq=2462 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=12 freq=2467 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=13 freq=2472 MHz max_tx_power=0 dBm
    Allowed channel: mode=1 chan=14 freq=2484 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=1 freq=2412 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=2 freq=2417 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=3 freq=2422 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=4 freq=2427 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=5 freq=2432 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=6 freq=2437 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=7 freq=2442 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=8 freq=2447 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=9 freq=2452 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=10 freq=2457 MHz max_tx_power=0 dBm
    Allowed channel: mode=0 chan=11 freq=2462 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=36 freq=5180 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=40 freq=5200 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=44 freq=5220 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=48 freq=5240 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=52 freq=5260 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=56 freq=5280 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=60 freq=5300 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=64 freq=5320 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=100 freq=5500 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=104 freq=5520 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=108 freq=5540 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=112 freq=5560 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=116 freq=5580 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=120 freq=5600 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=124 freq=5620 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=128 freq=5640 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=132 freq=5660 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=136 freq=5680 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=140 freq=5700 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=149 freq=5745 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=153 freq=5765 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=157 freq=5785 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=161 freq=5805 MHz max_tx_power=0 dBm
    Allowed channel: mode=2 chan=165 freq=5825 MHz max_tx_power=0 dBm
    Completing interface initialization
    Mode: IEEE 802.11b  Channel: 1  Frequency: 2412 MHz
    RATE[0] rate=10 flags=0x1
    RATE[1] rate=20 flags=0x1
    RATE[2] rate=55 flags=0x0
    RATE[3] rate=110 flags=0x0
    Flushing old station entries
    Deauthenticate all stations
    +rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2
    rtl871x_set_key_ops
    rtl871x_set_key_ops
    rtl871x_set_key_ops
    rtl871x_set_key_ops
    Using interface wlan0 with hwaddr 08:86:3b:f3:af:38 and ssid 'raspido'
    rtl871x_set_wps_assoc_resp_ie
    rtl871x_set_wps_beacon_ie
    rtl871x_set_wps_probe_resp_ie
    rtl871x_set_beacon_ops
    rtl871x_set_hidden_ssid ignore_broadcast_ssid:0, raspido,7
    rtl871x_set_acl
    wlan0: Setup of interface done.
    random: Got 20/20 bytes from /dev/random
    Wireless event: cmd=0x8b15 len=20
    Wireless event: cmd=0x8b15 len=20
    Wireless event: cmd=0x8b19 len=8
    Wireless event: cmd=0x8b19 len=8
    Wireless event: cmd=0x8b19 len=8
    Wireless event: cmd=0x8b19 len=8
    Wireless event: cmd=0x8b19 len=8
    Wireless event: cmd=0x8b19 len=8
    Wireless event: cmd=0x8b19 len=8
    Wireless event: cmd=0x8b19 len=8
    Wireless event: cmd=0x8b19 len=8
    Wireless event: cmd=0x8b19 len=8
    Signal 2 received - terminating
    Flushing old station entries
    Deauthenticate all stations
    +rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2
    ELOOP: remaining socket: sock=6 eloop_data=0x1f856b8 user_data=(nil) handler=0x2a000
    

    Any ideas?

    • crashintoty
      crashintoty about 10 years
      So I made a little progress troubleshooting this - wlan0 wasn't up and assigned an IP & subnet mask. I can connect to the AP now, but dnsmasq is not giving me an IP address (I get limited connectivity notification). Assigning a client a static IP doesn't help - can't ping the access point. Any ideas?
    • crashintoty
      crashintoty about 10 years
      I guess the title/original problem has been resolved so I will mark it as so.