First get I2C working - this assumes your Pi is updated and running 1.3 kernel
Code: Select all
sudo nano /etc/modules
add the following on separate lines in the file.
Code: Select all
i2c-bcm2708
i2c-dev
Open boot config.txt
Code: Select all
sudo nano /boot/config.txt
add the following
Code: Select all
dtparam=i2c1=on
dtparam=i2c_arm=on
save, then..
Code: Select all
sudo reboot
once back in your Pi will this command return a big matrix of numbers?
Code: Select all
sudo i2cdetect -y 1
if you see something like this below.. your track, you cant continue if you don't see this specifically that 20: 20 is important
Code: Select all
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- 18 -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
that worked correct? if not go fix it...
install and get the unipi evok package
first, if you dont have git
Code: Select all
sudo apt-get install git
now git the evok project and put it in your home directory
Code: Select all
cd ~
git clone https://github.com/UniPiTechnology/evok
get some foundation applications
Code: Select all
sudo apt-get install -y python-ow python-pip
sudo pip install tornado toro jsonrpclib
make and install PiGPIO from source
Code: Select all
cd~
git clone https://github.com/joan2937/pigpio PIGPIO
cd PIGPIO
make
make install
'install' the files into the OS
Code: Select all
cd ~/evok
sudo cp -r tornadorpc_evok /usr/local/lib/python2.7/dist-packages/
sudo cp -r evok/ /opt/
sudo mkdir -p /var/www/evok && sudo cp -r www/* /var/www/
sudo cp etc/evok.conf /etc/
sudo cp uninstall-evok.sh /opt/evok/
create services and set script executable
Code: Select all
sudo cp etc/init.d/evok /etc/init.d/
sudo cp etc/init.d/pigpiod /etc/init.d/
sudo chmod +x /etc/init.d/evok
sudo chmod +x /etc/init.d/pigpiod
sudo chmod +x /opt/evok/evok.py
set the services to start
Code: Select all
sudo update-rc.d pigpiod defaults
sudo update-rc.d evok defaults
you should go edit the ecok.conf because it uses port 80 by default and you dont want that
Code: Select all
sudo nano /etc/evok.conf
find the "port = 80" and change it to something like "port = 8181"
start the services now
Code: Select all
sudo service pigpiod start
sudo service evok start
then load up a browser and if you used my recommendation browse to http//PI.IP:8181
now you can mess around with it a little and see that you did something
next you likely want to read up on https://github.com/UniPiTechnology/evok#api-examples