Chat freely about anything...

User avatar
By leenowell
#80745 Hi all,

I have an esp8266 sending data to an esp32 via espnow. The esp32 is connected to my router and therefore has to be on the same channel as the router itself. This means that the esp8266 also has to be on the same channel.

The challenge is, how do I determine at run time which channel I should use? At the moment, the only way I can see is to try each channel until one works. This isn't ideal as the esp8266 is battery powered and uses deep sleep.

Also, at the moment, I broadcast the espnow message to {0xFF,0xFF,0xFF,0xFF,0xFF,0xFF} so that I don't have to configure the destination mac address at compile time. I was hoping to enhance this by doing an initial broadcast and then once a peer has received it use it's mac address from then on. Problem is, that the send data callback seems to have the mac address as the broadcast address (i.e. {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}) rather than the receiver's address. I can see why this might be the case but was wondering if there is a way of getting the address of the one that received it instead? Only way I can think of is to get the receiver to send esp message back and get it from there. Again because this uses deep sleep, this isn't ideal either.

Any cunning ideas?

Thanks

Lee.