Open Jotschi opened 7 months ago
Update: I was able to fix/workaround the issue by adding a custom allocator which uses SPI and the PSRAM for the JSON document:
#include <Arduino.h>
#include <ArduinoJson.h>
struct SpiRamAllocator {
void* allocate(size_t size) {
return heap_caps_malloc(size, MALLOC_CAP_SPIRAM);
}
void deallocate(void* pointer) {
heap_caps_free(pointer);
}
void* reallocate(void* ptr, size_t new_size) {
return heap_caps_realloc(ptr, new_size, MALLOC_CAP_SPIRAM);
}
};
Details: https://arduinojson.org/v6/how-to/use-external-ram-on-esp32/
Unfortunately now the ESP32 crashes when I try to invoke the first request.
assert failed: spinlock_acquire spinlock.h:122 (result == core_id || result == SPINLOCK_FREE)
Returning a basic hello world works.
I'm currently trying to narrow it down but I believe the error happens when sendInfo of websocket.cpp is invoked.
The S3 N8R8 has 8MB PSRAM.