-
Notifications
You must be signed in to change notification settings - Fork 2
Master
In case you plan to use the Dashboard Controller with a Raspberry Pi and never used it before, we prepared a simple guide to set up a new Raspberry Pi.
The build needs some more memory than the Pi has by default. Simply type these to the console and let them do their job.
sudo mkdir -p /import/nas
sudo dd if=/dev/zero of=/import/nas/swap bs=1024 count=1048576
sudo losetup /dev/loop0 /import/nas/swap
sudo mkswap /dev/loop0
sudo swapon /dev/loop0
run “free -m”
and if you can see Swap, it was successful.
####Install mercurial to download the GO sources.
sudo apt-get update
sudo apt-get install -y mercurial gcc libc6-dev
You will need Go installed to run and/or compile the source code.
hg clone -u default https://code.google.com/p/go $HOME/go
cd $HOME/go/src
Choose one of these, ./make.bash without tests, ./all.bash with tests. Both will take some time to finish, around 70 minutes.
./make.bash
./all.bash
Set the environment variable. Note this is a temporary, by closing the terminal window your setting will be lost. If you want to make it permanent, put it in the end of the “~/.profile file” You might want to make it permanent if you need to compile the sources more than once
export PATH=$PATH:$HOME/go/bin
Clone this repository to the machine that will run the master.
If you would like to use the website with user authentication, install the following dependencies,
dashboard-controller$ go get github.com/gorilla/mux
dashboard-controller$ go get github.com/gorilla/securecookie
or type this to install all dependencies in one step.
dashboard-controller$ go get ./...
and specify the user name and password in a file named user_authentication_data.txt in the directory dashboard-controller/src/website/hash/. user_authentication_data.txt should only contain two lines -- username on the first line, password on the second line. You may refer to user_authentication_data_for_testing.txt as an example.
You need to build the binaries here, please note that if the master and the slave are on different OS you need to crosscompile, or install go to the slave too.
dashboard-controller$ go install master
dashboard-controller$ go install slave
After you installed master, you should configure the user authentication otherwise the master will fail. Create a file in the [project folder]/src/website/hash called user_authentication_data.txt which contains the following two lines:
[website username]
[website password]
If you want to access them from anywhere add it to the end of the “~/.profile file” by
export PATH=$PATH:$HOME/dashboard-controller/bin
Open the rc.local file to edit:
sudo nano /etc/rc.local
After the initial comments (lines beginning with '#') add the following lines
# Auto run dashboard controller master
master &
(If the [project folder]/bin is exported in the PATH in the “~/.profile file”)
or
# Auto run dashboard controller master
./home/pi/dashboard-controller/bin/master/master &
You can check if the setup was successful by rebooting the system, and in a terminal window run
pidof master
This command should return the process number of the master. At this point, you will be able to access the master website on the same device at http://localhost:5000/ -- replace "localhost" with the device's IP address to access the website from other devices on the same local area network. Other deployment options are left up to the user. Disabling the graphical interface might worth consideration as it takes lots of resources. You can disable it anytime by running
sudo raspi-config
and choose the third option 3. Enable Boot Desktop.. and choose 1. Console Text console, requiring login (default)
Copyright © 2014 Prezi Inc. | Contact