raspberry Pi opening the front door and playing videos
 
 
Go to file
Raphaël Vinot 910cb939e7 Make readme a md file 2016-03-31 21:29:57 +02:00
.gitignore add gitignor, sample secret and redme update 2015-07-19 22:01:13 +02:00
LICENSE Initial commit 2015-04-08 21:13:10 +02:00
README.md Make readme a md file 2016-03-31 21:29:57 +02:00
README.txt Make readme a md file 2016-03-31 21:29:57 +02:00
arpspoofdetect.sh removed flash by semaphore in redis. error code display on clock dial 2016-03-24 23:33:11 +01:00
buzzctrl.sh removed flash by semaphore in redis. error code display on clock dial 2016-03-24 23:33:11 +01:00
peoplecounter.sh prepare to show live people counter value 2016-01-25 23:30:15 +01:00
phone_notification_client.sh view live status of people counter on clock dial 2016-03-31 20:43:28 +02:00
presency.py prepare to show live people counter value 2016-01-25 23:30:15 +01:00
projectionscreen.sh added usage 2015-08-03 20:11:36 +02:00
redi.sh use redis to store process communication instead of kill/starting 2015-05-11 22:50:29 +02:00
secret.txt.sample add gitignor, sample secret and redme update 2015-07-19 22:01:13 +02:00
setneocolor.py view live status of people counter on clock dial 2016-03-31 20:43:28 +02:00
shutdownbutton.py shutdown utton now writes some syslog 2016-03-10 20:25:13 +01:00
spacestatus.py first commit based on running system 2015-04-08 22:16:20 +02:00
videoplayer.sh prepare to show live people counter value 2016-01-25 23:30:15 +01:00

README.md

doorbuzz

raspberry Pi opening the front door and playing videos the button has an RGB led to show status features:

  • button to push to open the door
  • LED ring of 60 neopixels showing the current clock
  • video player showing some default videos while the space is open
  • a shutdown button for a clean shutdown
  • watchdog

how to install

sudo vi /etc/xdg/lxsession/LXDE/autostart
remove screensaver
sudo apt-get install unclutter xdotool git-core screen imagemagick x11-xserver-utils
git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

mkdir -p /home/pi/.config/lxsession/LXDE/
cat > /home/pi/.config/lxsession/LXDE/autostart <<"EOF"
@xset s off
@xset -dpms
@xset s noblank
@unclutter -display :0 -noevents -grab
@sudo python ./doorbuzz/setneocolor.py
@./doorbuzz/buzzctrl.sh
@./doorbuzz/videoplayer.sh
@./doorbuzz/arpspoofdetect.sh
@sudo python ./doorbuzz/shutdownbutton.py
@./doorbuzz/phone_notification_client.sh
EOF
  • connect the button and LED to pins as shown in buzzctrl.sh
  • create a file "secret.txt" containing the http://user:pass@10.1.1.xx part of the URL
  • adapt the URL in buzzctrl.sh
  • adapt spaceapi URL in spacestatus.py
  • put .mp4 videos into ~pi/ and they will show when your hackerspace is open you can add videos and they will be taken into account automatically

when booting, the button led uses morsecode to send the low byte of the IP adress in decimal

phone_notification_client.sh communicates with pidor's doorbuzz_wrapper.sh to command the flash light

new: using redis to manage the 60 led circle

sudo apt-get install python-pip redis-server
sudo pip install redis

the redi.sh comes from here: https://github.com/crypt1d/redi.sh

cd ~
git clone https://github.com/jgarff/rpi_ws281x.git
cd rpi_ws281x
sudo apt-get install scons
scons
sudo scons

setup watchdog

sudo modprobe bcm2708_wdog
echo "bcm2708_wdog" | sudo tee -a /etc/modules


sudo apt-get install watchdog
sudo update-rc.d watchdog defaults

sudo sed -i 's/#\(watchdog-device\)/\1/
             s/#\(max-load-1\s\)/\1/
            ' /etc/watchdog.conf

sudo service watchdog start

Note: projectionscreen.sh is a standalone program called remotely by pidor because pidor knows the IP adress of the projector but doorbuzz has the RF remote connected. The remote command works with ssh, so install pidor's root pub key into ~pi/.ssh/authorized_keys

todo

  • create a config file
  • put more of the hardcoded values from code into parameters
  • make code resilient against missing commands (e.g. gpio not in PATH)
  • move script to run in screen instead starting from rc.local