Skip to content

Commit 0ad9baa

Browse files
committed
Add the binding address as a peer address
1 parent f305264 commit 0ad9baa

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/Tx_main.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ void sendMSPViaEspnow(mspPacket_t *packet);
7272
// otherwise we get errors about invalid peer:
7373
// https://rntlab.com/question/espnow-peer-interface-is-invalid/
7474
esp_now_peer_info_t peerInfo;
75+
esp_now_peer_info_t bindingInfo;
7576
#endif
7677

7778
void RebootIntoWifi(wifi_service_t service = WIFI_SERVICE_UPDATE)
@@ -412,6 +413,14 @@ void setup()
412413
DBGLN("ESP-NOW failed to add peer");
413414
return;
414415
}
416+
memcpy(bindingInfo.peer_addr, bindingAddress, 6);
417+
bindingInfo.channel = 0;
418+
bindingInfo.encrypt = false;
419+
if (esp_now_add_peer(&bindingInfo) != ESP_OK)
420+
{
421+
DBGLN("ESP-NOW failed to add binding peer");
422+
return;
423+
}
415424
#endif
416425

417426
esp_now_register_recv_cb(OnDataRecv);

0 commit comments

Comments
 (0)