Wednesday, January 20, 2016

RPI2 - Dashing Dashboard Installation Tutorial


Dashboard provide a quick view of information on the system. This can be a desktop application or web based. One such example on Raspberry Pi 2 is Dashing which is based on the Sinatra Framework and Ruby.

The Sinatra Framework from http://sinatrarb.com provides web application development quickly on Ruby. Example of installation on Ruby;

$ sudo gem install sinatra


Pre Installation checklist


  1. Raspbian Jessie
  2. Ruby


Installation of Dashboard on Dashing.

Step 1: Install Dashing.

$ sudo apt-get update
$ sudo apt-get install ruby-dev
$ sudo apt-get install ruby2.1-dev
$ sudo gem install bundler


Install Dashing 1.3.4 and create a new project called my_dashboard_project.

$ sudo gem install dashing



Step 2: Create a new project space

$ dashing new my_dashboard_project
$ cd my_dashboard_project
$ ls -l
total 36
drwxr-xr-x  6 pi pi 4096 Jan 20 12:34 assets
-rw-r--r--  1 pi pi  339 Jan 20 12:34 config.ru
drwxr-xr-x  2 pi pi 4096 Jan 20 12:34 dashboards
-rw-r--r--  1 pi pi  122 Jan 20 12:34 Gemfile
drwxr-xr-x  2 pi pi 4096 Jan 20 12:34 jobs
drwxr-xr-x  2 pi pi 4096 Jan 20 12:34 lib
drwxr-xr-x  2 pi pi 4096 Jan 20 12:34 public
-rw-r--r--  1 pi pi   65 Jan 20 12:34 README.md
drwxr-xr-x 11 pi pi 4096 Jan 20 12:34 widgets


Change your directory to my_dashboard_project and bundle gems

$ bundle

Display installed gems

$ bundle show

Step 3: Start the dashing server


$ dashing start

Point web browser location at http://localhost:3030/sample


Whats next?

There are additional widgets that can be installed and new dashboards can be created. Here is an example of adding a widget from dashing.

Installing Server Status Squares widget with GIST_ID = 9588819

$ dashing stop
$ dashing install 9588819

From server status squares widget, copy the file server_status_squares.erb to the dashing dashboard directory in the project created above.

$ cp server_status_squares.erb dashboards

Point web browser location at http://localhost:3030/server_status_squares






WIP

Reference:
Dashboard on PI
Tutorial on Sinatra: Sinatra docsJust do it, Singing with Sinatra.
Dashing: Shopify,

No comments: