cancel
Showing results for 
Search instead for 
Did you mean: 

Unable to connect to AP using the hotstap service

obedPH
Associate III

Hi,

I am compiling a yocto custom layer, I am using this layers

poky/meta-poky \
poky/meta-yocto-bsp \
meta-openembedded/meta-oe \
meta-openembedded/meta-python \
meta-st-stm32mp \
custom-image \

I was able to connect the LBEE5KL1DX Murata module to wifi via STA, however, I would like to use switch to the AP mode, I followed the steps in the post https://wiki.stmicroelectronics.cn/stm32mpu/wiki/How_to_configure_a_WLAN_interface_on_hotspot_mode

 

After that, i am able to see the AP when I look in a smartphone, but after logging with the password configured, I see the message "IP configuration failure " on my smartphone.

One thing I see suspicious is the inet when i run the command "ifconfig"

Screenshot from 2023-08-23 17-37-40.png

Another thing i see weird is when i run the "networkctl status wlan0" command, specifically the Network File variable

 

Screenshot from 2023-08-23 17-40-13.png

I also tried executing the bash script from a repository and it didn't work either https://github.com/STMicroelectronics/meta-st-openstlinux/blob/dunfell/recipes-samples/hotspot-wifi/files/st-hotspot-wifi-service.sh

 

Any help is very appreciated, thank you,

ObedPH

5 REPLIES 5
Olivier GALLIEN
ST Employee

Hi @obedPH ,

Could you please explains you full setup by what you call AP ? 

eg is it like : Smartphone (hotpost wifi) < wlan > MP15 <eth> PC or something else ? 

Please also confirm the ecosystem you are using and provide content of /lib/systemd/network/51-wireless.network  and /lib/systemd/network/80-wired.network

Thanks 

Olivier 

Olivier GALLIEN
In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.
obedPH
Associate III

Hello @Olivier GALLIEN,

Thank you for your response and willingness to assist. I'd like to provide you with more details about my setup and the issue I'm experiencing:

  1. Configuration: I am attempting to connect other devices, such as my smartphone and PC, wirelessly to a Wi-Fi network generated by the STM32MP157F-DK2. My current setup looks like this:

    • Smartphone (Wi-Fi hotspot) <-> [Wireless Connection] <-> STM32MP157F-DK2 (Access Point). I want just to be able to connect to the Access Point, since I want to open a webserver, and then, in the webserver in certain port, I want to write the SSID and PASSWORD credentials of another Wifi network (this network has the internet connection), basically, I want to setup my wifi credentials in a webserver, that's why I need my STMPU working as an Access Point.
  2. Access Point (AP): I am configuring the STM32MP157F-DK2 to function as an Access Point, allowing other devices to connect to it wirelessly.

  3. Environment: I am using yocto with the 5.15.67 kernel version in my development environment.

  4. This is the content of my /lib/systemd/network/51-wireless.networkobedPH_0-1693935610318.png
  5. This is the content of my /lib/systemd/network/80-wired.network obedPH_1-1693935688706.png

    Thank you very much, regards

Hi,

Were you able to achieve your goal of setting up the STM32MP157F-DK2 as an access point to configure Wi-Fi credentials via a web server? If so, could you share the steps you followed? I'm working on a similar setup and would greatly appreciate your guidance.

My goal is to:

1. Set up the STM32MP157F-DK2 in access point mode.

2. Serve a web page (on a specific port) where users can input SSID and password credentials for another Wi-Fi network with internet access.

3. Use the entered credentials to connect the STM32MP157F-DK2 to the target Wi-Fi network.

obedPH
Associate III

Hello @shreyaschandran ,

I am sorry for the late response.

I am not working with the DK2 anymore, since I did a custom development with a STM32MP153 processor and I am using a LBEE5KL1YN-814, a different module to the one the DK2 is using.

I had to add additional drivers binaries and binaries for that module, but you won't have that issue in the DK2.

I was able to use both modes, following th enext steps:
- Configure the /lib/systemd/network/51-wireless.network:

 [Match]
 Name=wlan0
 [Network]
 DHCP=ipv4

- Configure the /etc/wpa_supplicant/wpa_supplicant-wlan0.conf

ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1

- Configure the /lib/systemd/network/hostapd.conf

interface=wlan1
driver=nl80211
# mode Wi-Fi (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g)
hw_mode=g
ssid=STM32MP157F-DK2 #This is the password for the wifi network we create
channel=7
wmm_enabled=0
macaddr_acl=0
# Wi-Fi closed, need an authentication
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=stm32mp1  #This is the password for the wifi network we create
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

- Configure the /etc/dnsmasq.conf (if you don't have this file, you need to add the dnsmasq service to your image)

interface=wlan1 # Listening interface                                                                                                                                              
listen-address=192.168.4.1                                                                                                                                                         
server=8.8.8.8                                                                                                                                                                     
dhcp-range=192.168.4.2,192.168.4.20,255.255.255.0,24h                                                                                                                              
                # Pool of IP addresses served via DHCP                                                                                                                                                                                                                                                                 
domain=config                                                                                                                                                                      
address=/domain.config/192.168.4.1                                                                                                                                                  
                # Alias for this router 

- Configure the /etc/dhcpcd.conf

interface wlan1
    static ip_address=192.168.4.1/24
    nohook wpa_supplicant

 

 

 

After you made all this configuration, you must restart all the services that you configured (or you can restart the DK2).

Finally, when all the changes were done, you must run the following commands

/usr/sbin/iw dev wlan0 interface add wlan1 type __ap
/sbin/ip link set wlan1 up
hostapd /etc/hostapd.conf -P /run/hostapd.pid -B

 

 

Let me know if this work,

Regards

Hello @obedPH,

I was able to set this up successfully. Thank you for your response and guidance!