Smarteon / loxone-java

Java implementation of the Loxone™ communication protocol (Web Socket)
BSD 3-Clause "New" or "Revised" License
15 stars 10 forks source link

WebSocket disconnected after token expiration period, even when token refreshed #65

Closed jimirocks closed 4 years ago

jimirocks commented 4 years ago

Here's what happens approx 12 hours after first succesful auth.

  1. loxone-java refreshes the token before get's invalid

    2019-12-15 06:33:53.724: Authentication is not usable => starting the authentication
    2019-12-15 06:33:53.754: Sending websocket message: jdev/sys/keyexchange/***
    2019-12-15 06:33:53.756: Sending websocket message: jdev/sys/getkey2/username
    2019-12-15 06:33:53.773: Message successfully processed.
    2019-12-15 06:33:53.784: Sending websocket message: jdev/sys/enc/***
    2019-12-15 06:33:53.804: Message successfully processed.
    2019-12-15 06:33:53.806: Got loxone token, valid until: 2019-12-15T18:33:54, seconds to expire: 43201
    2019-12-15 06:33:53.807: Scheduling token auto refresh in 42901 seconds
    2019-12-15 06:33:53.808: Authentication completed
  2. 30mins later get web socket is disconnected by miniserver and newly opened sockets are not working (miniserver never sends something back)

    2019-12-15 07:01:50.737: Sending websocket message: keepalive
    2019-12-15 07:02:34.065: Closed by remote end because of 1000: normally closed
    2019-12-15 07:02:34.071: Scheduling automatic web socket restart in 19 seconds
    2019-12-15 07:02:53.107: Opened
    2019-12-15 07:02:53.121: Sending websocket message: jdev/sys/keyexchange/***
    2019-12-15 07:02:53.123: Sending websocket message: jdev/sys/getkey2/username
    2019-12-15 07:04:53.108: Closed by local end because of 1006: The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-conne
    2019-12-15 07:04:53.112: Connection or authentication failed, retrying...
    2019-12-15 07:04:53.112: Connection or authentication failed, retrying...
    2019-12-15 07:04:53.141: Opened
    2019-12-15 07:04:53.156: Sending websocket message: jdev/sys/keyexchange/***
    2019-12-15 07:04:53.157: Sending websocket message: jdev/sys/getkey2/username
    2019-12-15 07:06:53.141: Closed by local end because of 1006: The connection was closed because the other endpoint did not respond with a pong in time. For more information check: https://github.com/TooTallNate/Java-WebSocket/wiki/Lost-conne
    2019-12-15 07:06:53.143: Connection or authentication failed, retrying...

    It worked with Loxone 10.2

jimirocks commented 4 years ago

It didn't reproduced..