installing evok manually

spudgunman
Posts: 9
Joined: Sat May 30, 2015 9:03 am

installing evok manually

Postby spudgunman » Sun Jun 21, 2015 10:37 am

if you are like me and found the install-evok.sh to not be acceptable to your environment here is the quick and dirty you need to know. it would be nice if this team opened the wiki documentation and let people make this product better documented rather then just posts.

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
rudyvan
Posts: 3
Joined: Sat Oct 10, 2015 10:32 pm

Re: installing evok manually

Postby rudyvan » Sat Oct 10, 2015 10:40 pm

Hello,

i did the manual installation, step by step as detailed.
The board is listed in the I2C, the services are started, but when i use a browser to approach the board i got the following message:
ERR_CONNECTION_REFUSED

Any idea why that may be?

when i use the Python using JsonRPC program example, i get a similar error (see below):

extract:
s.relay_set(1,1)
File "/usr/local/lib/python3.4/site-packages/jsonrpclib/jsonrpc.py", line 639, in __call__
return self.__send(self.__name, args)
File "/usr/local/lib/python3.4/site-packages/jsonrpclib/jsonrpc.py", line 523, in _request
response = self._run_request(request)
File "/usr/local/lib/python3.4/site-packages/jsonrpclib/jsonrpc.py", line 556, in _run_request
verbose=self.__verbose
File "/usr/local/lib/python3.4/xmlrpc/client.py", line 1131, in request
return self.single_request(host, handler, request_body, verbose)
File "/usr/local/lib/python3.4/site-packages/jsonrpclib/jsonrpc.py", line 361, in single_request
self.send_request(connection, handler, request_body, verbose)
File "/usr/local/lib/python3.4/site-packages/jsonrpclib/jsonrpc.py", line 400, in send_request
self.send_content(connection, request_body)
File "/usr/local/lib/python3.4/site-packages/jsonrpclib/jsonrpc.py", line 425, in send_content
connection.endheaders()
File "/usr/local/lib/python3.4/http/client.py", line 1086, in endheaders
self._send_output(message_body)
File "/usr/local/lib/python3.4/http/client.py", line 924, in _send_output
self.send(msg)
File "/usr/local/lib/python3.4/http/client.py", line 859, in send
self.connect()
File "/usr/local/lib/python3.4/http/client.py", line 836, in connect
self.timeout, self.source_address)
File "/usr/local/lib/python3.4/socket.py", line 509, in create_connection
raise err
File "/usr/local/lib/python3.4/socket.py", line 500, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused[/code]
tomas_hora
Site Admin
Posts: 298
Joined: Wed Oct 29, 2014 9:56 am

Re: installing evok manually

Postby tomas_hora » Mon Oct 12, 2015 7:41 am

Hello,

try shutting the evok service down by service evok stop or by kill command with the process id. Then run /opt/evok/evok.py and past the output here so we get more detailed info...

Thanks!
rudyvan
Posts: 3
Joined: Sat Oct 10, 2015 10:32 pm

Re: installing evok manually

Postby rudyvan » Tue Oct 13, 2015 5:07 pm

Dear Tomas,

i am working with python3.4 and therefore issues with evok.py because i think my 2.7 environment is not default env.
I will start from a fresh debian install and first get evok running before i try installing python3.4.
Should i have problems, then i come back online.

Kind Regards,
Rudy
rudyvan
Posts: 3
Joined: Sat Oct 10, 2015 10:32 pm

Re: installing evok manually

Postby rudyvan » Tue Oct 13, 2015 9:01 pm

Dear Tomas,

took a fresh install from debian (2015/09/24) and it worked :D !
#had to deviate from yr installation script as follows:
#had to install the i2c-tools:
sudo apt-get install i2c-tools
#had to add sudo:
sudo makefile # for pigpiod

Thanks!
Rudy
chuckhinds
Posts: 8
Joined: Sat Jan 23, 2016 11:03 pm

Re: installing evok manually

Postby chuckhinds » Sat Feb 13, 2016 4:52 am

Dear Rudy and Thomas,

I has a similar problem with tornado, toro, and jsonrpclib getting loaded into Python 3.5. I got around this problem by changing the following line in install-evok.sh file:
"pip install tornado toro jsonrpclib"
to
"/usr/bin/pip-2.7 install tornado toro jsonrpclib"

It forced the install to Python 2.7 libraries

I updated build-essentials and python-dev for 2.7 (and all other versions) first:
"sudo apt-get install build-essential python-dev"

Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 2 guests