Dear readers,
I have problems to get my hostapd up and running with an external wifi adapter as described below.
Any help to solve the problem is more then welcome.
With many thanks in advance,
wimduk
The problem
- I installed and configured hostapd on my Raspberry 3B+ and every thing worked as aspected.
- The wifi range was not suitable for me, so I connected a long range wifi adapter Alfa AWUS036NHR, chipset RTL8188RU
- Updated hostapd.conf : interface=wlan0 → interface=wlan1 → rebooted the system
- hostapd does not work properly
4.1 selecting wifi network and password : → OK
4.2 the obtaining IP process : → remain in a loop. - systemctl status hostapd gives wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE (see below)
Actions and commands
sudo lsusb (subset)
Bus 001 Device 004: ID 0bda:817f Realtek Semiconductor Corp. RTL8188RU 802.11n WLAN Adapter : Alfa long range adapter
Bus 001 Device 006: ID 0781:5591 SanDisk Corp. Ultra Flair : Dietpi OS + 45GB Data (USB-stick)
Bus 001 Device 005: ID 248a:8367 Maxxter Telink Wireless Receiver : Onboard wifi chip
ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
4: wlan1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000 link/ether 00:c0:ca:6b:1d:0b brd ff:ff:ff:ff:ff:ff
ip a show up
wlan1: did NOT show up, I changed /etc/hostapd/hostapd.conf: interface=wlan0 –> wlan1
ip a show up (just wlan)
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
link/ether b8:27:eb:08:69:c4 brd ff:ff:ff:ff:ff:ff
inet 192.168.42.1/24 brd 192.168.42.255 scope global wlan0
valid_lft forever preferred_lft forever
4: wlan1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 00:c0:ca:6b:1d:0b brd ff:ff:ff:ff:ff:ff
inet6 fe80::2c0:caff:fe6b:1d0b/64 scope link
valid_lft forever preferred_lft forever
Remarks wlan1
1. In the wlan1 entry does not contain a IP address, but inet6 fe80::2c0:caff:fe6b:1d0b/64 scope link
2. If I connect to the hotspot the message “obtain IP address” continuously.
systemctl status hostapd
Found in Dietpi database https://dietpi.com/forum/t/wifi-hotspot/3014/13 and executed systemctl status hostapd
● hostapd.service - Access point and authentication server for Wi-Fi and Ethernet
Loaded: loaded (/lib/systemd/system/hostapd.service; enabled; preset: enabled)
Active: active (running) since Thu 2024-07-18 09:30:43 CEST; 1min 12s ago
Docs: man:hostapd(8)
Process: 682 ExecStart=/usr/sbin/hostapd -B -P /run/hostapd.pid $DAEMON_OPTS ${DAEMON_CONF} (code=exited, status=0/SUCCESS)
Main PID: 723 (hostapd)
Tasks: 1 (limit: 779)
CPU: 567ms
CGroup: /system. Slice/hostapd.service
└─723 /usr/sbin/hostapd -B -P /run/hostapd.pid /etc/hostapd/hostapd.conf
jul 18 09:30:40 rasp3b systemd[1]: Starting hostapd.service - Access point and authentication server for Wi-Fi and Ethernet...
jul 18 09:30:43 rasp3b hostapd[682]: wlan1: interface state UNINITIALIZED->COUNTRY_UPDATE
jul 18 09:30:43 rasp3b systemd[1]: Started hostapd.service - Access point and authentication server for Wi-Fi and Ethernet.
Required Information
cat /boot/dietpi/.version : G_LIVE_PATCH_STATUS[0]='not applicable'
echo $G_DISTRO_NAME $G_RASPBIAN : bookworm 0
uname --all : Linux rasp3b 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr 3 17:24:16 BST 2023 aarch64 GNU/Linux
dpkg --print-architecture : arm64
echo $G_HW_MODEL_NAME :RPi 3 Model B+ (aarch64)