serial_dashboard.app

serial_dashboard.app(baudrate=115200, maxcols=10, delimiter='comma', columnlabels='', timecolumn=None, timeunits='ms', rollover=400, glyph='lines', inputtype='ascii', fileprefix='_tmp', daqdelay=20, streamdelay=90, portsearchdelay=1000)

Returns a function that can be used as a Bokeh app.

The app can be launched using bokeh serve –show launchscript.py, from the command line where the contents of launchscript.py are:

import bokeh.plotting
import serial_dashboard

app = serial_dashboard.app()

app(bokeh.plotting.curdoc())

To launch the app programmatically with Python, do the following:

This function should only be used if you need to programmatically access the app builder, for example for using the dashboard within a Jupyter notebook. To launch a dashboard in its own browser window, use launch() instead.

Alternatively, if you want to launch in its own browser window programmatically, you can do the following.

from bokeh.server.server import Server
from bokeh.application import Application
from bokeh.application.handlers.function import FunctionHandler
import serial_dashboard

app = serial_dashboard.app()

app_dict = {'/serial-dashboard': Application(FunctionHandler(app))}
server = Server(app_dict, port=5006)
server.show('/serial-dashboard')
server.run_until_shutdown()
Parameters
  • port (int, default 5006) – Port at localhost for serving dashboard.

  • browser (str, default None) – Browser to use for dashboard. If None, uses OS default.

  • baudrate (int, default 115200) – Baud rate of serial connection. Allowed values are 300, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 74880, 115200, 230400, 250000, 500000, 1000000, 2000000.

  • maxcols (int, default 10) – Maximum number of columns of data coming off of the board.

  • delimiter (str, default "comma") – Delimiter of data coming off of the board. Allowed values are “comma”, “space”, “tab”, “whitespace”, “vertical line”, “semicolon”, “asterisk”, “slash”

  • columnlabels (str, default "") – Labels for columnbs using the delimiter specified with delimiter keyword argument.

  • timecolumn (int, default None) – Column (zero-indexed) of incoming data that specifies time

  • timeunits (str, default "ms") – Units of incoming time data. Allowed values are “none”, “µs”, “ms”, “s”, “min”, “hr”.

  • rollover (int, default 400) – Number of data points to be shown on a plot for each column. Allowed values are 100, 200, 400, 800, 1600, 3200.

  • glyph (str, default "lines") – Which glyphs to display in the plotter. Allowed values are “lines”, “dots”, “both”.

  • inputtype (str, default "ascii") – Whether input sent to the board is ASCII or bytes. Allowed values are “ascii”, “bytes”.

  • fileprefix (str, default "_tmp") – Prefix for output files

  • daqdelay (float, default 20.0) – Roughly the delay in data acquisition from the board in milliseconds. The true delay is a bit above 80% of this value.

  • streamdelay (int, default 90) – Delay between updates of the plotter and monitor in milliseconds.

  • portsearchdelay (int, default 1000) – Delay between checks of connected serial devices in milliseconds.