Giter VIP home page Giter VIP logo

pickr's Introduction

pickr

A flickr photo frame for raspberry pi with motion detection.

The frame connects to 1 or more flickr accounts and displays photos in a random order. It also supports connectivity with a PIR (passive infrared) sensor and automatically pauses photo viewing until someone re-enters the room (the screen is put to sleep).

Installation

Linux (with wifi and ssh enabled)

  • Insert SD Card in linux box
    • df -h to see what's mounted
    • download raspbian wget https://downloads.raspberrypi.org/raspbian_lite_latest
    • sudo dd bs=4M if=raspbian_lite_latest of=/dev/sdb conv=fsync
    • place a file ssh in /boot partition of the SD card
    • vi /etc/wpa_supplicant/wpa_supplicant.conf
network={
    ssid="testing"
    psk="testingPassword"
}

node.js & pickr code

wget https://nodejs.org/dist/v4.2.4/node-v4.2.4-linux-armv6l.tar.gz
sudo mv node-v4.2.4-linux-armv6l.tar.gz /opt
cd /opt
sudo tar -xzf node-v4.2.4-linux-armv6l.tar.gz
sudo mv node-v4.2.4-linux-armv6l nodejs
sudo rm node-v4.2.4-linux-armv6l.tar.gz
sudo ln -s /opt/nodejs/bin/node /usr/bin/node
sudo ln -s /opt/nodejs/bin/npm /usr/bin/npm
sudo apt-get install git
cd ~
git clone https://github.com/SrGrieves/pickr.git
cd pickr/config
vi local.json
{
  "api_key": "BBB",
  "secret": "AAA",
  "user_id": "XYZ@N01",
  "access_token": "XXX",
  "access_token_secret": "XXX",
  "users": ["AAA@N02", "BBB@N02"],
  "prefix": null,
  "dailySleepAtMinutes": [],
  "dailyWakeAtMinutes": []
}
npm i
configure NODE_JS_HOME in /etc/profile
sudo npm i nodemon --global

Setup systemctl service

sudo vi /lib/systemd/system/pickr.service
  [Unit]
  Description=pickr flickr photo frame source
  Documentation=https://github.com/SrGrieves/pickr
  After=network.target
  
  [Service]
  Environment=NODE_PORT=3001
  Type=simple
  User=pi
  ExecStart=/usr/bin/node /home/pi/pickr/app.js
  
  [Install]
  WantedBy=multi-user.target

sudo systemctl daemon-reload
sudo systemctl start pickr
sudo systemctl enable pickr

Chromium

Chromium is used to view images

sudo apt-get install -y chromium-browser ttf-mscorefonts-installer unclutter x11-xserver-utils matchbox-window-manager xinit

Setup autologin and autostart

sudo raspi-config` -> Boot Options -> Console Autologin
vi .xinitrc
  while true; do
  	# Clean up previously running apps, gracefully at first then harshly
  	killall -TERM chromium 2>/dev/null;
  	killall -TERM matchbox-window-manager 2>/dev/null;
  	sleep 2;
  	killall -9 chromium 2>/dev/null;
  	killall -9 matchbox-window-manager 2>/dev/null;
  
  	# Disable DPMS / Screen blanking
  	xset -dpms
  	xset s off
  
  	# Start the window manager (remove "-use_cursor no" if you actually want mouse interaction)
  	matchbox-window-manager -use_titlebar no -use_cursor no &
  
  	# Start the browser (See http://peter.sh/experiments/chromium-command-line-switches/)
  	#until [ $(systemctl is-active pickr) == "active"  ]; do
          #	echo -n .
          #	sleep 2
  	#done
  	#sleep 10
  	echo "Go for photo viewing!"
  	chromium --noerrdialogs --kiosk http://localhost:8080/viewer --incognito --v=1	
  	#midori -e Fullscreen -a http://localhost:8080/viewer
  	#WEBKIT_DISABLE_TBS=1 epiphany -a --profile /home/alarm/.config http://localhost:8080/viewer
  	
  done;

vi .bashrc
  ...
  if [ -z "$SSH_CLIENT" ]
  then
    startx -- -nocursor &> ~/startx.out
  fi

pickr's People

Contributors

marrrrko avatar

Watchers

 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.