2

I have a problem with wifi access point on Raspberry 3B+.

/etc/hostapd/hostapd.conf:

interface=wlan0
driver=nl80211
ssid=Rpi_ap
hw_mode=g
channel=7
ieee80211n=1
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=1234567890
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
logger_syslog=-1
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]

/etc/dnsmasq.conf

interface=wlan0
dhcp-range=192.168.5.100,192.168.5.200,255.255.255.0,24h

pi@raspberrypi:~ $ ifconfig wlan0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
    inet 192.168.5.1  netmask 255.255.255.0  broadcast 192.168.5.255
    inet6 fe80::ba27:ebff:fe5c:49c7  prefixlen 64  scopeid 0x20<link>
    ether b8:27:eb:5c:49:c7  txqueuelen 1000  (Ethernet)
    RX packets 19442  bytes 1854583 (1.7 MiB)
    RX errors 0  dropped 0  overruns 0  frame 0
    TX packets 1101  bytes 146273 (142.8 KiB)
    TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

i do

sudo ifconfig wlan0 192.168.5.1 netmask 255.255.255.0 broadcast 192.168.5.255
sudo systemctl start dnsmasq.service
sudo hostapd -d /etc/hostapd/hostapd.conf

output here https://pastebin.com/EAxFFeA4

As result i have no access point. What i do wrong? What could be the reason?

UPD:

I found a mistake in cat /etc/default/hostapd (thanks @M. Rostami) and fixed it. But acceess point didn't appear.

/etc/default/hostap:

DAEMON_CONF="/etc/hostapd/hostapd.conf"

pi@raspberrypi:~ $ sudo service hostapd status

● hostapd.service - Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator
Loaded: loaded (/lib/systemd/system/hostapd.service; disabled; vendor preset: enabled)
Active: active (running) since Wed 2020-03-11 14:15:29 MSK; 2min 21s ago
Process: 1309 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid -B $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SUCCESS)
Main PID: 1310 (hostapd)
Tasks: 1 (limit: 2200)
Memory: 1.8M
CGroup: /system.slice/hostapd.service
       └─1310 /usr/sbin/hostapd -B -P /run/hostapd.pid -B 
/etc/hostapd/hostapd.conf

мар 11 14:15:29 raspberrypi systemd[1]: Starting Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator...
мар 11 14:15:29 raspberrypi hostapd[1309]: Configuration file: /etc/hostapd/hostapd.conf
мар 11 14:15:29 raspberrypi hostapd[1309]: wlan0: Could not connect to kernel driver
мар 11 14:15:29 raspberrypi hostapd[1309]: Using interface wlan0 with hwaddr b8:27:eb:5c:49:c7 and ssid "Rpi_ap"
мар 11 14:15:29 raspberrypi hostapd[1309]: wlan0: interface state UNINITIALIZED->ENABLED
мар 11 14:15:29 raspberrypi hostapd[1309]: wlan0: AP-ENABLED
мар 11 14:15:29 raspberrypi systemd[1]: Started Advanced IEEE 802.11 AP and IEEE 802.1X/WPA/WPA2/EAP Authenticator.

UPD2:

New data. if I set static ip address for wlan0 in /etc/networks/interfaces and then reboot i have access point after boot. If set static ip address by command "ifconfig wlan0 192.168.5.1 netmask 255.255.255.0 broadcast 192.168.5.255" i have no access point after "sudo systemctl start dnsmasq.service" and "sudo systemctl start hostapd.service".

16
  • Add the output of these commands: cat /etc/default/hostapd - sudo service hostapd status -- Did you follow this procedure? Commented Mar 11, 2020 at 10:14
  • i did follow this procedure exclude routing
    – dzukp
    Commented Mar 11, 2020 at 11:36
  • You may be configured /etc/hostapd/hostapd.conf in a wrong way. Check/Change the channel. Also, check the /etc/hostapd/hostapd.conf on this answer. Commented Mar 11, 2020 at 11:47
  • If you that /etc/default/hostapd configured well, you don't need to run sudo hostapd -d /etc/hostapd/hostapd.conf. Just start hostapd service by sudo service hostapd start / restart. Commented Mar 11, 2020 at 11:49
  • i have new problem. Read topic update pls.
    – dzukp
    Commented Mar 11, 2020 at 12:22

1 Answer 1

2

Try this before running your access point :

sudo kill -9 $(pidof hostapd dnsmasq dhclient wpa_supplicant)

or before your commands try only

echo $(pidof hostapd dnsmasq dhclient wpa_supplicant) 

for showing any already running process able to interfere.

The echo command must return nothing if all is good for starting your AP

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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