It's easy to transmit packets, simply
Code: Select all
esp_now_init();
esp_now_register_recv_cb(espnowcb);
esp_now_register_send_cb(espnowcbtx);
esp_now_set_self_role(ESP_NOW_ROLE_CONTROLLER);
uint8_t da[6] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
esp_now_send(da, "ESP8266", 8 );
And, out pops a wonderfully complete vendor custom management frame with my data in it.
I can receive it on my PC or wireless router running my code.
But, if I try to send anything to the ESP, it never gets it. I've tried every combination of roles and adding controllers like this:
Code: Select all
uint8_t routermac[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff,}; //Src Address of my router.
printf( "PEERINFO: %d\n", esp_now_add_peer(routermac, ESP_NOW_ROLE_CONTROLLER, CHANNEL, 0, 0) );
But I don't see any indication of how to receive all packets directed on-channel to the broadcast address. What am I missing?
ALSO
http://esp-idf.readthedocs.io/en/latest ... p_now.html is incorrect. There are 4 bytes of data that seem rather random at the beginning of the vendor-specific content. It is possible the reason I cannot get this to work is I may be misinterpreting them.