Merge pull request #15334 from SRGDamia1/development

Relaunch wifi on esp_now_init failure, to fix #15333
This commit is contained in:
Theo Arends 2022-04-10 11:40:16 +02:00 committed by GitHub
commit fa50259168
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -387,6 +387,10 @@ void MESHstartNode(int32_t _channel, uint8_t _role){ //we need a running broker
MESHsetWifi(0);
if (esp_now_init() != 0) {
AddLog(LOG_LEVEL_INFO, PSTR("MSH: Node init failed"));
// try to re-launch wifi
MESH.role = ROLE_NONE;
MESHsetWifi(1);
WifiBegin(3, MESH.channel);
return;
}