Giter Site home page Giter Site logo

irrigation-pi-js's Introduction

irrigation-pi-js

Raspberry Pi Installation

Installing with WGET

Get into the raspberry / ssh [email protected]

Password: raspberry

  1. Download these bash files: wget http://german-cv.com/irrigation/setup.sh && wget http://german-cv.com/irrigation/git-pull-repository.sh && wget http://german-cv.com/irrigation/git-sshkey-setup.sh
Then run in this order

 2. sh setup.sh

 3. sh git-sshkey-setup.sh

 4. sh git-pull-repository.sh

Installing by .sh files

These are the files you'll download to your rapberry pi dir /home/pi/.
1. setup.sh
2. git-sshkey-setup.sh
3. git-pull-files.sh

setup.sh

	#!/bin/bash

	clear
	echo "The script starts now."
	sudo apt-get update
	echo "Installing Linux appt: build-essential npm git tree vim raspi-config"
	sudo apt-get install -y build-essential npm git tree vim raspi-config
	echo "Downloading nodejs"
	wget http://node-arm.herokuapp.com/node_latest_armhf.deb
	sudo dpkg -i node_latest_armhf.deb
	sudo rm node_latest_armhf.deb
	sudo su
	sudo npm install -y rpi-gpio cron twilio express --save
	sudo npm install express-generator -g
	echo 
	echo "::::::: DONE :::::::"

git-sshkey-setup.sh

	#!/bin/bash

	DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 

	echo "Creating keypair"
	ssh-keygen -t rsa -b 4096 -C "[email protected]"
	vim ~/.ssh/id_rsa.pub
	eval "$(ssh-agent -s)"
	ssh-add ~/.ssh/id_rsa
	echo "Copies the contents of the id_rsa.pub file to your clipboard"
	echo "In the upper-right corner of any page, click your profile photo, then click Settings."
	echo "In the user settings sidebar, click SSH and GPG keys."
	echo "Click New SSH key or Add SSH key."
	echo "go to https://help.github.com/articles/adding-a-new-ssh-key-to-your-github-account/"
	echo "And follow the instructions"

git-pull-repository.sh

	#!/bin/bash

	git init
	git config --global user.name "German Gonzalez"
	git config --global user.email [email protected]
	git remote add origin [email protected]:germancin/irrigation-pi-js.git
	git pull origin master
	git config branch.master.remote origin
	git config branch.master.merge refs/heads/master
	ls

Regular Installation

Get into the raspberry / ssh [email protected]

Password: raspberry

sudo apt-get update

*Optional: sudo apt-get upgrade (It will take like 30 - 40 minutes)

__Install esential libs for raspberry operation system*

sudo apt-get install -y build-essential npm git tree vim raspi-config

__Installing NodeJs

wget http://node-arm.herokuapp.com/node_latest_armhf.deb

sudo dpkg -i node_latest_armhf.deb

sudo rm node_latest_armhf.deb

__Get root permission

sudo su

__Installing some Node modules.

sudo npm install -y rpi-gpio cron twilio express --save

__Installing express framework skeleton globally.

sudo npm install express-generator -g

__Creating express project skeleton.

express forlder_project_name

cd forlder_project_name

sudo npm install

How to make run our script when boot?

Run

chmod 777 /etc/rc.local

vim /etc/rc.local

At the end of the file add

sudo node /home/pi/index.js

Make sure to change the permissions back to the rc.local
so is always an executable type of file.

sudo chmod u+x /etc/rc.local

Note: Add commands below the comment, but leave the line exit 0 at the end, then save the file and exit.

alt text

:::: Resources ::::


Generating a new SSH key for raspberry Pi.

https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

Setting a static ip address to Raspberry Pi.

https://github.com/germancin/irrigation-pi-js/wiki/Static-IP-for-Raspberry.

irrigation-pi-js's People

Contributors

germancin avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.