ESP32 problem Core 1 panic'ed (LoadProhibited)
My project is running on an ESP32 Wrover (with 4MB SPI RAM), GSM module attached (handled by its own task), BT Serial (handled by its own task) and painlessMesh (handled by its own task). Main loop is doing control stuff.
When running the application without initializing painlessMesh everything works fine. But as soon as I initialize painlessMesh, I get frequently Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
One problem is that it does not always happen at the same time or at the same code sequence. It is coming from time to time only.
Any idea?
Log output:
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400014e8 PS : 0x00060530 A0 : 0x800ed9f0 A1 : 0x3ffdea20
A2 : 0xcd4c6dea A3 : 0xcd4c6de8 A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x8000beca A9 : 0x3ffde9f0
A10 : 0x3ffdeebc A11 : 0x3ffea308 A12 : 0x00000002 A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x0000001b EXCCAUSE: 0x0000001c
EXCVADDR: 0xcd4c6de8 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff
Backtrace: 0x400014e8:0x3ffdea20 0x400ed9ed:0x3ffdea30 0x400edb09:0x3ffdea50 0x400e46f6:0x3ffdea70 0x40097239:0x3ffdedc0
Rebooting...
Exception decoder output is useless:
PC: 0x400014dc
EXCVADDR: 0xcd4c7027
Decoding stack results
0x40097239: vPortTaskWrapper at /Users/ficeto/Desktop/ESP32/ESP32/esp-idf-public/components/freertos/port.c line 143
Serial log output until the exception occurs:
ets Jun 8 2016 00:22:57
rst:0x1 (POWERON_RESET),boot:0x33 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0018,len:4
load:0x3fff001c,len:928
ho 0 tail 12 room 4
load:0x40078000,len:9280
load:0x40080400,len:5860
entry 0x40080698
ÿ
[DBG] ##################################
[DBG] Smart Remote II
[DBG] Firmware: Remote_Smart_0.0.6
[DBG] Build: Dec 30 2018 18:46:33
[DBG] ##################################
[HEA] ##################################
[HEA] on start:
[HEA] Internal Total heap 247124, internal Free Heap 219188
[HEA] SPIRam Total heap 4194252, SPIRam Free Heap 4194252
[HEA] ChipRevision 1, Cpu Freq 240, SDK Version v3.3-beta1-136-g97eecfa1b-dirty
[HEA] Flash Size 4194304, Flash Speed 40000000
[HEA] ##################################
[DBG] Get saved settings
[DBG] ##################################
[DBG] SN: SN207188072
[DBG] BT: Scent-807D3ACFBC48
[DBG] ##################################
[HEA] after readPreferences: 218972
[DBG] RTC time: 18/12/30,18:46:36+00
[DBG] Initialize pumps
[DBG] Start BT Serial
[HEA] after initBTSerial: 167256
[DBG] ##################################
[DBG] Module type GSM
[MES_TSK] Mesh task started
setDebugTypes: ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE |
[MES] Start connecting to Mesh
[DBG] + Mesh (PSRAM available)
[DBG] Setup finished
[DBG] ##################################
GENERAL: encodeNodeId():
GENERAL: tcpServerInit():
[MES] Using GSM IMEI:
GENERAL: onChangedConnections():
GENERAL: onReceive():
GENERAL: onNewConnection():
[HEA] after initMesh: 111372
[MES_TSK] Mesh OK
[MES_TSK] Initial list of nodes:
ID: 986692681 - ScentID: - FW: Remote_Smart_0.0.6 Root
CONNECTION: stationScan(): ScentControlMesh
CONNECTION: eventScanDoneHandler: SYSTEM_EVENT_SCAN_DONE
GENERAL: getNodeTime(): time=6198041
CONNECTION: scanComplete():-- > scan finished @ 6198041 < --
CONNECTION: scanComplete():-- > Cleared old aps.
CONNECTION: scanComplete(): num = 5
CONNECTION: found : ScentControlMesh, -51dBm
CONNECTION: found : ScentControlMesh, -93dBm
CONNECTION: Found 2 nodes
GENERAL: encodeNodeId():
GENERAL: In findConnection(nodeId)
CONNECTION: findConnection(3948575181): did not find connection
GENERAL: encodeNodeId():
GENERAL: In findConnection(nodeId)
CONNECTION: findConnection(2383173181): did not find connection
GENERAL: encodeNodeId():
CONNECTION: connectToAP(): Best AP is 3948575181<---
CONNECTION: connectToAP(): Trying to connect, scan rate set to 4*normal
CONNECTION: eventSTAGotIPHandler: SYSTEM_EVENT_STA_GOT_IP
GENERAL: tcpConnect():
CONNECTION: New STA connection incoming
CONNECTION: meshConnectedCb(): we are STA
GENERAL: MeshConnection(): leaving
SYNC: nodeSyncTask():
SYNC: nodeSyncTask(): request with 0
GENERAL: In findConnection() conn=0x3ffe9d2c
GENERAL: subConnectionJson(): ret=[]
COMMUNICATION: sendMessage(conn): conn-nodeId=0 destId=0 type=5 msg=[]
GENERAL: In buildMeshPackage(): msg=[]
COMMUNICATION: addMessage(): Package sent to queue beginning -> 1 , FreeMem: 108916
GENERAL: sentBufferTask()
COMMUNICATION: writeNext(): Package sent = {"dest":0,"from":986692681,"type":5,"subs":[]}
COMMUNICATION: SentBuffer::freeRead(): 47
GENERAL: sentBufferTask()
COMMUNICATION: sentBufferTask()
[00]Id=0
GENERAL: sentBufferTask()
COMMUNICATION: ReceiveBuffer::push(): buffer size=1, 0
GENERAL: getNodeTime(): time=7577148
COMMUNICATION: meshRecvCb(): Recvd from 0-->{"dest":986692681,"from":3948575181,"type":6,"subs":[{"nodeId":2383173181,"subs":[{"nodeId":3296841373,"subs":[]}]}]}<--
GENERAL: getNodeTime(): time=7594353
COMMUNICATION: meshRecvCb(): lastRecieved=7594353 fromId=0 type=6
GENERAL: In findConnection() conn=0x3ffe9d2c
SYNC: handleNodeSync(): with 0
GENERAL: In findConnection(nodeId)
GENERAL: findConnection(3948575181): Skipping excluded connection
CONNECTION: findConnection(3948575181): did not find connection
SYNC: handleNodeSync(): conn->nodeId updated from 0 to 3948575181
SYNC: handleNodeSync(): Changed connections 3948575181.
SYNC: syncSubConnections(): changedId = 3948575181
SYNC: handleNodeSync(): json = [{"nodeId":2383173181,"subs":[{"nodeId":3296841373,"subs":[]}]}]
SYNC: handleNodeSync(): valid NODE_SYNC_REPLY from 3948575181
CONNECTION: newConnectionTask():
GENERAL: getNodeTime(): time=7655474
CONNECTION: newConnectionTask(): adding 3948575181 now= 7655474
GENERAL: subConnectionJson(), exclude=3948575181
GENERAL: subConnectionJson(): ret=[]
GENERAL: getNodeTime(): time=7671740
COMMUNICATION: sendMessage(conn): conn-nodeId=3948575181 destId=3948575181 type=4 msg={"type":1,"t0":7671740}
GENERAL: In buildMeshPackage(): msg={"type":1,"t0":7671740}
COMMUNICATION: addMessage(): Package sent to queue beginning -> 1 , FreeMem: 108456
[MES_TSK] New connection: 3948575181
[MES_TSK] Changed connection
GENERAL: subConnectionJson(): ret=[{"nodeId":3948575181,"subs":[{"nodeId":2383173181,"subs":[{"nodeId":3296841373,"subs":[]}]}]}]
GENERAL: sentBufferTask()
COMMUNICATION: writeNext(): Package sent = {"dest":3948575181,"from":986692681,"type":4,"msg":{"type":1,"t0":7671740}}
COMMUNICATION: COMMUNICATION: SentBuffer::freeRead(): 76
SentBufferTask()
[00]ad(): 76
GENERAL: sentBufferTask()
COMMUNICATION: ReceiveBuffer::push(): buffer size=1, 0
GENERAL: getNodeTime(): time=7742116
COMMUNICATION: meshRecvCb(): Recvd from 3948575181-->{"dest":986692681,"from":3948575181,"type":4,"msg":{"type":2,"t0":7671740,"t1":485553128,"t2":485554030}}<--
GENERAL: getNodeTime(): time=7758604
COMMUNICATION: meshRecvCb(): lastRecieved=7758604 fromId=3948575181 type=4
GENERAL: In findConnection() conn=0x3ffe9d2c
GENERAL: getNodeTime(): time=485618833
COMMUNICATION: meshRecvCb(): fromId=3948575181
COMMUNICATION: ReceiveBuffer::push(): buffer size=1, 0
GENERAL: getNodeTime(): time=485631740
COMMUNICATION: meshRecvCb(): Recvd from 3948575181-->{"dest":986692681,"from":3948575181,"type":8,"msg":"{\"topic\":\"broad\",\"nid\":\"132235090121205\",\"root\":false,\"fw\":\"Remote_Smart_sa0.0.20\"}"}<--
GENERAL: getNodeTime(): time=485652456
COMMUNICATION: meshRecvCb(): lastRecieved=485652456 fromId=3948575181 type=8
GENERAL: In findConnection() conn=0x3ffe9d2c
COMMUNICATION: broadcastMessage(): from=3948575181 type=8, msg={"topic":"broad","nid":"132235090121205","root":false,"fw":"Remote_Smart_sa0.0.20"} exclude=3948575181
[MES_TSK] Received broadcast: {"topic":"broad","nid":"132235090121205","root":false,"fw":"Remote_Smart_sa0.0.20"}
[MES_TSK] Found a new node
[MES_TSK] New list of nodes:
ID: 986692681 - ScentID: - FW: Remote_Smart_0.0.6 Root
ID: 3948575181 - ScentID: 132235090121205 - FW: Remote_Smart_sa0.0.20 No Root
[MES_TSK] Check IMEI found:
GENERAL: subConnectionJson(), exclude=3948575181
GENERAL: subConnectionJson(): ret=[]
GENERAL: getNodeTime(): time=485822039
COMMUNICATION: sendMessage(conn): conn-nodeId=3948575181 destId=3948575181 type=4 msg={"type":1,"t0":485822039}
GENERAL: In buildMeshPackage(): msg={"type":1,"t0":485822039}
COMMUNICATION: addMessage(): Package sent to queue beginning -> 1 , FreeMem: 108184
GENERAL: sentBufferTask()
COMMUNICATION: writeNext(): Package sent = {"dest":3948575181,"from":986692681,"type":4,"msg":{"type":1,"t0":485822039}}
COMMUNICATION: COMMUNICATION: SentBuffer::freeRead(): 78
SentBuffer::freeR[00]ad(): 78
GENERAL: sentBufferTask()
COMMUNICATION: ReceiveBuffer::push(): buffer size=1, 0
GENERAL: getNodeTime(): time=485871770
COMMUNICATION: meshRecvCb(): Recvd from 3948575181-->{"dest":986692681,"from":3948575181,"type":4,"msg":{"type":2,"t0":485822039,"t1":485836038,"t2":485836917}}<--
GENERAL: getNodeTime(): time=485888948
COMMUNICATION: meshRecvCb(): lastRecieved=485888948 fromId=3948575181 type=4
GENERAL: In findConnection() conn=0x3ffe9d2c
GENERAL: getNodeTime(): time=485892370
GENERAL: subConnectionJson(), exclude=3948575181
GENERAL: subConnectionJson(): ret=[]
GENERAL: getNodeTime(): time=486095525
COMMUNICATION: sendMessage(conn): conn-nodeId=3948575181 destId=3948575181 type=4 msg={"type":1,"t0":486095525}
GENERAL: In buildMeshPackage(): msg={"type":1,"t0":486095525}
COMMUNICATION: addMessage(): Package sent to queue beginning -> 1 , FreeMem: 108136
GENERAL: sentBufferTask()
COMMUNICATION: writeNext(): Package sent = {"dest":3948575181,"from":986692681,"type":4,"msg":{"type":1,"t0":486095525}}
COMMUNICATION: COMMUNICATION: SentBuffer::freeRead(): 78
SentBuffer::freeR[00]ad(): 78
GENERAL: sentBufferTask()
COMMUNICATION: ReceiveBuffer::push(): buffer size=1, 0
GENERAL: getNodeTime(): time=486145344
COMMUNICATION: meshRecvCb(): Recvd from 3948575181-->{"dest":986692681,"from":3948575181,"type":4,"msg":{"type":2,"t0":486095525,"t1":486120740,"t2":486121623}}<--
GENERAL: getNodeTime(): time=486162448
COMMUNICATION: meshRecvCb(): lastRecieved=486162448 fromId=3948575181 type=4
GENERAL: In findConnection() conn=0x3ffe9d2c
GENERAL: getNodeTime(): time=486176483
GENERAL: sentBufferTask()
GENERAL: sentBufferTask()
COMMUNICATION: meshRecvCb(): fromId=3948575181
COMMUNICATION: ReceiveBuffer::push(): buffer size=1, 0
GENERAL: getNodeTime(): time=487150022
COMMUNICATION: meshRecvCb(): Recvd from 3948575181-->{"dest":986692681,"from":2383173181,"type":8,"msg":"{\"topic\":\"broad\",\"nid\":\"132142012086060\",\"gsm\":false,\"sig\":99,\"root\":false,\"time\":\"18/12/30,GENERAL: getNodeTime(): time=487168233
COMMUNICATION: meshRecvCb(): lastRecieved=487168233 fromId=3948575181 type=8
GENERAL: In findConnection() conn=0x3ffe9d2c
COMMUNICATION: broadcastMessage(): from=2383173181 type=8, msg={"topic":"broad","nid":"132142012086060","gsm":false,"sig":99,"root":false,"time":"18/12/30,18:47:34+00+00","fw":"Remote_Smart_sim_0.0.6"} exclude=3948[MES_TSK] Received broadcast: {"topic":"broad","nid":"132142012086060","gsm":false,"sig":99,"root":false,"time":"18/12/30,18:47:34+00+00","fw":"Remote_Smart_sim_0.0.6"}
[MES_TSK] Found a new node
[MES_TSK] New list of nodes:
ID: 986692681 - ScentID: - FW: Remote_Smart_0.0.6 Root
ID: 3948575181 - ScentID: 132235090121205 - FW: Remote_Smart_sa0.0.20 No Root
ID: 2383173181 - ScentID: 132142012086060 - FW: Remote_Smart_sim_0.0.6 No Root
[MES_TSK] Check IMEI found:
GENERAL: sentBufferTask()
GENERAL: sentBufferTask()
GENERAL: sentBufferTask()
GENERAL: sentBufferTask()
GENERAL: sentBufferTask()
GENERAL: sentBufferTask()
SYNC: nodeSyncTask():
SYNC: nodeSyncTask(): request with 3948575181
GENERAL: In findConnection() conn=0x3ffe9d2c
GENERAL: subConnectionJson(), exclude=3948575181
GENERAL: subConnectionJson(): ret=[]
COMMUNICATION: sendMessage(conn): conn-nodeId=3948575181 destId=3948575181 type=5 msg=[]
GENERAL: In buildMeshPackage(): msg=[]
COMMUNICATION: addMessage(): Package sent to queue beginning -> 1 , FreeMem: 107824
GENERAL: sentBufferTask()
COMMUNICATION: writeNext(): Package sent = {"dest":3948575181,"from":986692681,"type":5,"subs":[]}
COMMUNICATION: SentBuffer::freeRead(): 56
COMMUNICATION: sentBufferTask()
[00]Id=3948575181
GENERAL: sentBufferTask()
COMMUNICATION: ReceiveBuffer::push(): buffer size=1, 0
GENERAL: getNodeTime(): time=490409527
COMMUNICATION: meshRecvCb(): Recvd from 3948575181-->{"dest":986692681,"from":3948575181,"type":6,"subs":[{"nodeId":2383173181,"subs":[{"nodeId":3296841373,"subs":[]}]}]}<--
GENERAL: getNodeTime(): time=490427389
COMMUNICATION: meshRecvCb(): lastRecieved=490427389 fromId=3948575181 type=6
GENERAL: In findConnection() conn=0x3ffe9d2c
SYNC: handleNodeSync(): with 3948575181
SYNC: handleNodeSync(): json = [{"nodeId":2383173181,"subs":[{"nodeId":3296841373,"subs":[]}]}]
SYNC: handleNodeSync(): valid NODE_SYNC_REPLY from 3948575181
GENERAL: sentBufferTask()
GENERAL: sentBufferTask()
GENERAL: sentBufferTask()
CONNECTION: tcp_err(): MeshConnection Address in use
CONNECTION: onDisconnect():
GENERAL: getNodeTime(): time=492202899
CONNECTION: eventSTADisconnectedHandler: SYSTEM_EVENT_STA_DISCOCONNECTION: eventSTADisconnectedHandler: SYSTEM_EVENT_STA_DISCONNECTED
GENERAL: encodeNodeId():
CONNECTION: connectToAP(): Best AP is 2383173181<---
CONNECTION: MeshConnection Trying to CONNECTION: connectToAP(): Trying to connect, scan rate set to 4*normal
CONNECTION: CONNECTION: closingTask():
GENERAL: getNodeTime(): time=492233314
CONNECTION: closingTask(): dropping 3948575181 now= 492233314
SYNC: syncSubConnections(): changedId = 3948575181
[MES_TSK] Changed connection
ERROR: subConnectionJsonHelper(): Found closed connection 0
GENERAL: subConnectionJson(): ret=[]
}
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x400014e8 PS : 0x00060530 A0 : 0x800ed9f0 A1 : 0x3ffdea20
A2 : 0xcd4c6dea A3 : 0xcd4c6de8 A4 : 0x000000ff A5 : 0x0000ff00
A6 : 0x00ff0000 A7 : 0xff000000 A8 : 0x8000beca A9 : 0x3ffde9f0
A10 : 0x3ffdeebc A11 : 0x3ffea308 A12 : 0x00000002 A13 : 0x0000ff00
A14 : 0x00ff0000 A15 : 0xff000000 SAR : 0x0000001b EXCCAUSE: 0x0000001c
EXCVADDR: 0xcd4c6de8 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xffffffff
Backtrace: 0x400014e8:0x3ffdea20 0x400ed9ed:0x3ffdea30 0x400edb09:0x3ffdea50 0x400e46f6:0x3ffdea70 0x40097239:0x3ffdedc0
Rebooting...
The code is way to long to post all of it here. But here is the initialization sequence:
/**
* Initialize Mesh connection.
* Start Mesh connection
* @return result
* 0 if all is ok
* 1 if Mesh connection timed out
*/
uint8_t initMesh()
{
/// \todo remove MESH debug output
mesh.setDebugMsgTypes( ERROR | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE ); // all types on
SerialCMD.println("[MES] Start connecting to Mesh\n");
// Initialize MESH
mesh.init(MESH_SSID, MESH_PASSWORD, MESH_PORT);
mesh.onChangedConnections([]() {
connectionHasChanged = true;
});
mesh.onReceive([](uint32_t from, String &msg) {
if (!hasRecvData)
{ // Handle incoming message only if buffer is empty
recvData = msg;
sendFromNodeID = from;
hasRecvData = true;
}
else
{
}
meshIsConnected = true;
});
mesh.onNewConnection([](uint32_t nodeId) {
sendFromNodeID = nodeId;
hasNewConnection = true;
});
#ifdef HEA_DBG
SerialCMD.print("[HEA] after initMesh: ");
SerialCMD.println(ESP.getFreeHeap());
#endif
return 0;
}
And the task handling the Mesh network
/**
* Task to handle the Mesh communication
*/
void meshTask(void *pvParameters)
{
SerialCMD.println("[MES_TSK] Mesh task started");
meshSendSemaphore = xSemaphoreCreateMutex();
// Initialize Mesh
uint8_t wifiOK = initMesh();
if (wifiOK != 0)
{
SerialCMD.println("[MES_TSK] Mesh failed");
vTaskSuspend(NULL);
}
SerialCMD.println("[MES_TSK] Mesh OK");
// Add yourself to the list of nodes in the mesh
nodeInfo newNode;
newNode.nodeID = mesh.getNodeId();
strcpy(newNode.nodeIMEI, myIMEI.c_str());
strcpy(newNode.nodeFW, firmware.c_str());
newNode.isRoot = iAmRoot;
connNodes.push_back(newNode);
SerialCMD.println("[MES_TSK] Initial list of nodes:");
for (std::list<nodeInfo>::iterator it = connNodes.begin(); it != connNodes.end(); it++)
{
newNode = *it;
SerialCMD.print("ID: " + String(newNode.nodeID) + " - ScentID: " + String(newNode.nodeIMEI) + " - FW: " + String(newNode.nodeFW));
SerialCMD.println(newNode.isRoot ? " Root" : " No Root");
}
// Start ticker for timeout check
meshTimeoutTicker.attach(120, meshTimeout);
meshSendBroadcast.attach(60, sendMyIdTicker);
while (1)
{
mesh.update();
if (hasNewConnection)
{
hasNewConnection = false;
// Restart Mesh timeout trigger
meshTimeoutTicker.detach();
meshTimeoutTicker.attach(120, meshTimeout);
SerialCMD.println("[MES_TSK] New connection: " + String(sendFromNodeID));
// Broadcast my ID
sendMyId();
meshIsConnected = true;
}
if (connectionHasChanged)
{
connectionHasChanged = false;
// Restart Mesh timeout trigger
meshTimeoutTicker.detach();
meshTimeoutTicker.attach(120, meshTimeout);
SerialCMD.println("[MES_TSK] Changed connection");
// Broadcast my ID
sendMyId();
// Check if a node disappeared from the list
SimpleList<uint32_t> nodes = mesh.getNodeList();
bool listChanged = false;
for (std::list<nodeInfo>::iterator it = connNodes.begin(); it != connNodes.end(); it++)
{
nodeInfo searchNode = *it;
if (searchNode.nodeID != mesh.getNodeId())
{
bool foundNode = false;
for (SimpleList<uint32_t>::iterator it2 = nodes.begin(); it2 != nodes.end(); it2++)
{
if (searchNode.nodeID == *it2)
{
foundNode = true;
}
}
if (!foundNode)
{
SerialCMD.println("[MES] Remove Node ID: " + searchNode.nodeID);
if (searchNode.isRoot)
{
rootNodeId = 0;
}
connNodes.erase(it);
it--;
listChanged = true;
}
}
}
if (listChanged)
{
nodeInfo newNode;
SerialCMD.println("[MES_TSK] New list of nodes:");
for (std::list<nodeInfo>::iterator it = connNodes.begin(); it != connNodes.end(); it++)
{
newNode = *it;
SerialCMD.print("ID: " + String(newNode.nodeID) + " - ScentID: " + String(newNode.nodeIMEI) + " - FW: " + String(newNode.nodeFW));
SerialCMD.println(newNode.isRoot ? " Root" : " No Root");
}
}
}
if (hasRecvData)
{
// process the received data
// set RTC with received time/date
// update control parameters with received data
// handle request to report current status and data
// .....
}
// To avoid task watchdog trigger
delay(1);
yield();
}
SerialCMD.println("[MES_TSK] Mesh task closed");
}
The task is started with
/**
* Start task to handle the WiFi communication
* @return wifiOK
* 0 all ok and running
* 1 Mesh network connection timed out
*/
uint8_t startMesh()
{
// Initialize WiFi
uint8_t wifiOK = 0;
// Start WiFi task
xTaskCreatePinnedToCore(
meshTask, /* Function to implement the task */
"MESH", /* Name of the task */
8000, /* Stack size in words */
NULL, /* Task input parameter */
4, /* Priority of the task */
&meshTaskHandle, /* Task handle. */
1); /* Core where the task should run */
if (meshTaskHandle == NULL)
{
// Report Mesh task error
wifiOK = 4;
}
// Return result
return wifiOK;
}