example server and client not working on Arduino Yun

#1

I have finally gotten autobahn installed on my Arduino Yun, and here’s what the console echos when I run the example server from the getting started page:

root@peteyun:/mnt/sda1/arduino/www/test# python myserver.py

2013/11/23 22:02 -0400 [-] Log opened.

2013/11/23 22:02 -0400 [-] autobahn.websocket.WebSocketServerFactory starting on 9000

2013/11/23 22:02 -0400 [-] Starting factory <autobahn.websocket.WebSocketServerFactory instance at 0x7733e0d0>

and when I go to myclient.html, and open the js console in latest version of chrome (mac osx) the console shows the following:

connection closed (1006) myclient.html:17

4

  1. WebSocket is already in CLOSING or CLOSED state. myclient.html:27

  2. sendmyclient.html:27

  3. onclick

Why is my connection closed?

Thanks,

Pete

0 Likes

#2

Figured it out. I had to put myarduino.local:9000 as the localhost. where myarduino is the name of the arduino yun.

···

On Saturday, November 23, 2013 9:17:16 PM UTC-5, Peter Kalajian wrote:

I have finally gotten autobahn installed on my Arduino Yun, and here’s what the console echos when I run the example server from the getting started page:

root@peteyun:/mnt/sda1/arduino/www/test# python myserver.py

2013/11/23 22:02 -0400 [-] Log opened.

2013/11/23 22:02 -0400 [-] autobahn.websocket.WebSocketServerFactory starting on 9000

2013/11/23 22:02 -0400 [-] Starting factory <autobahn.websocket.WebSocketServerFactory instance at 0x7733e0d0>

and when I go to myclient.html, and open the js console in latest version of chrome (mac osx) the console shows the following:

connection closed (1006) myclient.html:17

4

  1. WebSocket is already in CLOSING or CLOSED state. myclient.html:27
  2. sendmyclient.html:27
  1. onclick

Why is my connection closed?

Thanks,

Pete

0 Likes

#3

    root@peteyun:/mnt/sda1/arduino/www/test# python myserver.py
    2013/11/23 22:02 -0400 [-] Log opened.
    2013/11/23 22:02 -0400 [-] autobahn.websocket.WebSocketServerFactory
    starting on 9000
    2013/11/23 22:02 -0400 [-] Starting factory
    <autobahn.websocket.WebSocketServerFactory instance at 0x7733e0d0>

You often get useful information when you turn debug logging on on your Autobahn server. In your case, you might have seen that there wasn't ever any client trying to connect in the first place, since your HTML/JS had the wrong server IP ..

/Tobias

0 Likes