From df772b5c0a6b5d5ba762503fb2fe00800838feea Mon Sep 17 00:00:00 2001 From: Sara Damiano Date: Sat, 9 Apr 2022 15:50:21 -0400 Subject: [PATCH] Relaunch wifi on esp_now_init failure Signed-off-by: Sara Damiano --- tasmota/xdrv_57_9_tasmesh.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tasmota/xdrv_57_9_tasmesh.ino b/tasmota/xdrv_57_9_tasmesh.ino index 9e06bc108..f0b18f765 100644 --- a/tasmota/xdrv_57_9_tasmesh.ino +++ b/tasmota/xdrv_57_9_tasmesh.ino @@ -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; }