ESP8266 crashes when sending UDP packet

what's the value of PARAMETER_SIZE_IN_BYTES ?

why do you think this is where it crashed?

note that instead of

        char buffer[4];
        sprintf(buffer, "OKE");
        UDP.write(buffer);
        UDP.endPacket();

you can do

        char buffer[] = "OKE";
        UDP.write(buffer);
        UDP.endPacket();

use the exception decoder tool to get more info about the crash: GitHub - me-no-dev/EspExceptionDecoder: Exception Stack Trace Decoder for ESP8266 and ESP32