User Tools

Site Tools


chumbysoftware

This is an old revision of the document!


Update your Flukso

The Chumby software relies in part on the availability of the Flukso local interface. If you have a ”/tmp/sensor” directory with some sensor hashes in it, you're good to go. Otherwise, you need to update your Flukso Installation. See FluksoUpdate.

PLEASE NOTE: The current Flukso does not provide the local interface. It can be installed by replacing the LUA scripts in /usr/share/lua/flukso with the ones from the Flukso Git Repository. Then: “ln -s /tmp/sensor /www/sensor”. Stay tuned.

Get the software package

Installation of the Chumby Software

You need a recent version of the Chumby Software Image, as described here: ChumbyImageHowto. The image contains various Ruby scripts to retrieve data from external sources and exposes it to Flash frontends. All software is installed to /mnt/storage so that it runs from the internal SD card. By convention, this is the filesystem layout for our components:

/mnt/storage/usr                     # where all mysmartgrid components live
/mnt/storage/usr/etc                 # configuration files
/mnt/storage/usr/{bin|lib|...}       # the obvious unix filesystem layout

Some special files for initializing the environment:

/mnt/storage/environment.sh          # shellscript to set up the environment for interactive use
/mnt/storage/usr/etc/msg-init.rc     # init script to hook into userhook2

Setting up the environment for internal use

If you log into the Chumby via SSH, run

$ /mnt/storage/environment.sh

to get an interactive shell with an updated environment.

Configuring the daemon

The Ruby daemon “msg-chumby-daemon” retrieves the current power consumption from your Flukso. It depends on an configuration file which you need to adjust. A template can be found in ”/mnt/storage/usr/lib/ruby/gems/1.8/gems/msg-chumby-display-0.2.0/etc/msgchumbydaemonrc” (depending on the version of the gem). Copy it to ”/mnt/storage/usr/etc” and edit it to reflect your local Flukso settings. For example:

# These are the access parameters of the CC-HPC demo flukso - replace
# with your own parameters!
ACCESS_TOKEN: "bb8640e074de14b9d444be7b1359707f"
SENSOR_ID: "67e9fa794684e4902730be208e9d734e"
FLUKSO_LOCATION_METHOD: "static"
FLUKSO_HOST: "192.168.1.102"
FLUKSO_PORT: "80"
FLUKSO_LOCAL_ID: "d69779ec53a9323b695ee86b5328dd28"

Access token and sensor id are needed to retrieve longterm values from the website. The FLUKSO_* variables describe where the Flukso lives on the local LAN, and what sensor ID should be queried. Copy this template to ”/mnt/storage/usr/etc” and edit it.

Running the daemon

For interactive use, you can start the daemon like this:

# /mnt/storage/environment.sh
# msg-chumby-daemon -c /mnt/storage/usr/etc/msgchumbydaemonrc

The Flash Widgets

The widgets for presenting the current power consumption are distributed as a part of the Ruby gem. You can find them in ”/mnt/storage/usr/lib/ruby/gems/1.8/gems/msg-chumby-display-0.2.0/widget”. To run a widget manually, follow these steps:

# Kill the running control panel
/usr/chumby/scripts/stop_control_panel
# Run the desired widget
/usr/bin/chumbyflashplayer.x -i <path/to/widget>

Linking the software into the startup process

For demos I configure the Chumby so that the standard control panel is not started. Instead, before the control panel ist started, I run the widgets manually. You can adjust the userhook2 to do this, see http://wiki.chumby.com/mediawiki/index.php/Chumby_Rootdisk_-_RFS1_(analyzed). A startup script looks like this (usually stored in ”/mnt/storage/usr/etc/msg-init.rc”):

#!/bin/sh
# init script for the chumby demo mode - no integration in chumby runtime.
BASEPATH=/mnt/storage/usr
DAEMON_BIN=$BASEPATH/bin/msg-chumby-daemon
DAEMON_CONFIG=$BASEPATH/etc/msgchumbydaemonrc
FLASHPLAYER_BIN=/usr/bin/chumbyflashplayer.x
WIDGET_SWF=$BASEPATH/lib/ruby/gems/1.8/gems/msg-chumby-display-0.2.0/widget/currentpower/currentpower.swf

if [ -x $DAEMON_BIN ]; then
        if [ -e $DAEMON_CONFIG ]; then
                $DAEMON_BIN -c $DAEMON_CONFIG &
        else
                echo "Daemon config not found - aborting."
                exit
        fi
else
        echo "Daemon executable not found - aborting."
        exit
fi

# give the ruby stuff some time for startup
sleep 7

if [ -x $FLASHPLAYER_BIN ]; then
        if [ -e $WIDGET_SWF ]; then
                $FLASHPLAYER_BIN -i $WIDGET_SWF &
        else
                echo "Widget not found - aborting."
                exit
        fi
else
        echo "flashplayer executable not found - aborting."
        exit
fi

You can permanently activate the script like this:

# mkdir -p /psp/rfs1
# ln -s msg-init.rc /psp/rfs1/userhook2
chumbysoftware.1279096218.txt.gz · Last modified: 2012/10/30 10:40 (external edit)