Esp32S3 - WIFI Access Point + Station Mode example => Possible to start/stop AP and start/stop STA separately ?

ThomasESP32
Posts: 281
Joined: Thu Jul 14, 2022 5:15 am

Esp32S3 - WIFI Access Point + Station Mode example => Possible to start/stop AP and start/stop STA separately ?

Postby ThomasESP32 » Mon Mar 23, 2026 4:22 pm

Good afternoon,

I am looking at the WIFI STA_AP example program for Esp32S3.
I am reading the main program and I wonder how to start/stop Wifi as a station and start/stop WIFI as an access point separately ?

My goal would be to write a program working as a Station when the program start.
Then when a user choose to start the access point, then stop the access point, the access point mode would be controled by user action.
Do you think it is possible and how to do it ?
This question because in the example :

1) The wifi is initialised : ESP_ERROR_CHECK(esp_wifi_init(&cfg));
2) The mode is set to APSTA : ESP_ERROR_CHECK(esp_wifi_set_mode(WIFI_MODE_APSTA));
3) The access point is initialisation : esp_netif_t *esp_netif_ap = wifi_init_softap();
4) The station is initialised : esp_netif_t *esp_netif_sta = wifi_init_sta();
5) The WIFI is started : ESP_ERROR_CHECK(esp_wifi_start() );

In my program I need to init the station, then start the wifi. => My Esp32S3 shall connect to an external access point.
On user action, I need to start stop the Access Point (The WIFI is already started) => Is it possible ?

Thank you for your help on the subject.
Best regards,

Thomas TRUILHE

nopnop2002
Posts: 347
Joined: Thu Oct 03, 2019 10:52 pm
Contact:

Re: Esp32S3 - WIFI Access Point + Station Mode example => Possible to start/stop AP and start/stop STA separately ?

Postby nopnop2002 » Wed Mar 25, 2026 1:19 pm

This isn't a complete answer, but here's a sample demonstrating how to start, stop, and restart STA mode.

Use this as a basis to try out code to start, stop, and restart AP mode.

https://github.com/nopnop2002/esp-idf-s ... ess-points

Who is online

Users browsing this forum: Bytespider, ChatGPT-User, Semrush [Bot] and 11 guests