Water Elf: Difference between revisions
(added in upgrade step) |
No edit summary |
||
Line 1: | Line 1: | ||
[[File:gareth.jpg|400px]] | |||
OK, instructions are for ubuntu 12.04, (note - docker requires 64 bit), and timed | OK, instructions are for ubuntu 12.04, (note - docker requires 64 bit), and timed | ||
how long each stage took on my 5 year old laptop. | how long each stage took on my 5 year old laptop. |
Revision as of 01:33, 10 November 2015
OK, instructions are for ubuntu 12.04, (note - docker requires 64 bit), and timed how long each stage took on my 5 year old laptop.
First stage gets the arduino IDE installed to program the ESP8266 chip.
- Visit http://www.arduino.cc/download.php?f=/arduino-1.6.5-r5-linux64.tar.xz. 90 MB download - takes a few minutes.
- Click on the downloaded file and extract it somewhere.
- Open up a terminal (click on ubuntu icon (top left), type terminal into search box, click on it's icon).
- Type the following three commands into the terminal:
- cd <directory where extracted>/arduino-1.6.5-r5 - e.g. 'cd Downloads/arduino-1.6.5-r5'
- sudo chmod +x install.sh
- ./install.sh
- Now you should be able to find arduino IDE program from the ubuntu icon - click on it to run the arduino IDE.
- Open File, then Preferences.
- Set sketch folder to be /home/ubuntu/fishy-wifi/ardesp/Arduino (change ubuntu to match your username)
- In the Additional Board Manager URLs field put http://arduino.esp8266.com/staging/package_esp8266com_index.json and click OK.
- Open the Tools, Board: "Arduino/Genuine Uno", Boards Manager
- In the search box at the top right type "ESP" and then select the esp8266 by ESP8266 Community item and click install. 34MB download - takes 5 minutes.
- Now you can select Tools, Board - Choose the Adafruit HUZZAH ESP8266 board.
- When you plug in the board via the UART/FTDI thingy, you should see the port (Tools, Port) selected automatically.
Second stage, get couchdb and associated app installed.
- In the terminal type the following:
- cd ~
- sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/precise universe multiverse"
- sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/precise-updates universe multiverse"
- echo -e "deb https://apt.dockerproject.org/repo ubuntu-precise main" | sudo tee -a /etc/apt/sources.list.d/docker.list
- sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
- sudo apt-get update && sudo apt-get upgrade -y
- sudo apt-get install -y git python-dev python-pip docker-engine linux-image-generic-lts-trusty linux-headers-generic-lts-trusty xserver-xorg-lts-trusty libgl1-mesa-glx-lts-trusty (takes a couple of min)
- git clone https://github.com/hamishcunningham/fishy-wifi.git (this takes a few min)
- cd fishy-wifi/ardesp/wegrow
- sudo pip install -U docker-compose (takes a minute)
- DOCKER_HOST=localhost sudo docker-compose up (65MB takes a couple of min the first time)
Now the database should be up and running. Leave this terminal open but open another tab with control-shift-t. Type the following commands to get the app running.
- cd ~/fishy-wifi/ardesp/wegrow/
- sudo pip install couchapp
- cd fishyapp
- couchapp push fishydata
the app reports a URL to load e.g. http://127.0.0.1:5984/fishydata/_design/fishyapp/index.html open browser and load the URL given.
To actually program the waterelf sketch, open the fishy-wifi/ardesp/waterelf/waterelf.ino sketch with the arduino IDE, connect the device, hold the mode button (left one) whilst pressing and releasing the reset (right). In upload mode the red led glows dimly. Once in this mode, click on upload icon or from Sketch menu choose Upload.