Bokeh server 0.11.1 on Raspberry Pi 2

Hello,

I am trying to set up Bokeh on a Raspberry Pi 2 running Debian.

I got everythign set up (albeit not using Anaconda), and it does also work - more or less.

Simple charts and lines show up properly, yet the server examples (which I am after) do not work correctly.

I am looking at the timeout.py example for instance, which shows the graph upon first loading, but no timeout occur (no colored numbers appear).

Instead when reloading the page (and this applies to any other graph), I am getting an error message:

pi@raspberrypi:~ $ bokeh serve timeout.py --host=192.168.178.16

DEBUG:bokeh.server.tornado:Allowed Host headers: [‘192.168.178.16:80’]

DEBUG:bokeh.server.tornado:These host origins can connect to the websocket: [‘localhost:5006’, ‘192.168.178.16:80’]

DEBUG:bokeh.server.tornado:Patterns are: [(’/timeout/?’, <class ‘bokeh.server.views.doc_handler.DocHandler’>, {‘application_context’: <bokeh.server.application_context.ApplicationContext object at 0x749835f0>, ‘bokeh_websocket_path’: ‘/timeout/ws’}), (’/timeout/ws’, <class ‘bokeh.server.views.ws.WSHandler’>, {‘application_context’: <bokeh.server.application_context.ApplicationContext object at 0x749835f0>, ‘bokeh_websocket_path’: ‘/timeout/ws’}), (’/timeout/autoload.js’, <class ‘bokeh.server.views.autoload_js_handler.AutoloadJsHandler’>, {‘application_context’: <bokeh.server.application_context.ApplicationContext object at 0x749835f0>, ‘bokeh_websocket_path’: ‘/timeout/ws’}), (’/static/(.*)’, <class ‘bokeh.server.views.static_handler.StaticHandler’>)]

INFO:bokeh.command.subcommands.serve:Starting Bokeh server on port 5006 with applications at paths [’/timeout’]

DEBUG:bokeh.client.connection:Running state NOT_YET_CONNECTED

INFO:bokeh.client.connection:Failed to connect to server: HTTPError(599, ‘Timeout’, None)

DEBUG:bokeh.client.connection:transitioning to state DISCONNECTED

DEBUG:bokeh.client.connection:Stopping client loop in state DISCONNECTED due to True from connected_or_closed

ERROR:bokeh.application.application:Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x74983050>: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

File “session.py”, line 269, in push:

raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”) Traceback (most recent call last):

File “/usr/local/lib/python2.7/dist-packages/bokeh/application/handlers/code_runner.py”, line 71, in run

exec(self._code, module.__dict__)

File “/home/pi/timeout.py”, line 48, in

session = push_session(curdoc())

File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 63, in push_session

session.push(document)

File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 269, in push

raise IOError("Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)")

IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

INFO:tornado.access:200 GET /timeout (127.0.0.1) 20380.68ms

DEBUG:bokeh.server.tornado:[pid 18306] 0 clients connected

DEBUG:bokeh.server.tornado:[pid 18306] /timeout has 1 sessions with 1 unused

WARNING:tornado.access:404 GET /ws?bokeh-protocol-version=1.0&bokeh-session-id=5jM9XAqnsGLuvfVliiGfyX5BFYKHowBULdiCh7piEAoc (::1) 3.01ms

INFO:bokeh.server.views.ws:WebSocket connection opened

DEBUG:bokeh.server.views.ws:Receiver created for Protocol(u’1.0’)

DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol(u’1.0’)

INFO:bokeh.server.views.ws:ServerConnection created

DEBUG:bokeh.server.session:Sending pull-doc-reply from session ‘49eodvGdzyu5tskX1i8VwewITl4LyqvudRdXTLUrz6sK’

DEBUG:bokeh.server.tornado:[pid 18306] 1 clients connected

DEBUG:bokeh.server.tornado:[pid 18306] /timeout has 1 sessions with 0 unused

DEBUG:bokeh.server.tornado:[pid 18306] 1 clients connected

DEBUG:bokeh.server.tornado:[pid 18306] /timeout has 1 sessions with 0 unused

DEBUG:bokeh.server.tornado:[pid 18306] 1 clients connected

DEBUG:bokeh.server.tornado:[pid 18306] /timeout has 1 sessions with 0 unused

What I see in the browser upon first load is the chart with no graph:

Whenever I try to reload the page, I am getting a blank page instead, and there is the same error message in the console (cannot connect to server).

Is this a known issue?

Can anyone help me with that?

Thanks in advance,

C.

When reloading the page, the console shows the following:

DEBUG:bokeh.server.tornado:[pid 18306] /timeout has 1 sessions with 0 unused

INFO:bokeh.server.views.ws:WebSocket connection closed: code=1001, reason=None

ERROR:bokeh.application.application:Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x74983050>: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

File “session.py”, line 269, in push:

raise IOError(“Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)”) Traceback (most recent call last):

File “/usr/local/lib/python2.7/dist-packages/bokeh/application/handlers/code_runner.py”, line 71, in run

exec(self._code, module.__dict__)

File “/home/pi/timeout.py”, line 48, in

session = push_session(curdoc())

File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 63, in push_session

session.push(document)

File “/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py”, line 269, in push

raise IOError("Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)")

IOError: Cannot push session document because we failed to connect to the server (to start the server, try the ‘bokeh serve’ command)

INFO:tornado.access:200 GET /timeout (127.0.0.1) 25.38ms

INFO:tornado.access:304 GET /static/css/bokeh.min.css?v=25ce17349a0082e9eeac845e42a822ec (127.0.0.1) 29.85ms

INFO:tornado.access:304 GET /static/css/bokeh-widgets.min.css?v=3b73ec63df304369ffc9c7e5132463cd (127.0.0.1) 5.29ms

INFO:tornado.access:304 GET /static/js/bokeh.min.js?v=50ffae624cbe67773b5995270f946406 (127.0.0.1) 4.95ms

INFO:tornado.access:304 GET /static/js/bokeh-widgets.min.js?v=7cfd458197bc395bb09e9dc3b8ac7975 (127.0.0.1) 5.25ms

INFO:tornado.access:304 GET /static/js/bokeh-compiler.min.js?v=28af56ac5027aa8d0ab96086ec1da10b (127.0.0.1) 4.96ms

INFO:bokeh.server.views.ws:WebSocket connection opened

DEBUG:bokeh.server.views.ws:Receiver created for Protocol(u’1.0’)

DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol(u’1.0’)

INFO:bokeh.server.views.ws:ServerConnection created

DEBUG:bokeh.server.session:Sending pull-doc-reply from session ‘YiGw9rXOGAm0SVDfDWoAYs60mUaOuplse0kCsagjCSfI’

DEBUG:bokeh.server.tornado:[pid 18306] 1 clients connected

Hi Chris,

You've configured the server so that it is allowed to accept connections from requests reporting '192.168.178.16:80' as the HOST they are trying to reach. And you appear to be connecting from '192.168.178.16:80' as well. But the server itself is still listening on its default port 5006:

  INFO:bokeh.command.subcommands.serve:Starting Bokeh server on port 5006.

My first suggestion would be to try adding "--port=80" and see if that resolves your issue (or alternatively: changing to "--host=192.168.178.16:5006" and connecting to port 5006 in the browser).

I'm actually a bit surprised any thing shows up at all, I would expect only a blank page as you report on reloads.

Bryan

···

On Feb 23, 2016, at 6:09 AM, 'Christophe Leske' via Bokeh Discussion - Public <[email protected]> wrote:

Hello,

I am trying to set up Bokeh on a Raspberry Pi 2 running Debian.

I got everythign set up (albeit not using Anaconda), and it does also work - more or less.

Simple charts and lines show up properly, yet the server examples (which I am after) do not work correctly.

I am looking at the timeout.py example for instance, which shows the graph upon first loading, but no timeout occur (no colored numbers appear).

Instead when reloading the page (and this applies to any other graph), I am getting an error message:

pi@raspberrypi:~ $ bokeh serve timeout.py --host=192.168.178.16
DEBUG:bokeh.server.tornado:Allowed Host headers: ['192.168.178.16:80']
DEBUG:bokeh.server.tornado:These host origins can connect to the websocket: ['localhost:5006', '192.168.178.16:80']
DEBUG:bokeh.server.tornado:Patterns are: [('/timeout/?', <class 'bokeh.server.views.doc_handler.DocHandler'>, {'application_context': <bokeh.server.application_context.ApplicationContext object at 0x749835f0>, 'bokeh_websocket_path': '/timeout/ws'}), ('/timeout/ws', <class 'bokeh.server.views.ws.WSHandler'>, {'application_context': <bokeh.server.application_context.ApplicationContext object at 0x749835f0>, 'bokeh_websocket_path': '/timeout/ws'}), ('/timeout/autoload.js', <class 'bokeh.server.views.autoload_js_handler.AutoloadJsHandler'>, {'application_context': <bokeh.server.application_context.ApplicationContext object at 0x749835f0>, 'bokeh_websocket_path': '/timeout/ws'}), ('/static/(.*)', <class 'bokeh.server.views.static_handler.StaticHandler'>)]
INFO:bokeh.command.subcommands.serve:Starting Bokeh server on port 5006 with applications at paths ['/timeout']
DEBUG:bokeh.client.connection:Running state NOT_YET_CONNECTED
INFO:bokeh.client.connection:Failed to connect to server: HTTPError(599, 'Timeout', None)
DEBUG:bokeh.client.connection:transitioning to state DISCONNECTED
DEBUG:bokeh.client.connection:Stopping client loop in state DISCONNECTED due to True from connected_or_closed
ERROR:bokeh.application.application:Error running application handler <bokeh.application.handlers.script.ScriptHandler object at 0x74983050>: Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)
File "session.py", line 269, in push:
raise IOError("Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)") Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/bokeh/application/handlers/code_runner.py", line 71, in run
    exec(self._code, module.__dict__)
  File "/home/pi/timeout.py", line 48, in <module>
    session = push_session(curdoc())
  File "/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py", line 63, in push_session
    session.push(document)
  File "/usr/local/lib/python2.7/dist-packages/bokeh/client/session.py", line 269, in push
    raise IOError("Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)")
IOError: Cannot push session document because we failed to connect to the server (to start the server, try the 'bokeh serve' command)

INFO:tornado.access:200 GET /timeout (127.0.0.1) 20380.68ms
DEBUG:bokeh.server.tornado:[pid 18306] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 18306] /timeout has 1 sessions with 1 unused
WARNING:tornado.access:404 GET /ws?bokeh-protocol-version=1.0&bokeh-session-id=5jM9XAqnsGLuvfVliiGfyX5BFYKHowBULdiCh7piEAoc (::1) 3.01ms
INFO:bokeh.server.views.ws:WebSocket connection opened
DEBUG:bokeh.server.views.ws:Receiver created for Protocol(u'1.0')
DEBUG:bokeh.server.views.ws:ServerHandler created for Protocol(u'1.0')
INFO:bokeh.server.views.ws:ServerConnection created
DEBUG:bokeh.server.session:Sending pull-doc-reply from session '49eodvGdzyu5tskX1i8VwewITl4LyqvudRdXTLUrz6sK'
DEBUG:bokeh.server.tornado:[pid 18306] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 18306] /timeout has 1 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 18306] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 18306] /timeout has 1 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 18306] 1 clients connected
DEBUG:bokeh.server.tornado:[pid 18306] /timeout has 1 sessions with 0 unused

What I see in the browser upon first load is the chart with no graph:

Whenever I try to reload the page, I am getting a blank page instead, and there is the same error message in the console (cannot connect to server).

Is this a known issue?

Can anyone help me with that?

Thanks in advance,

C.

--
You received this message because you are subscribed to the Google Groups "Bokeh Discussion - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/a/continuum.io/d/msgid/bokeh/e69b407c-2bea-420f-8d8f-44d1a94f27f9%40continuum.io\.
For more options, visit https://groups.google.com/a/continuum.io/d/optout\.

My first suggestion would be to try adding “–port=80” and see if that resolves your issue (or alternatively: changing to “–host=192.168.178.16:5006” and connecting to port 5006 in the browser).

Hello Bryan,

and thank you for your answer. I tried both options - when only specifying the port 80, it works as it used to to (just showing up the graph). The second option (with specifying the port 5006) does not work at all.

I must add however that I tried to configure the nginx server as a proxy for bokeh. Yet I also stopped nginx for my tests.

In short: I never get any answer from the Raspberry Pi if it has host=192.168.178.16:5006 configured. JUst to make sure, the URL to call from the browser would then be “http://192.168.178.16:5006/timeout” - right?

Nothing shows up, and on the console, the connection request of the browser is not even recorded by the bokeh server… so something seems to block the connection.

pi@raspberrypi:~ $ sudo bokeh serve timeout.py --host=192.168.178.16:5006
DEBUG:bokeh.server.tornado:Allowed Host headers: [‘192.168.178.16:5006’]
DEBUG:bokeh.server.tornado:These host origins can connect to the websocket: [‘localhost:5006’, ‘192.168.178.16:5006’]
DEBUG:bokeh.server.tornado:Patterns are: [(‘/timeout/?’, <class ‘bokeh.server.views.doc_handler.DocHandler’>, {‘application_context’: <bokeh.server.application_context.ApplicationContext object at 0x7499c6f0>, ‘bokeh_websocket_path’: ‘/timeout/ws’}), (‘/timeout/ws’, <class ‘bokeh.server.views.ws.WSHandler’>, {‘application_context’: <bokeh.server.application_context.ApplicationContext object at 0x7499c6f0>, ‘bokeh_websocket_path’: ‘/timeout/ws’}), (‘/timeout/autoload.js’, <class ‘bokeh.server.views.autoload_js_handler.AutoloadJsHandler’>, {‘application_context’: <bokeh.server.application_context.ApplicationContext object at 0x7499c6f0>, ‘bokeh_websocket_path’: ‘/timeout/ws’}), (‘/static/(.*)’, <class ‘bokeh.server.views.static_handler.StaticHandler’>)]
INFO:bokeh.command.subcommands.serve:Starting Bokeh server on port 5006 with applications at paths [‘/timeout’]
DEBUG:bokeh.server.tornado:[pid 20459] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 20459] /timeout has 0 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 20459] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 20459] /timeout has 0 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 20459] 0 clients connected
DEBUG:bokeh.server.tornado:[pid 20459] /timeout has 0 sessions with 0 unused
DEBUG:bokeh.server.tornado:[pid 20459] 0 clients connected

Hello Bryan,

I really appreciate your help. Is there any official statement on Raspberry Pi support for bokeh?

The static graphs do all work, it is however the server stuff that I am interested in, I am supposed to draw realtime graphs, yet as described, none of the official examples do work for me on a Raspberry Pi 2.

I found this page here online, and am thinking about going back to bokeh v0.8.1 or 0.8.2 as it seems to work:
http://blog.cudmore.io/post/2015/03/05/bokeh-on-the-raspberry-pi/

Ideally I'd like to use the newest version of course, but if that doesn't work, I am fine with whatever works.