Go to file
Georges 70c1e1becf Merge branch 'master' of github.com:syn2cat/pidor 2017-03-15 18:05:13 +01:00
433send Initial commit 2014-10-01 16:31:55 +02:00
doc electronic lock needs adaptation 2014-11-14 23:03:24 +01:00
rcswitch-pi :merged production code with code on github 2015-07-19 19:48:02 +02:00
scripts gpio is now in repo and in the path 2017-03-15 17:00:16 +00:00
systemfiles migrate from inittab to systemd 2017-03-13 22:26:45 +00:00
webserver Removed cruft. Give user feedback. 2014-10-01 16:35:11 +02:00
www migrate from inittab to systemd 2017-03-13 22:26:45 +00:00
.gitignore documented reinstall 2017-03-13 23:29:10 +01:00
README.txt rudimentary hardware doc 2017-03-15 18:04:57 +01:00


Pidor is controlling the state of Level2 on the website, spaceapi and twitter

This documentation is work in progress, sorry about that.

connect the doorlock relay to gpio 7
connect button of doorlock to gpio 11
connect the 433mhz transmitter to pin 2 (gpio 17)


put raspian image on SD card and put into rPi

ssh to pi@<ip address>
if that does not work, edit the SD card and put into etc/rc.local "/etc/init.d/ssh start"
sudo bash   # all is installed under root 
apt-get install php5-curl # for twitter
apt-get install git # for getting this
apt-get install wiringpi # for the buttons and stuff


cp -p systemfiles/sudoers.d/* /etc/sudoers.d/

mkdir /root/var    # kinda important
put your ssh key in git and on the pi's /root/.ssh

cd /root
git clone git@github.com:syn2cat/pidor.git
cd pidor
git config --global user.email "pidor@level2.lu"
git config --global user.name pidor

# set fixed IP at end of /etc/dhcpcd.conf
interface eth0
static ip_address=
static routers=
static domain_name_servers=

put discard (for fstrim) in fstab
/dev/mmcblk0p2  /               ext4    discard,defaults,noatime  0       1


put this in /etc/inittab (see example in systemfiles/inittab)
# pidor

cd systemfiles/
cp -p systemd/system/* /etc/systemd/system/
systemctl enable lockbutton.service beamerdetect.service ws4beamer_status.service peoplecounter-realtime.service caststatus.service
systemctl daemon-reload
systemctl start lockbutton.service beamerdetect.service ws4beamer_status.service peoplecounter-realtime.service caststatus.service

put the beamer IP into beamerip.txt
put the peoplecounter ip into peoplecounterip.txt
put entry for doorbuzz in /etc/hosts

ln lightcommander /usr/local/bin/    # this is quite important

fill in the crontab
* * * * * /root/pidor/scripts/dhcp2presency.sh
* * * * * /root/pidor/scripts/upd_status.sh > /run/spacestatus.out 2>&1

#needs an apache for the lights commander
apt-get install apache2 php5
cd ~/pidor/www && ./intallwebsite.sh
service apache2 restart

# download windos sound bytes to /root/win
# e.g. here http://joshlalonde.deviantart.com/art/Windows-XP-Sounds-158309567
mkdir /root/win
cd /root/win

If you have a chromecast, script to switch off if chromecast is iddle:
cd ~/pidor
git clone git@github.com:balloob/pychromecast.git
cd pychromecast
sudo apt-get install python-dev python-pip
sudo pip install --upgrade pip
sudo pip install -r requirements.txt