assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!)

52 views
Skip to first unread message

Gary Kuipers

unread,
Jan 14, 2025, 7:52:38 AM1/14/25
to painlessmesh-user
Please note I am also posting in 
https://github.com/espressif/arduino-esp32/issues/10526
and
https://gitlab.com/painlessMesh/painlessMesh/-/issues/526

I am running into this: assert failed: tcp_alloc /IDF/components/lwip/lwip/src/core/tcp.c:1851 (Required to lock TCPIP core functionality!)

When I run this program:

```
#include "painlessMesh.h"
#include <WiFi.h>

#define MESH_PREFIX "yourMeshName"
#define MESH_PASSWORD "yourMeshPassword"
#define MESH_PORT 5555

#define ROOT_NODE_ID 2748336925 // The known ID of the root node

Scheduler userScheduler;
painlessMesh mesh;

void sendMessage(); // Prototype for sendMessage function

// Use the correct constructor for Task
Task taskSendMessage(TASK_SECOND * 1, TASK_FOREVER, &sendMessage);

void sendMessage() {
String msg = "Hola from node ";
msg += mesh.getNodeId();
bool success = mesh.sendSingle(ROOT_NODE_ID, msg);
Serial.printf("Message sent to root node %u: %s - %s\n", ROOT_NODE_ID, msg.c_str(), success ? "Success" : "Failed");

taskSendMessage.setInterval(random(TASK_SECOND * 1, TASK_SECOND * 5));
}

void receivedCallback(uint32_t from, String &msg) {
Serial.printf("Received from %u: %s\n", from, msg.c_str());
}

void setup() {
Serial.begin(115200);

mesh.setDebugMsgTypes(ERROR | STARTUP | MESH_STATUS | CONNECTION | SYNC | COMMUNICATION | GENERAL | MSG_TYPES | REMOTE);
mesh.init(MESH_PREFIX, MESH_PASSWORD, &userScheduler, MESH_PORT);
mesh.onReceive(&receivedCallback);

userScheduler.addTask(taskSendMessage);
taskSendMessage.enable();
}

void loop() {
mesh.update();
}
```

This was one of those "overnight miracles" where I have namy examples working code and the next morning none of them work any more. Arduino IDE 2.3.4 esp32 by Espressif 3.1.1 painlessmesh 1.5.4

I compiled and flashed on all 5 of the boards I was using that worked the previous day.

I do not remember if there was an update so I walked back versions installed 3.1.0 ... no change in error installed 3.0.7 ... no change in error reinstalled 3.1.1 installed painlessmesh 1.5.3 ... no change in error

Backtrace did not change between 3.1.1 and 3.1.0 versions which punches a hole in my theory of it being an update that caused the problem (or I am looking in the wrong place).

3.1.1: Backtrace: 0x40082471:0x3ffb1f90 0x4008c25d:0x3ffb1fb0 0x40092512:0x3ffb1fd0 0x400f6cab:0x3ffb2100 0x400f6e25:0x3ffb2120 0x400dd0dc:0x3ffb2140 0x400d86de:0x3ffb2190 0x400d8811:0x3ffb21f0 0x400e4143:0x3ffb2270 0x4008cfa6:0x3ffb2290 3.1.0: Backtrace: 0x40082471:0x3ffb1f90 0x4008c261:0x3ffb1fb0 0x4009250e:0x3ffb1fd0 0x400f6ca7:0x3ffb2100 0x400f6e21:0x3ffb2120 0x400dd0d8:0x3ffb2140 0x400d86da:0x3ffb2190 0x400d880d:0x3ffb21f0 0x400e413f:0x3ffb2270 0x4008cfaa:0x3ffb2290 3.0.7: Backtrace: 0x4008a07e:0x3ffb1cd0 0x40162b83:0x3ffb1ce0 0x401678ba:0x3ffb2000 0x401678f6:0x3ffb2090 0x400e2172:0x3ffb20d0 0x400e21f1:0x3ffb2150 0x400d95fa:0x3ffb21a0 0x4016dc89:0x3ffb21f0 0x400dc4b2:0x3ffb2210 0x400dc641:0x3ffb2230 0x400d370a:0x3ffb2250 0x400e4224:0x3ffb2270 0x4008e866:0x3ffb2290

I reinstalled Arduino IDE 2.3.4, going so far as using find / -name rduino and removing all files before reinstalling. Same problems.

I am posting this to https://github.com/espressif/arduino-esp32/issues/10526. They have asked me for a decoded stack which I am trying to figure out how to provide. I whink I have to install ESP-IDF and learn how to use that.

Gary Kuipers

unread,
Jan 14, 2025, 10:12:09 AM1/14/25
to painlessmesh-user
Appears to have been resolved by changing from Arduino IDE 2.3.4 to platformio. Programs now compile and run as they did before I ran into this problem:

Suggestions fo people using Arduino IDEs: It will waste less of your time if you just use platformio. Arduino IDEs look easier but in the long ruun they will eat up days of your time pursuing errors that are not yours.

Arduino IDE was born of Windows ... so it is inherently flawed at its core.
Reply all
Reply to author
Forward
0 new messages