I would like to setup a network of ESP32S2's.
The design is:
a) master controller to serve as a WIFI AP (for connection to iphone) as well as WIFI STATION (for ESP_NOW traffic).
b) slave responders as WIFI STATIONS using ESP NOW and WIFI_PROTOCOL_LR.
I can get two ESP32S2's to communicate if both controller and responders are setup as:
esp_wifi_set_mode(WIFI_MODE_STA)
esp_wifi_set_protocol(ESP_IF_WIFI_STA, WIFI_PROTOCOL_LR)
However ... the following only partially works as it does not result in an access point being setup or available.
Controller setup:
esp_wifi_set_mode(WIFI_MODE_APSTA)
...
esp_wifi_set_protocol(ESP_IF_WIFI_AP, WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N)
...
esp_wifi_set_protocol(ESP_IF_WIFI_STA, WIFI_PROTOCOL_LR)
Responder setup:
esp_wifi_set_mode(WIFI_MODE_STA)
esp_wifi_set_protocol(ESP_IF_WIFI_STA, WIFI_PROTOCOL_LR)
My specific question is, can you setup the two interfaces on the controller (one ESP32S2 or any other Espressif chip) when in mode WIFI_MODE_APSTA; one acting as a WIFI AP supporting BGN and one acting as a WIFI STA supporting just the WIFI_PROTOCOL_LR (for ESP-NOW)? My IDF is v4.2.
WIFI_MODE_APSTA interface support for AP (BGN) and STA (LR)?
-
- Posts: 111
- Joined: Thu Oct 03, 2019 10:52 pm
- Contact:
Re: WIFI_MODE_APSTA interface support for AP (BGN) and STA (LR)?
You can set up two interfaces on one ESP32.
In this sample,
One acts as WIFI_STA and the other acts as ESPNOW.
https://github.com/nopnop2002/esp-idf-espnow-gateway
In this sample,
One acts as WIFI_STA and the other acts as ESPNOW.
https://github.com/nopnop2002/esp-idf-espnow-gateway
Re: WIFI_MODE_APSTA interface support for AP (BGN) and STA (LR)?
nopnop - thanks for pointing out your code. I am familiar with setting up the ESP32 with two interfaces (APSTA). In fact that is the exact setup I am looking to use.
The specific issue I am having is with the ESPNOW long range protocol. (WIFI_PROTOCOL_LR).
If on the ESP32S2 device that was initialized in mode WIFI_MODE_APSTA I ...
a) Configure the AP interface with wifi-protocols ( WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N) and
b) STA interface with (WIFI_PROTOCOL_LR)
... the wifi does not publish its SSID - and cannot be used as access point. And thus I cannot use the ESPNOW long range feature.
(If I setup the STA interface with protocols 11B,11G and or 11N the AP publishes its SSID.)
I am curious if I am doing something wrong or if this is an unsupported configuration.
The specific issue I am having is with the ESPNOW long range protocol. (WIFI_PROTOCOL_LR).
If on the ESP32S2 device that was initialized in mode WIFI_MODE_APSTA I ...
a) Configure the AP interface with wifi-protocols ( WIFI_PROTOCOL_11B|WIFI_PROTOCOL_11G|WIFI_PROTOCOL_11N) and
b) STA interface with (WIFI_PROTOCOL_LR)
... the wifi does not publish its SSID - and cannot be used as access point. And thus I cannot use the ESPNOW long range feature.
(If I setup the STA interface with protocols 11B,11G and or 11N the AP publishes its SSID.)
I am curious if I am doing something wrong or if this is an unsupported configuration.
-
- Posts: 111
- Joined: Thu Oct 03, 2019 10:52 pm
- Contact:
Re: WIFI_MODE_APSTA interface support for AP (BGN) and STA (LR)?
The example code does not setup an access point with a long range ESPNOW client. So no, does not work.
Re: WIFI_MODE_APSTA interface support for AP (BGN) and STA (LR)?
Seems like a bug but there is a new api esp_wifi_config_espnow_rate
-
- Posts: 31
- Joined: Sun Oct 27, 2019 3:12 pm
Re: WIFI_MODE_APSTA interface support for AP (BGN) and STA (LR)?
I'm also trying to achieve exactly this using an ESP32S3 with IDF 5.3.1, but the same issue - as soon as I enable WIFI_PROTOCOL_11N on ESP_IF_WIFI_STA, ESP_IF_WIFI_AP is no longer visible to non-ESP devices.
Did anyone manage to get this working?
Did anyone manage to get this working?
Who is online
Users browsing this forum: Baidu [Spider] and 227 guests