Page 2 of 2

Re: ESP-NOW bi-directional communications --- send & receive

Posted: Fri Jan 12, 2018 8:55 am
by WiFive
peer->ifidx = ESPNOW_WIFI_IF;

I think Mac address for espnow should be WiFi.macAddress() regardless of mode

State just means whether other device has added us as peer yet

Re: ESP-NOW bi-directional communications --- send & receive

Posted: Fri Jan 12, 2018 9:46 am
by robbyr
ESPNOW_WIFI_IF is only defined in:

esp-idf/examples/wifi/espnow/main/espnow_example.h

and no where in arduino-esp32.

Code: Select all

/* ESPNOW can work in both station and softap mode. It is configured in menuconfig. */
#if CONFIG_STATION_MODE
#define ESPNOW_WIFI_MODE WIFI_MODE_STA
#define ESPNOW_WIFI_IF   ESP_IF_WIFI_STA
#else
#define ESPNOW_WIFI_MODE WIFI_MODE_AP
#define ESPNOW_WIFI_IF   ESP_IF_WIFI_AP
#endif
I had :
peer.ifidx = ESP_IF_WIFI_STA;

changed to:
peer.ifidx = ESP_IF_WIFI_AP;

And everything is HUNKY DORY!! That was the only change I needed to get it working. I still need to do some research to figure out why this is. and to understand it better.

Thank you so very much WiFive and chegewara! -R

Re: ESP-NOW bi-directional communications --- send & receive

Posted: Tue Jan 30, 2018 2:44 am
by forkus2000
I have the same problem !!! Can you publish both codes mastes and slave !!! with bidirectional communications !!! Thans again