Page 1 of 1

espnow sta interface with router connection

Posted: Sun Sep 09, 2018 9:50 am
by davdav
Hi all,
I'm using espnow to exchange meaaages between devices. Each device is also connected to same wifi router. Therefore radio channel is the same.

Every device broadcast periodically its status to peer ff:ff:ff:ff:ff:ff (i.e. broadcast).the peer ifx is STA.

The messages are not always got by other devices (no timing issue).

However if i start wifi in ap+sta mode and espnow interface is set to AP the messages are always received and seems to work properly.

Are there any issue which can prevent to use STA interface for espnow and router connection the same time?

Thanks

Re: espnow sta interface with router connection

Posted: Mon Jan 28, 2019 10:24 pm
by chromebin
I have the same problem. With Wifi initialized to AP ESPNOW works, when STA it doesn't. Yes, I switch also from ESP_IF_WIFI_AP to ESP_IF_WIFI_STA.

Did you discover the problem?

Re: espnow sta interface with router connection

Posted: Thu Feb 07, 2019 2:39 pm
by davdav
chromebin wrote:
Mon Jan 28, 2019 10:24 pm
I have the same problem. With Wifi initialized to AP ESPNOW works, when STA it doesn't. Yes, I switch also from ESP_IF_WIFI_AP to ESP_IF_WIFI_STA.

Did you discover the problem?
Hello @chromebin,

No I didn't find a solution (using esp-idf v3.1.2). I just workaround using AP+STA mode.

Re: espnow sta interface with router connection

Posted: Sat Feb 09, 2019 11:51 pm
by ESP_igrr
When using STA mode, default is to have modem sleep enabled. In modem sleep the device might miss some of the broadcast packets. You can try calling esp_wifi_set_ps(WIFI_PS_NONE) to disable modem sleep when you are in STA mode.