espnow sta interface with router connection

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

espnow sta interface with router connection

Postby davdav » Sun Sep 09, 2018 9:50 am

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

chromebin
Posts: 77
Joined: Wed Feb 07, 2018 3:53 pm

Re: espnow sta interface with router connection

Postby chromebin » 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?

davdav
Posts: 208
Joined: Thu Nov 17, 2016 2:33 pm

Re: espnow sta interface with router connection

Postby davdav » Thu Feb 07, 2019 2:39 pm

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.

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: espnow sta interface with router connection

Postby ESP_igrr » Sat Feb 09, 2019 11:51 pm

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.

Who is online

Users browsing this forum: No registered users and 90 guests