Water Elf: Difference between revisions

From Open Source Ecology
Jump to navigation Jump to search
(Created page with "OK, I used Ubuntu 14.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 th...")
 
No edit summary
Line 3: Line 3:


First stage gets the arduino IDE installed to program the ESP8266 chip.
First stage gets the arduino IDE installed to program the ESP8266 chip.
#Visit https://www.arduino.cc/en/Main/Software and click through to
#Visit https://www.arduino.cc/en/Main/Software and click through to download the linux 64 bit software. 90 MB download - takes a few minutes.
download the linux 64 bit software. 90 MB download - takes a few
minutes.
#Click on the downloaded file and extract it somewhere.
#Click on the downloaded file and extract it somewhere.
#Open up a terminal (click on ubuntu icon (top left), type terminal
#Open up a terminal (click on ubuntu icon (top left), type terminalinto search box, click on it's icon).
into search box, click on it's icon).
#Type the following three commands into the terminal:
#Type the following three commands into the terminal:
#cd <directory where extracted>/arduino-1.6.6 - e.g. cd
#cd <directory where extracted>/arduino-1.6.6 - e.g. cd
Line 21: Line 18:
click OK.
click OK.
#Open the Tools, Board: "Arduino/Genuine Uno", Boards Manager
#Open the Tools, Board: "Arduino/Genuine Uno", Boards Manager
#In the search box at the top right type "ESP" and then select the
#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.
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.
#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
#When you plug in the board via the UART/FTDI thingy, you should

Revision as of 00:10, 10 November 2015

OK, I used Ubuntu 14.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.

  1. Visit https://www.arduino.cc/en/Main/Software and click through to download the linux 64 bit software. 90 MB download - takes a few minutes.
  2. Click on the downloaded file and extract it somewhere.
  3. Open up a terminal (click on ubuntu icon (top left), type terminalinto search box, click on it's icon).
  4. Type the following three commands into the terminal:
  5. cd <directory where extracted>/arduino-1.6.6 - e.g. cd

Downloads/arduino-1.6.6

  1. sudo chmod +x install.sh
  2. ./install.sh
  3. Now you should be able to find arduino IDE program from the ubuntu

icon - click on it to run the arduino IDE.

  1. Open File, then Preferences.
  2. In the Additional Board Manager URLs field put

http://arduino.esp8266.com/staging/package_esp8266com_index.json and click OK.

  1. Open the Tools, Board: "Arduino/Genuine Uno", Boards Manager
  2. 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.
  3. Now you can select Tools, Board - Choose the Adafruit HUZZAH ESP8266 board.
  4. 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.

  1. In the terminal type the following:
  2. cd ~
  3. sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/

trusty universe multiverse"

  1. sudo add-apt-repository "deb http://us.archive.ubuntu.com/ubuntu/

trusty-updates universe multiverse"

  1. echo -e "deb https://apt.dockerproject.org/repo ubuntu-trusty main"

| sudo tee -a /etc/apt/sources.list.d/docker.list

  1. sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys

58118E89F3A912897C070ADBF76221572C52609D

  1. sudo apt-get update && sudo apt-get install -y git python-dev

python-pip docker-engine (takes a couple of min)

  1. git clone https://github.com/hamishcunningham/fishy-wifi.git (this

takes a few min)

  1. cd fishy-wifi/ardesp/wegrow
  2. sudo pip install -U docker-compose (takes a minute)
  3. 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.

  1. cd ~/fishy-wifi/ardesp/wegrow/
  2. sudo pip install couchapp
  3. cd fishyapp
  4. 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.