Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP8266 goin down when get JSON string. #1398

Open
sova32 opened this issue Apr 23, 2024 · 1 comment
Open

ESP8266 goin down when get JSON string. #1398

sova32 opened this issue Apr 23, 2024 · 1 comment

Comments

@sova32
Copy link

sova32 commented Apr 23, 2024

ESP8266 goin down when get string.
{"DataType":"CONTROL_DATA","pwm1Speed":"100","pwm2Speed":"1023"}
another strings like
{"DataType":"CONTROL_DATA","pwm1Speed":"0","pwm2Speed":"0"}
work good
no any modifications in example code!
i get response from server and then microcontroller goin to reboot:

 ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 3424, room 16 
tail 0
chksum 0x2e
load 0x3fff20b8, len 40, room 8 
tail 0
chksum 0x2b
csum 0x2b
v000945b0
~ld

this is js code that send string to server:

let socket = new WebSocket("ws://" + window.location.hostname + "/ws");

socket.onopen = function (e) {
    console.log("[open] Connection established");
};
function sendControlData() {
    let pwm1Speed = document.getElementById("control-pwm1Speed").value;
    let pwm2Speed = document.getElementById("control-pwm2Speed").value;

    // Перевірка введених даних
    if (!isValidNumber(pwm1Speed) || !isValidNumber(pwm2Speed)) {
        alert("Please enter valid numeric values for control data.");
        return;
    }

    let controlData = {
        DataType: "CONTROL_DATA",
        pwm1Speed: pwm1Speed,
        pwm2Speed: pwm2Speed,
    };

    socket.send(JSON.stringify(controlData));
}
@sova32 sova32 changed the title ESP8266 goin down when get string with length 64 symbols ESP8266 goin down when get string. Apr 23, 2024
@sova32 sova32 changed the title ESP8266 goin down when get string. ESP8266 goin down when get JSON string. Apr 23, 2024
@noweare1
Copy link

Would need to see the esp32 code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants