Concepts behind my garage door opener
TODO(lmeneses): Eventually integrate a webcam to identify open or close.
This repo doesn't provide middleware for security or firebase-bolt for generating the rtdb rules file.
- Download raspbian with desktop image (img)
- Download & install Etcher
- Run Etcher to burn img onto sd card
- Preferences > Raspberry Pi Configuration
Localisation:
set Locale to en, usa, utf-8
set keyboard to usa, english
Interfaces:
SSH * Enable # Most important so you can login remotely
System:
Change hostname: garagelargedoor # Give a name to make it easy to identify on your network
reboot
- Change password of pi user:
passwd # Default is raspberry
sudo reboot
- Connect to wifi
- transfer files:
from linux client:
scp -r ./* pi@garagelargedoor:/home/pi/apps/garagedoor
from windows client
winscp and drag and drop the files into /home/pi/apps/garagedoor
- configure pi with ssh
from linux client:
ssh pi@garagelargedoor
from windows client: (use putty) Login as: pi password: whatever you set in passwd setup #5.
https://github.com/creationix/nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.7/install.sh | bash
sudo reboot
nvm ls-remote
nvm install node
nvm install v6.12.2
nvm use v6.12.2
nvm alias default v6.12.2
node -v
http://www.zdnet.com/article/raspberry-pi-extending-the-life-of-the-sd-card/
https://raspberrypi.stackexchange.com/questions/169/how-can-i-extend-the-life-of-my-sd-card
sudo swapoff --all
sudo apt-get remove dphys-swapfile
sudo -s
vi /etc/fstab
tmpfs /tmp tmpfs defaults,noatime,nosuid,size=100m 0 0
tmpfs /var/log tmpfs defaults,noatime,nosuid,mode=0755,size=100m 0 0
mount -a
exit # to leave sudo -s
npm install -g pm2
pm2 startup # copy the command and paste in terminal
pm2 startup systemd -u pi
cd /home/pi/apps/garagedoor
npm install
pm2 start app.js --watch
pm2 save
sudo reboot
pm2 list