Logic Machine Forum
LM5 without webscoket - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Visualization (https://forum.logicmachine.net/forumdisplay.php?fid=9)
+--- Thread: LM5 without webscoket (/showthread.php?tid=1358)



LM5 without webscoket - savaskorkmaz - 25.04.2018

Hi ,
One of the our customer will use a Siemens hmi panel which has html5 browser. But this browser has no websocket support. Visualation is working but KNX objects is not working because of lack of websocket. 

How can we use visualation without websocket ?

Regards,


RE: LM5 without webscoket - savaskorkmaz - 03.05.2018

Any reply ?


RE: LM5 without webscoket - admin - 04.05.2018

Long polling support has been removed several years ago and we are not planning to add it back. Maybe there's a possibility to do it via custom JavaScript but I'm not sure at the moment.


RE: LM5 without webscoket - buuuudzik - 04.05.2018

You can prepare .lp file which exports selected objects


RE: LM5 without webscoket - Thomas - 07.05.2018

Hi,
have you found any solution? I've similar problem with my Android 4 Sibo terminals. Ive found a workaround based on use of Opera web browser which provides WebRTC and WebSocket.


RE: LM5 without webscoket - admin - 07.05.2018

@Thomas, WebSocket is much better for performance and CPU load. If Opera works correctly on your devices, there's no point in using long polling.

@savas, try this solution (for now it will only work with admin account). Your device must be running latest firmware as well. If it works for you then I'll provide a full solution for non-admin users.

Code:
if (!window.WebSocket) {
  function doObjectUpdate(res) {
    if (typeof res == 'object' && res.updatetime) {
      if (res.updatetime != Globals.updateTime) {
        Globals.updateTime = res.updatetime;

        $.each(res.data || [], function(_, obj) {
          objectStore.registerOne(obj.address, obj.datadec);
        });
      }
    }
    
    startObjectUpdate();
  }
  
  function startObjectUpdate() {
    $.ajax({
      url: '/scada-main/objects/update',
      type: 'GET',
      dataType: 'json',
      data: { upd: Globals.updateTime },
      error: doObjectUpdate,
      success: doObjectUpdate,
      timeout: 60 * 1000
    });
  }

  function setObjectValueSend(data) {
    $.ajax({
      url: '/scada-main/objects/setvalue',
      type: 'POST',
      data: Scada.encodeData(data)
    });
  }

  localbus.init = function() {};
}