0 Replies Latest reply on Oct 10, 2016 3:59 AM by 陈潇涵 RSS
    陈潇涵 Newbie

    AndroidSDK Issue when connecting to TW Server

    Hi all,

    When I use the TW and SERVER AndroidSDK downloaded from the platform to connect .

     

    Uri and appkey set successfully then connect server, Pop up a error box Timeout exceeded.


    This SDK code in addition to set URI and appkey also need to do what changes to the successful connection and the platform.


    Logcat has been circulating the contents of the print:


    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.client.connection.autobahn.AutobahnClientConnection.waitForConnection(AutobahnClientConnection.java:267) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.client.connection.autobahn.AutobahnClientConnection.sendBinaryMessage(AutobahnClientConnection.java:118) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.client.connection.autobahn.AutobahnClientConnection.sendBinaryMessage(AutobahnClientConnection.java:137) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.common.contexts.BaseContext.write(BaseContext.java:92) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.common.messaging.ThingworxMessage.writeContent(ThingworxMessage.java:34) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.common.endpoints.CommunicationEndpoint.sendConnectionAuthRequest(CommunicationEndpoint.java:519) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.client.endpoints.ClientCommunicationEndpoint.authenticateConnection(ClientCommunicationEndpoint.java:125) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.client.endpoints.ClientCommunicationEndpoint.refillConnections(ClientCommunicationEndpoint.java:214) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.common.endpoints.monitor.ConnectivityMonitorTask.dutyCycleOn(ConnectivityMonitorTask.java:135) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.common.endpoints.monitor.ConnectivityMonitorTask.run(ConnectivityMonitorTask.java:230) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out:     at java.lang.Thread.run(Thread.java:818) ~[na:0.0]

    10-09 01:52:06.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: INFO c.t.c.c.e.m.ConnectivityMonitorTask Client-EndpointMonitor-1 Endpoint reconnection was unsuccessful [name: EP_0, id: 0]

    10-09 01:52:07.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: DEBUG c.t.c.c.e.m.ConnectivityMonitorTask Client-EndpointMonitor-1 Entering duty cycle ON

    10-09 01:52:07.102 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: INFO c.t.c.c.e.m.ConnectivityMonitorTask Client-EndpointMonitor-1 Endpoint not connected [name: EP_0, id: 0]. Attempting [re]connect...

    10-09 01:52:07.118 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: DEBUG c.t.c.c.e.ClientCommunicationEndpoint Client-EndpointMonitor-1 Clearing endpoint authentication data [id: 0]

    10-09 01:52:07.118 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: INFO c.t.c.c.e.ClientCommunicationEndpoint Client-EndpointMonitor-1 Needed to refill connections on client endpoint [id: 0] : [active: 0, max: 1]

    10-09 01:52:07.119 15260-17739/com.thingworx.sdk.android.steamexample D/com.thingworx.communications.client.connection.autobahn.AutobahnConnectionThread: Connection construction thread created: 215

    10-09 01:52:07.119 15260-17739/com.thingworx.sdk.android.steamexample D/de.tavendo.autobahn.WebSocketConnection: WebSocket connection created.

    10-09 01:52:07.119 15260-17739/com.thingworx.sdk.android.steamexample I/System.out: INFO c.t.c.c.c.a.AutobahnClientConnection Thread-215 Created new AutobahnClientConnection: AutobahnClientConnection [id: 0-0]

    10-09 01:52:07.119 15260-17739/com.thingworx.sdk.android.steamexample I/System.out: DEBUG c.t.c.c.c.a.AutobahnClientConnection Thread-215 Autobahn attempting connect

    10-09 01:52:07.119 15260-17739/com.thingworx.sdk.android.steamexample I/System.out: TRACE c.t.c.c.c.a.AutobahnClientConnection Thread-215 Trying to connect to http://139.224.28.58:80/Thingworx/WS ...

    10-09 01:52:07.127 15260-17739/com.thingworx.sdk.android.steamexample I/System.out: ERROR c.t.c.c.c.a.AutobahnClientConnection Thread-215 Failed to connect to server.

    10-09 01:52:07.127 15260-17739/com.thingworx.sdk.android.steamexample I/System.out: de.tavendo.autobahn.WebSocketException: unsupported scheme for WebSockets URI

    10-09 01:52:07.127 15260-17739/com.thingworx.sdk.android.steamexample I/System.out:     at de.tavendo.autobahn.WebSocketConnection.connect(WebSocketConnection.java:175) ~[na:0.0]

    10-09 01:52:07.127 15260-17739/com.thingworx.sdk.android.steamexample I/System.out:     at de.tavendo.autobahn.WebSocketConnection.connect(WebSocketConnection.java:162) ~[na:0.0]

    10-09 01:52:07.127 15260-17739/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.client.connection.autobahn.AutobahnClientConnection.connect(AutobahnClientConnection.java:220) ~[na:0.0]

    10-09 01:52:07.127 15260-17739/com.thingworx.sdk.android.steamexample I/System.out:     at com.thingworx.communications.client.connection.autobahn.AutobahnConnectionThread.run(AutobahnConnectionThread.java:37) ~[na:0.0]

    10-09 01:52:07.127 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: INFO c.t.c.c.e.ClientCommunicationEndpoint Client-EndpointMonitor-1 Preparing new Connection Authentication Request: DispatchingClientEndpoint [id: 0, isConnected: false, open connections: 0, max connections: 1]

    10-09 01:52:07.128 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: DEBUG c.t.c.c.e.CommunicationEndpoint Client-EndpointMonitor-1 Sending connection authentication message, waiting for response [sync key: 8, message: AuthRequestMessage [requestId: 8, endpointId: -1, sessionId: -1, method: AUTHREQUEST]]

    10-09 01:52:07.128 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: TRACE c.t.c.c.c.a.AutobahnClientConnection Client-EndpointMonitor-1 Attempting to send binary message (waiting for connection to be established)...

    10-09 01:52:07.128 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: TRACE c.t.c.c.c.a.AutobahnClientConnection Client-EndpointMonitor-1 Thread 207 is blocked awaiting for the connection to open.

    10-09 01:52:17.130 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: ERROR c.t.c.c.e.ClientCommunicationEndpoint Client-EndpointMonitor-1 Refilling connections on [endpoint 0, uri: http://139.224.28.58:80/Thingworx/WS] failed : Timeout of 10 seconds exceeded for connection to open.

    10-09 01:52:17.137 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: ERROR c.t.c.c.e.ClientCommunicationEndpoint Client-EndpointMonitor-1 Exception refilling connections was:

    10-09 01:52:17.137 15260-16594/com.thingworx.sdk.android.steamexample I/System.out: java.util.concurrent.TimeoutException: Timeout of 10 seconds exceeded for connection to open.



    I have not been in contact with the development of Android so I hope someone can help me