This is what we did to setup a few dashboards at platanus
- Raspberry Pi
- Dashing Service
- Wifi stick (optional)
| #!/usr/bin/env python | |
| import curses | |
| import curses.textpad | |
| import time | |
| stdscr = curses.initscr() | |
| #curses.noecho() | |
| #curses.echo() |
| !------------------------------------------------------------------------------- | |
| ! Xft settings | |
| !------------------------------------------------------------------------------- | |
| Xft.dpi: 96 | |
| Xft.antialias: false | |
| Xft.rgba: rgb | |
| Xft.hinting: true | |
| Xft.hintstyle: hintslight |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| # http://stackoverflow.com/questions/20211990/sending-data-curl-json-in-python | |
| import requests #pip install requests | |
| import simplejson as json #pip install simplejson | |
| url = "http://<ip-address>:3030" | |
| widget = "welcome" | |
| data = { "auth_token": "YOUR_AUTH_TOKEN", "text": "Python Greetings!!" } | |
| fullUrl = "%s/widgets/%s" % (url, widget) |
| #!/bin/bash | |
| # -------------------------------------------------------------------------------------------- | |
| # Installs Ruby using rbenv/ruby-build on the Raspberry Pi (Raspbian) | |
| # | |
| # Run from the web: | |
| # bash <(curl -s https://gist.githubusercontent.com/blacktm/8302741/raw/install_ruby_rpi.sh) | |
| # -------------------------------------------------------------------------------------------- | |
| # Set the Ruby version you want to install |
This is what we did to setup a few dashboards at platanus
| gevent | |
| wmctrl |
This is a instruction to patch the usb infrared toy driver into lirc sources. Most of the work is done by Peter Kooiman
Dashing job to subscribe to MQTT messages.
MQTT is a lightweight publish/subscribe messaging transport. This job allows Dashing to subscribe to these messages and send them as events. There is no associated widget as the data can take any form - commonly numbers, but not necessarily. The script as laid out below sends events with value, current (the same contents) and last values so can be plugged directly into the Numbers or Meter widgets using the data-id in the dashboard file. The send_event could easily be modified if required.
Add to Gemfile:
| // | |
| // Arduino serial-interface for controlling the ws2812 leds. The serial interface is based on the | |
| // Adalight protocol. The protocol is as follows: | |
| // [prefix][led count][checksum][red, green, blue]* | |
| // prefix := 'Ada' | |
| // led count := number of leds - 1 (uint16_t big endian) | |
| // checksum := led count high bit XOR led count low bit XOR 0x55 (uint8_t) | |
| // red, green, blue := channel intensity [0-255] (uint8_t) | |
| // | |