Logic Machine Forum
Websocket message revieve crashing - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Websocket message revieve crashing (/showthread.php?tid=5573)



Websocket message revieve crashing - Aivaras - 23.08.2024

Hello,
I'm using websocket library to connect to Unifi Access device and receive status info from it, but the problem i have is once i receive status update, the message is too long to even fit into the logs line and the whole script crashes without an error and i need to restart the script for it to start receiving status updates again. The websocket library is a little bit too complicated for me to understand what I'm looking for to fix this.

Maybe someone else has had a similar issue and knows how to fix this?

I attached the event script I'm using for connection and websocket library file.

Thank you in advance!


RE: Websocket message revieve crashing - admin - 23.08.2024

Such script must be a resident script, not event. The message format is JSON so you need to decode the message and check the relevant fields instead of relying on string.find