You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a Lolin Nodemcu and when running the code, sometimes the websocket client connects and then disconnects inmediately. When this happens I restart the nodemcu and then it works, but it is a recurrent problem. I am using the WebsocketsClient.
For now, I am using the following code, but I don't know if there is a better way to ensure it reconnects.
// Connect to server (in setup)
socketConnected = client.connect(websockets_connection_string);
//Check if it failed to connect (in loop)if (!socketConnected) {
socketConnected = client.connect(websockets_connection_string);
unsignedlong ms3 = micros();
while ((micros() - ms3) < 30) {
}
}
The text was updated successfully, but these errors were encountered:
I am using a Lolin Nodemcu and when running the code, sometimes the websocket client connects and then disconnects inmediately. When this happens I restart the nodemcu and then it works, but it is a recurrent problem. I am using the WebsocketsClient.
For now, I am using the following code, but I don't know if there is a better way to ensure it reconnects.
The text was updated successfully, but these errors were encountered: