Closed GiovanniBalestrieri closed 3 months ago
hostapd.service is not used.
It is hostapd@wlan0.service and hostapd@wlan1.service.
They should already be enabled and started.
The fact there is no wlan0 and wlan1, this may be caused by using an incompatible uart cable.
See
https://forum.banana-pi.org/t/bpi-r3-failed-to-start-wa-firmware/17025
If this is not the problem, please post dmesg output.
I'll attempt to isolate the issue by SSHing into the device over the wired network to see if the problem still occurs.
Great news—I can now see the wlan0 interface, and the wireless network WIFI24 is available. However, I’m still encountering issues as I’m unable to connect to the network.
To debug the problem, I checked the status of the hostapd@wlan0.service:
[userk@bpir3 ~]$ sudo systemctl status hostapd@wlan0.service
● hostapd@wlan0.service - Access point and authentication server for Wi-Fi and Ethernet (wlan0)
Loaded: loaded (/etc/systemd/system/hostapd@.service; enabled; preset: disabled)
Active: active (running) since Sat 2024-08-17 00:40:27 CEST; 39s ago
Process: 2863 ExecStart=/usr/bin/hostapd-launch --pidfile /run/hostapd.wlan0.pid --device wlan0 (code=exited, status=0/SUCCESS)
Main PID: 2900 (hostapd)
Tasks: 1 (limit: 2327)
Memory: 3.2M (peak: 5.2M)
CPU: 235ms
CGroup: /system.slice/system-hostapd.slice/hostapd@wlan0.service
└─2900 /usr/sbin/hostapd -B -P /run/hostapd.wlan0.pid /run/hostapdconf/wlan0.conf
Aug 17 00:40:26 bpir3 systemd[1]: Starting Access point and authentication server for Wi-Fi and Ethernet (wlan0)...
Aug 17 00:40:26 bpir3 hostapd-launch[2863]: Running: /usr/sbin/hostapd -B -P /run/hostapd.wlan0.pid /run/hostapdconf/wlan0.conf
Aug 17 00:40:26 bpir3 hostapd-launch[2872]: wlan0: interface state UNINITIALIZED->COUNTRY_UPDATE
Aug 17 00:40:26 bpir3 hostapd-launch[2863]: wlan0 brlan
Aug 17 00:40:27 bpir3 systemd[1]: Started Access point and authentication server for Wi-Fi and Ethernet (wlan0).
To troubleshoot further, I tried stopping the service:
sudo systemctl stop hostapd@wlan0.service
And then manually starting hostapd, but I encountered another error:
[userk@bpir3 ~]$ sudo hostapd -dd /etc/hostapd/wlan0.conf
random: Trying to read entropy from /dev/random
Configuration file: /etc/hostapd/wlan0.conf
Line 26: Invalid mobility_domain '$(echo $ssid | md5sum | cut -c1-4)'
1 errors found in configuration file '/etc/hostapd/wlan0.conf'
Failed to set up interface with /etc/hostapd/wlan0.conf
hostapd_init: free iface 0xaaaad3a9b220
Failed to initialize interface
I then tried commenting out that line, and the hostapd service started, but I still cannot connect to the network.
Could you advise on how to resolve this or suggest any additional debugging steps?
Thanks in advance for your help!
The service I have setup with a helper script, so that the config can contain strings that are expanded through bash.
You can find the expanded config in /run/hostapdconf/. So feed this one when directly running hostapd.
/usr/sbin/hostapd -P /run/hostapd.pid /run/hostapdconf/wlan1.conf
or comment all lines containing $()
We experienced problems with 5ghz wlan1. It seems (almost) fixed when restarting the
systemctl restart hostapd@wlan1.service
But recently I did not reproduce the problem. Also sadly do not have enough time for it.
Also check the bpi forum at the armlinuxarm script for R3
Also can use the command:
iw dev
And it shows the state the interface is in. Useful here is the amount of db, which could be limited by country settings. Also it should state the ssid (wifi network name). I experienced a few times, it was not shown and a restart was needed.
The service I have setup with a helper script, so that the config can contain strings that are expanded through bash.
You can find the expanded config in /run/hostapdconf/. So feed this one when directly running hostapd
/usr/sbin/hostapd -P /run/hostapd.pid /run/hostapdconf/wlan1.conf
or comment all lines containing $()
We experienced problems with 5ghz wlan1. It seems (almost) fixed when restarting the
systemctl restart hostapd@wlan1.service
But recently I did not reproduce the problem. Also sadly do not have enough time for it.
Also check the bpi forum at the armlinuxarm script for R3
I also noticed you are using AP network setup. This setup requires that the R3 is connected to your router with a lan-lan connection. This means the subnet of R3 should also be the same as your router's lan network (first 3 numbers of ip). Since the AP and router are bridged, the wifi client should get an ip number from your router's dhcp server.
If something goes wrong here, your clients will not connect to the internet. If you do not like this setup, then choose RouTer setup for the R3.
I have just added more info about router and accesspoint setup to the readme.
Problem Solved! I’m happy to report that I can now successfully connect to the wireless network!
Regarding your suggestion:
You can find the expanded config in /run/hostapdconf/. So feed this one when directly running hostapd.
Just to ensure that I fully understand the configuration setup, I couldn't find any settings files related to the wireless interfaces in the /etc/systemd/network/ directory. Based on this, I’m assuming that the wireless interfaces are managed directly by hostapd, while systemd-networkd is responsible for handling only the wired and bridge configurations. Is that correct?
That is correct
I recently installed the minimal Arch Linux OS using the AP mode of the image. Based on my understanding, the Access Point should work out of the box, but I’ve encountered some issues.
Problems Encountered:
Details:
Journalctl Output:
Output of ip link show:
Request:
Could you please guide me on how to resolve these issues? Specifically:
Any help or guidance would be greatly appreciated. Thank you for your continued work on this project.