Tornado Errors in Browser Streaming Robot


#1

I’m trying to run the Browser Streaming Robot from Examples and am getting the following error:
Traceback (most recent call last):
File"./robot_web_server.py", line 79, in <module>
import sockjs.tornado
ImportError: No Module named sockjs.tornado

I installed a fresh GoPiGo Image dated 5-9-16 and tried to Install tornado using
pip install tornado, with no luck.
Any suggestions


#2

Good catch! Indeed, socks.js isn’t on the SD card.

To install it, type in the following (while connected to the Internet)
sudo pip install sockjs.tornado

This should install what’s needed.

Also, the tutorial needs to be updated, as the URL you need to connect to from the cell phone is now
http://dex.local:98

(or if you have changed your hostname, substitute dex for your chosen hostname)

Let me know if this helps!
CleoQc


#3

Hi.

I had the same problem as the original poster. Fixed that, but now I’m getting this error when I open the browser:

200 GET /robot_control/info (10.0.1.16) 11.80ms WebSocket Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/sockjs/tornado/transports/websocket.py", line 60, in on_message self.session.on_messages(msg) File "/usr/local/lib/python2.7/dist-packages/sockjs/tornado/session.py", line 419, in on_messages self.conn.on_message(msg) File "./robot_web_server.py", line 131, in on_message cameraStreamer.startStreaming() File "/home/pi/Desktop/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot/camera_streamer.py", line 96, in startStreaming [ "/usr/local/bin/raspberry_pi_camera_streamer" ] ) File "/usr/lib/python2.7/subprocess.py", line 710, in __init__ errread, errwrite) File "/usr/lib/python2.7/subprocess.py", line 1335, in _execute_child raise child_exception OSError: [Errno 2] No such file or directory SockJS connection closed

Seems the directory/file ‘/robot_control/info’ do not exist.

What’s in /robot_control/info? Where should it be located?

Thanks,
tracy


#4

Hi tracy,
Are you running the Dexter Industries Raspbian for robots image or your own image. I think /usr/local/bin/raspberry_pi_camera_streamer has the mjpg-streamer installed in that directory so it might .

-Karan


#5

Hi,

also facing the same problem - can not start video streaming.

When I key in:
$ sudo ./robot_web_server.py

It gives:
sockjs.tornado will use json module
/home/pi/Desktop/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot/www
Starting web server…

But no video can be seen from http://dex.local

Tried to install sockjs.tornado using: sudo pip install sockjs.tornado

it gives error:

Downloading/unpacking sockjs.tornado
Could not find any downloads that satisfy the requirement sockjs.tornado
Cleaning up…
No distributions at all found for sockjs.tornado
Storing debug log for failure in /root/.pip/pip.log

Please help. Thanks.


#6

If you are following the tutorial on the website, a key step seems to be missing

cd Desktop/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot
sudo bash browser_stream_setup.sh

It’s a fairly long install, time enough for a cup of coffee. But it installed everything I needed to run the project

Also note that if you’re using Raspbian for Robots, the hostname will be dex, and not raspberrypi like the tutorial mentions


#7

Thanks. I’ve installed the step you mentioned:

After rebooting, did the same thing as early to start the web server, again I can only still see it shows and stops at:

pi@dex:~/Desktop/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot
$ sudo ./robot_web_server.py
sockjs.tornado will use json module
/home/pi/Desktop/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot/www
Starting web server…

Really wonder why??


#8

I change to http://dex.local:98, now can see already. Thanks!


#9

Yes, it starts the web server, then it waits for someone to connect to the web server.
Are you all set, and it’s running now?


#10

Cannot reach the web server from my mac.
192.168.1.126:98 gives:
500: Internal Server Error

sudo python robot_web_server.py
sockjs.tornado will use json module
/home/pi/Desktop/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot/www
Starting web server…

When I go to my mac on the same wifi network as the pi, it cannot find the server.
Here is what was in the logfile:

DEBUG:tornado.general:sockjs.tornado will use json module
INFO:root:Starting web server…
ERROR:tornado.application:Uncaught exception GET / (192.168.1.118)
HTTPServerRequest(protocol=‘http’, host=‘192.168.1.126:98’, method=‘GET’, uri=’/’, version=‘HTTP/1.1’, remote_ip=‘192.168.1.118’, headers={‘Accept-Language’: ‘en-US,en;q=0.8’, ‘Accept-Encoding’: ‘gzip, deflate, sdch’, ‘Host’: ‘192.168.1.126:98’, ‘Accept’: ‘text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,/;q=0.8’, ‘User-Agent’: ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36’, ‘Connection’: ‘keep-alive’, ‘Upgrade-Insecure-Requests’: ‘1’})
Traceback (most recent call last):
File “/usr/local/lib/python2.7/dist-packages/tornado/web.py”, line 1467, in _execute
result = method(*self.path_args, **self.path_kwargs)
File “robot_web_server.py”, line 180, in get
self.render( webPath + “/index.html” )
File “/usr/local/lib/python2.7/dist-packages/tornado/web.py”, line 719, in render
html = self.render_string(template_name, **kwargs)
File “/usr/local/lib/python2.7/dist-packages/tornado/web.py”, line 823, in render_string
t = loader.load(template_name)
File “/usr/local/lib/python2.7/dist-packages/tornado/template.py”, line 427, in load
self.templates[name] = self._create_template(name)
File “/usr/local/lib/python2.7/dist-packages/tornado/template.py”, line 454, in _create_template
with open(path, “rb”) as f:
IOError: [Errno 2] No such file or directory: '/home/pi/Desktop/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot/www/index.html’
ERROR:tornado.access:500 GET / (192.168.1.118) 15.94ms
DEBUG:tornado.general:sockjs.tornado will use json module
INFO:root:Starting web server…

What are these other addresses in my network being referenced: 192.168.1.118?
The pi is at .126


#11

Glad to see you have your account back!

I just tried to install the browser project, to see what the issue might be.
As of now, it won’t install. One of the dependencies is no longer found: http://sourceforge.net/code-snapshots/svn/m/mj/mjpg-streamer/code/mjpg-streamer-code-182.zip

On my older GoPiGo, where the project was already installed, I have no issue with IP addresses being off. Did you try to run the installation in the last few days? And you did run
sudo bash browser_stream_setup.sh
like mentioned above?

This looks like an install gone wrong.

Cleo


#12

my install was sudo sh ./browser_stream_setup.sh - I had not seen any exceptions or failures during the setup but I can try it again.


#13

@salvideoguy: just noticed this in the log: IOError: [Errno 2] No such file or directory: ‘/home/pi/Desktop/GoPiGo/Software/Python/Examples/Browser_Streaming_Robot/www/index.html’. Can you check if this file exists and can you check the filepath from where you are trying to run the scripts from