Ak je pricinou resetu ta chyba, co tam mas je riesenie taketo:
Solution: I simply declared the buffer locally inside the onWebSocketEvent() function and the problem of overwriting was solved as the buffer was getting re-declared on every event preventing illegal memory-write attempt. The device never panicked ever again.