Autobahn Android - getting started Echo example - not receiving opening handshake

#1

Hi All, i’m new to Android and websockets, trying to get started with the websocket echo example. I have managed to set up the autobahn python websocket server, and got the browser example to work (i.e. browser connects to local websocket server and echo back to console).

I am getting stuck in the Autobahn android getting started example, not able to “receive opening handshake”. My log shows the following:

WebSocketReader: created

WS reader created and started

WebSocketReader: running

D/de.tavendo.autobahn.WebSocketWriter: created

D/de.tavendo.autobahn.WebSocketConnection: WS writer created and started

The next log step (as per the getting started tutorial) is: “opening handshake received”. But my code never gets to this point.

Any suggestions for how to solve this are much appreciated.

I am running OS X v10.8.4, Python 2.7.5, Autobahn v0.5.14 (set up with easy_install, tried upgrade, but does not upgrade to 0.5.2), and Android Studio.

The IP address of my websocket server is ws://localhost:9000. This is the only thing i have changed in the Android sample code.

0 Likes

#2

The IP address of my websocket server is ws://localhost:9000. This is
the only thing i have changed in the Android sample code.

"localhost" on your Android phone will resolve to your Android phone.

You need to connect your Android device via Wifi to the same network on which you Mac is running, and then provide the IP address of your Mac to the Android app. Something like ws://192.168.1.133:9000 given your Mac got 192.168.1.133 on the Wifi.

/Tobias

0 Likes

#3

Answer:

“localhost” on your Android phone will resolve to your Android phone.

You need to connect your Android device via Wifi to the same network on which you Mac is running, and then provide the IP address of your Mac to the Android app. Something like ws://192.168.1.133:9000 given your Mac got 192.168.1.133 on the Wifi.

···

On Friday, July 12, 2013 11:10:04 AM UTC-4, Zaki Patel wrote:

Hi All, i’m new to Android and websockets, trying to get started with the websocket echo example. I have managed to set up the autobahn python websocket server, and got the browser example to work (i.e. browser connects to local websocket server and echo back to console).

I am getting stuck in the Autobahn android getting started example, not able to “receive opening handshake”. My log shows the following:

WebSocketReader: created

WS reader created and started

WebSocketReader: running

D/de.tavendo.autobahn.WebSocketWriter: created

D/de.tavendo.autobahn.WebSocketConnection: WS writer created and started

The next log step (as per the getting started tutorial) is: “opening handshake received”. But my code never gets to this point.

Any suggestions for how to solve this are much appreciated.

I am running OS X v10.8.4, Python 2.7.5, Autobahn v0.5.14 (set up with easy_install, tried upgrade, but does not upgrade to 0.5.2), and Android Studio.

The IP address of my websocket server is ws://localhost:9000. This is the only thing i have changed in the Android sample code.

0 Likes