In the code there are two mistakes:
-
the transmitter and receiver Sketch do not have the same number of variables transmitted. Both should have 3 variables
-
Transmitter code:
// Register peer
esp_now_peer_info_t peerInfo;
memcpy(peerInfo.peer_addr, broadcastAddress, 6);
peerInfo.channel = 0;
peerInfo.encrypt = false;
Line: esp_now_peer_info_t peerInfo; must be moved just befor void setup - then the programm works.
best regards
Hermann