Hi @rikins ,
In the thread, we should just discuss the issue on unstable uAP connections after loading driver and starting hostapd.
>>Occasionally, it takes a long time to establish a connection.
(1) if you loading driver & starting hostapd manully, Does the issue still exist?
(2) About multiple service on linux platform.
You know, on linux platform, the following service can also manager network
--Networkmanager service
--connmand service
--iwd service
--wpa_supplicant service
--hostapd service
If you are using wpa_supplicant & hostapd, other service should be stopped, otherwise there exist interfere with each other.
>>In some cases, the board must be rebooted to restore functionality.
No need to do this. if you can write a script to do this. share an example I am using, you can change it according to you platform:
file name is : enable-ap.sh
---------------------
#! /bin/bash
insmod /home/root/bin_mxm/mlan.ko
insmod /home/root/bin_mxm/moal.ko mod_para=nxp/wifi_mod_para.conf
for (( i = 1; i <= 10; i++ ))
do
ifconfig -a 2>&1 | grep -E "(mlan0|uap0|wfd0|mmlan0|muap0|mwfd0)" > /dev/null
if [ $? -eq 0 ]; then
break
fi
sleep 1
done
echo "enable uap0 and add gateway"
ifconfig uap0 192.168.6.2 netmask 255.255.255.0 up
route add default gw 192.168.6.1
echo "starting hostapd service for uap0"
hostapd /etc/hostapd-uap0-5g.conf -B
echo "starting udhcpd service for uap0"
udhcpd -S /etc/udhcpd-uap0.conf -f &
sleep 1
echo "enable muap0 and add gatewy"
ifconfig muap0 192.168.5.2 netmask 255.255.255.0 up
route add default gw 192.168.5.1
echo "startig hosapd service for muap0"
hostapd /etc/hostapd-muap0-2g.conf -B
echo "starting udhcpd service for muap0"
udhcpd -S /etc/udhcpd-muap0.conf -f &
---------------------
You can disable or enable some services in the script .
[Additional]
To enable uAP and connect client to the uAP, these steps are needed:
-- Loading wifi driver
-- starting hosapd based on hostapd.conf
-- starting udhcpd based on udhcpd.conf
-- Client device connects the uAP
Here is the content of udhcpd.conf , as an example ,share it with you.
==================
start 192.168.6.10
end 192.168.6.20
interface uap0 #default: eth0
max_leases 11 #default: 254
remaining yes #default: yes
auto_time 7200 #default: 7200 (2 hours)
decline_time 3600 #default: 3600 (1 hour)
conflict_time 3600 #default: 3600 (1 hour)
offer_time 60 #default: 60 (1 minute)
min_lease 60 #defult: 60
lease_file /etc/udhcpd.leases
opt dns 192.168.0.1 165.114.52.147 165.114.89.4 #DNS server IP address
option subnet 255.255.255.0
opt router 192.168.6.1 # uap ip address
option domain local
option lease 864000
==================
Then create udhcpd.leases file
# touch /etc/udhcpd.leases
After starting hostapd and give uap0 an IP address, start udhcpd sevice like below:
# udhcpd -S /etc/udhcpd.conf -f &
The client can get IP from the uAP.
Thanks!
Regards,
weidong