Skip to content

Freezing #70

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

Closed
maciekfreak opened this issue Apr 5, 2016 · 3 comments
Closed

Freezing #70

maciekfreak opened this issue Apr 5, 2016 · 3 comments

Comments

@maciekfreak
Copy link

I have a strange issue. I'm resending all data from serial device using your websocket library. This data are strings about 10 times per second.

I'm using nodemcu esp8266 and sometimes esp8266 freeze for about 1-2 second and then start sending again.

This is code from my loop:

`
void loop() {

webSocket.loop();
if (connectedClient) {
if (Serial.available()) {
       while (Serial.available()) {
        sb=(char)Serial.read();
        if (sb == '\n') {
            webSocket.sendTXT(connectedIP, txtMsg);
            txtMsg = "";  
        } else {  
            txtMsg +=sb; 
        }
    }
    }
}

}
`

Do you know maybe what can be responsible for these freezes?

@maciekfreak
Copy link
Author

I tried async version and now it's looks that freeze are gone.. I will make some more tests to be sure.

@maciekfreak
Copy link
Author

Unfortunately lags and hanging continue. Now I think that this is somehow correlated with other wifi tasks on device.
Computer is connected to esp8266 access point.And for example when computer looking for other wifi network from time to time, websockets lags a little bit in the same time.

Do you think that this is possible? Is any possibility to avoid such things?

@Links2004
Copy link
Owner

for serial try to use this:
#61 (comment)
sending a packed on every new line generates many overhead, whit a time based way (see link) I have get better results.

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