Logic Machine Forum
Strange behavior after connection change - 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: Strange behavior after connection change (/showthread.php?tid=622)



Strange behavior after connection change - Thomas - 16.02.2017

Hi
I've found a problem in touch mode. Sometimes when a  connection is lost and re-opened again the visualisation looks like everything is OK but in reality it has stopped sending and receiving data. The only option for an user is to reload the page. The worst is the user can't see the visu has been disconnected. This is very frustrating because he things he made some change but it hasn't been applied.
The same situation occures when you change the connection from LTE to WiFi or back.

Do you have any workarounds like:
1. Inform the user "You are offline"
2. Show "Reconnect" button
3. Repeatedly trying of doing auto-reconnect

OS: Android 6.1, browser "browser".

Thank you


RE: Strange behavior after connection change - admin - 16.02.2017

Have you tried using Chrome instead? Auto-reconnect is already implemented, but I'm not sure if OS is reporting problems correctly when switching connections.


RE: Strange behavior after connection change - Thomas - 16.02.2017

I installed chrome and it looks OK. So it's probably a workaround of the part of the problem.
The second part occurs if the user is really offline. May I inform him somehow? The best solution would be to disable controllers (and show it) until he is back online.

Ad Chrome, the problem persists if you add the page to your Home screen as a web app.
The page will never reconnect in this case.


RE: Strange behavior after connection change - Thomas - 22.02.2017

Sorry, but this is really annoying. For some reason my VPN had disconnected when I was doing some settings in the building. The visualisation was runnimg in fullscreen so I didn'd noticed the VPN state change.
Wouldn't be really possible to show a small "you're offline' message somewhere in case I don't know for example there was no traffic between the client and LM in the last minute?


RE: Strange behavior after connection change - admin - 23.02.2017

Add this to Custom CSS:
Code:
.offline {
  position: absolute;
  z-index: 9999;
  top: 10px;
  right: 10px;
  padding: 10px;
  background-color: rgba(255, 0, 0, 0.5);
}

And this to Custom JS:
Code:
$(function() {
  if (typeof localbus !== 'undefined') {
    var offline = $('<div class="hide offline"></div>')
      .text('No connection')
      .appendTo('body');

    setInterval(function() {
      offline.toggleClass('hide', !!localbus.ws);
    }, 1000);
  }
});



RE: Strange behavior after connection change - Erwin van der Zwart - 23.02.2017

Hi Admin,

Will this be default included in the next FW with a enable/disable parameter in the vis config?

BR,

Erwin


RE: Strange behavior after connection change - admin - 23.02.2017

Not yet decided Smile


RE: Strange behavior after connection change - Erwin van der Zwart - 23.02.2017

Hi Admin,

Just tested it, but if you decide to include it default in the FW maybe a bootbox would be better noticed then a div in the visu.

Please take that into account when making your decicion (;

BR,

Erwin


RE: Strange behavior after connection change - mlaudren - 23.02.2017

hmm, Don't work for me.
I have the message always display event if connected...
Maybe I did something wrong, but don't know what.

I tried on hL, latest FW. Will try later on LM.

One question about the JS.
The loop is true untill disconnection so after 1s the hide class is remove?


RE: Strange behavior after connection change - admin - 23.02.2017

There's no loop but a timer which runs every second.


RE: Strange behavior after connection change - Erwin van der Zwart - 23.02.2017

Hi,

I have same on HL, showed even when connected, will check tonight why..

BR,

Erwin


RE: Strange behavior after connection change - Thomas - 23.02.2017

Randomly works. My observation is it depends on disconnection type. For example if the disconnection is triggered by sleeping of the mobile phone then the message is not shown.


RE: Strange behavior after connection change - admin - 24.02.2017

It won't happen instantly anyway. For example, if you disconnect the Ethernet cable from the device it will take some time for the OS/browser to report a connection error.


RE: Strange behavior after connection change - Thomas - 24.02.2017

Hi Admin
It's correct the messagebox is not shown immediately. But believe me I've an Android 4.2.2 device at my desk with Chrome 55 installed on, connected via Ethernet cable. So I can simply unplug it. I tried different users (under both touch and user modes) but I've never seen the "Offline" message at this device.
I have been waiting for more than 10 minutes for the message.
I tried to install Opera browser to this device. Here I saw the message only once - when I was logged out.
There's no proxy server on the device. I really don't know why the message hasn't been shown.