-
Notifications
You must be signed in to change notification settings - Fork 11
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
Websocket #136
base: main
Are you sure you want to change the base?
Websocket #136
Conversation
Add debug build to async_rules...
Fix annotations in actions
Feedback Test Egyras#564 Signature Alpha 5f4a763. (not the debug version) Loaded Rule: CoPilot3303.txt with 23 rules and several SetCurves commands and modified in length. The web server is running stable. There was no longer any freezing after opening the UI again. The rules are running correctly as far as I can tell without the console information. Known deficits: Console window only runs for about 30 seconds. Further development of the rules is not possible, which is why I used my current ruleset here. For further testing I need specific information about which version should be tested on what. I can also provide the debug log if required. |
Does it still run stable? |
Yes, it's stable. Attached is the debug log file from the last 30 hours. The message: New webserver client: was there 1053 times. ?? The monitoring of the So and 1Wire port is visible correctly. |
So the only bug in this version (besides the missing rules console) is the websocket messages that freeze after 30 sec? |
There were no frozen windows. In my opinion the WS is now running stable. The only thing I'm concerned about is the large number of new and closing web server messages that can never come from my test. I can't say whether these calls are triggered by the PC. The 1 hour is in the attached log file. |
Please notice that all the value tables are refreshed by an javascript Ajax call: function refreshTable(tableName){
switch(tableName) {
case 'Heatpump':
loadContent('heishavalues', '/tablerefresh', function(){});
break;
case 'S0':
loadContent('s0values', '/tablerefresh?s0', function(){});
break;
case 'Opentherm':
loadContent('openthermvalues', '/tablerefresh?opentherm', function(){});
break;
case 'Dallas':
loadContent('dallasvalues', '/tablerefresh?1wire', function()
{
var dallas_elements = document.getElementsByClassName("dallas_alias");
for (var i = 0; i < dallas_elements.length; i++) {
dallas_elements[i].addEventListener('blur', dallasAliasEdit, false);
}
});
break;
default:
break;
}
clearTimeout(timeout);
timeout=setTimeout(refreshTable, 30000, tableName);
} These calls are just regular webserver requests. And as you can see in the logs, almost all of the calls happen in a 30 second interval. @IgorYbema Do you have time to check if you can reproduce the websocket connection failing after 30 seconds issue? |
I would like to give another hint.
Since the console window currently only works to a limited extent, it may not be an error at all and would no longer occur if the console was running correctly again. If the rules information is re-integrated into the console window, I would have 2 suggestions for improvement. I'm a pensioner and grateful for everything that makes things clearer.
old: If it's not too much effort, it would be even better if trend information was displayed for numerical variables. e.g.: New value greater than old value: New value smaller than old value: For changed string contents: |
The websockets shouldn't disconnect in 30 seconds so lets first fix that. |
Let me take a look at that indeed |
There was indeed a bug in the WS heartbeat. The last build should fix that. |
If you mean that that would fix the console 30 sec bug? It made it worse> it not stops after about 10 secs |
What does whireshark say about the PING/PONG of the websocket connection. The webserver should now send a PING each 3 seconds that should immediatly responded to by a PONG from the client. |
PING/PONG works fine. According to chrome the websocket is closed due to wrong data received: |
I'm wondering why the change does change that failure speed if it's not the PING/PONG that's the issue. |
No and I believe the 30 secs is just a average. If you have more console output the possibility of an early disconnect is bigger |
Just took more than 2 minutes to get the error |
Also testing the code on the ESP32 and it runs fine as it seems. Been testing for a few minutes but no console stop (websocket disconnect). Could be because of more memory maybe? |
With more memory overflows indeed occur less |
Ah yes indeed. Or the effect is lower as the memory which is overflowed isn't in use by another critical proces and probably even NULL-ed. |
Exactly |
The webserver in my repo is constantly tested for memory issues with valgrind. That doesn't report anything, so i'm curious where the error could be. |
Maybe it is a good idea to separate my commits for improving the actions into a separate PR? |
Will fix those when this PR is done. |
No description provided.