marvin

package module
v0.0.0-...-ee677a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 11, 2013 License: MIT Imports: 16 Imported by: 0

README

Marvin

Marvin is a character for your home that enhances your life. Marvin is software that runs on a beaglebone along with a cape that contains a number of added sensors (available upon request).

This github repository contains Marvin's software. Marvin currently has the following abilities:

  • to interact via a web interface
  • to control hue light bulbs
  • to detect motion via its motion sensor
    • turn on nightlights upon sensing motion when in sleep mode
    • track history of motion
  • to detect ambient light levels via its light sensor
    • turn on lights when it gets dark if in awake mode
  • to track and key off of activity
    • sleeping causes Marvin to turn off ligths and turn on motion triggered nightlights
    • waking causes Marvin to slowly fade on lights (AKA sunrise)
  • to schedule lighting or activity transitions for different times of the day and week
  • to turn on and off various behaviours
    • nightlights switch for turning off motion triggered nightlights
    • schedule switch for turning off schedule
  • to detect presence

Components

  • marvin - package containing core functionality
  • marvin/web - package containing web interface
  • marvin/marvin - package containing program

Install Build Status

get ubuntu

If you are installing Marvin on your BeagleBone we've been using 13.04 from ARMhf.

install build tools
sudo apt-get install gcc g++ make mercurial
install latest golang

Marvin is written in Go so you will need a Go environment to build and install it. You will probably want to put the GOPATH and GOROOT environment variables in your ~/.profile.

hg clone -u release https://code.google.com/p/go
sudo mv go /opt/go
cd /opt/go
./all.bash
mkdir $HOME/go
export GOPATH=$HOME/go
export GOROOT=/opt/go
install latest nodejs

Marvin's needs a nodejs environment for managing external javascript and css dependencies using Bower.

wget http://nodejs.org/dist/v0.10.13/node-v0.10.13.tar.gz
tar xvfz node-v0.10.13.tar.gz
cd node-v0.10.13
./configure --without-snapshot
sudo make install
install marvin
go get -v -u github.com/eikeon/marvin/marvin
export MARVIN_HOME=$GOPATH/src/github.com/eikeon/marvin
export PATH=$MARVIN_HOME/web/node_modules/.bin:$PATH
pushd $MARVIN_HOME/web; make install; popd
sudo cp conf/marvin.json /etc/marvin.json
sudo cp conf/marvin.conf /etc/init/marvin.conf
sudo start marvin
# point browser at http://{your-hostname}:8000
Other Marvin channels

Marvin Magazine

Marvin

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Marvin

type Marvin struct {
	Hue            hue.Hue
	Activities     map[string]*activity
	Activity       string
	Motion         bool
	DayLight       bool
	LastTransition string
	Present        map[string]bool
	Switch         map[string]bool
	Schedule       scheduler.Schedule
	Messages       []string
	States         map[string]interface{}
	Transitions    map[string]struct {
		Switch   map[string]bool
		Commands []struct {
			Address string
			State   string
		}
	}
	StatHatUserKey string
	StartedOn      time.Time
	MotionOn       time.Time

	RecentMessages cb
	// contains filtered or unexported fields
}

func NewMarvinFromFile

func NewMarvinFromFile(path string) (*Marvin, error)

func (*Marvin) Do

func (m *Marvin) Do(who, what, why string)

func (*Marvin) GetActivity

func (m *Marvin) GetActivity(name string) *activity

func (*Marvin) LightSensor

func (m *Marvin) LightSensor() bool

func (*Marvin) Log

func (m *Marvin) Log() (messages []*Message)

func (*Marvin) MotionSensor

func (m *Marvin) MotionSensor() bool

func (Marvin) Register

func (sc Marvin) Register(c *chan State)

func (*Marvin) Run

func (m *Marvin) Run()

func (*Marvin) Save

func (m *Marvin) Save(path string) error

func (*Marvin) StateChanged

func (m *Marvin) StateChanged()

func (Marvin) Unregister

func (sc Marvin) Unregister(c *chan State)

func (*Marvin) UpdateActivity

func (m *Marvin) UpdateActivity(name string)

type Message

type Message struct {
	Hash string `db:"HASH"`
	When string `db:"RANGE"`
	Who  string
	What string
	Why  string
}

func NewMessage

func NewMessage(who, what, why string) Message

type State

type State Marvin

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL