Compare commits
18 Commits
Author | SHA1 | Date |
---|---|---|
Door Buzz | dab6ca239e | |
Door Buzz | 379d3476b2 | |
Door Buzz | 0294d7ed8f | |
Door Buzz | c2cf4632fc | |
doorbuzz | 74eeb693a9 | |
doorbuzz | d30d8bcd2b | |
Georges Herber | ecfca93d0d | |
Level2 DoorBuzz | de23e91533 | |
Georges Herber | 950267983a | |
Georges Herber | efe9414387 | |
Georges Herber | 7883890571 | |
Georges Herber | 03d2a4d9ff | |
Georges Herber | f78aab2f7f | |
Georges Herber | 06f9ca0f7b | |
Georges Herber | eb3efc964e | |
Raphaël Vinot | a2f99ab3c2 | |
Raphaël Vinot | 07af5bf48a | |
Raphaël Vinot | f1bf78ca91 |
77
README.txt
77
README.txt
|
@ -14,31 +14,67 @@ how to install
|
||||||
* The basics
|
* The basics
|
||||||
|
|
||||||
```
|
```
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get dist-upgrade
|
||||||
sudo apt-get install vim tmux
|
sudo apt-get install vim tmux
|
||||||
|
# now you get funky errors: "unexpected end of file or stream"
|
||||||
|
# fix it:
|
||||||
|
sudo apt-get clean
|
||||||
|
sudo apt-get --fix-broken install
|
||||||
|
|
||||||
|
* sometimes you ask yourself why the locales are not generated as needed
|
||||||
|
sudo sed -i "$(locale | awk -F= '$2!=""{gsub("\"","");if(!a[$2]++){print "s/# *" $2 "/" $2 "/;"}}' )" /etc/locale.gen
|
||||||
|
sudo locale-gen
|
||||||
```
|
```
|
||||||
|
* authorize boorduzz to connect to pidor and vice versa
|
||||||
|
|
||||||
|
```
|
||||||
|
mkdir /home/pi/.ssh
|
||||||
|
chmod go= /home/pi/.ssh /home/pi/.ssh/authorized_keys
|
||||||
|
echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDTVHK+yXSXHm42vr1RZ4sgKBFdkL3vi1u8BXYD/zkcbJkDSyWWRlU5q/qzEQYVk2zae870jcSQ5oTeoLZ99ujkuGltTCdzcCin24Aoig8ATyztFXoSHIfdUPCw5dbjhQXGWRPIkk1lSGU6mtLJRmVwLeY0rzVSQKdlspQlKBLwFBeIuACZQZfUzbIB2XiHIaoxcUja9fRfsZpo9TsWiqCMbseAj926qUgV2iotTQF7XLF/f+H8j2MR3iltKHqc35y/PiWy2doxRFHjW9I66Bit+ddOBtrsL6AzjxZP1DyoAc7jqhRpVazeXkMeNPMigpsV4rhLMEeVi2OqgTO7d3Jv root@pidor" >> /home/pi/.ssh/authorized_keys
|
||||||
|
```
|
||||||
|
copy the doorbuzz private key to /home/pi/.ssh/doorbuzz (backup of the key located on pidor at /root/.ssh/doorbuzz)
|
||||||
|
|
||||||
|
cp -p ~/.ssh/doorbuzz ~/.ssh/id_rsa
|
||||||
|
|
||||||
|
* get the package
|
||||||
|
cd /home/pi
|
||||||
|
git clone https://github.com/syn2cat/doorbuzz
|
||||||
|
|
||||||
|
cd doorbuzz
|
||||||
|
git config --global user.email "infolevel2.lu"
|
||||||
|
git config --global user.name "Door Buzz"
|
||||||
|
git remote set-url origin git@github.com:syn2cat/doorbuzz.git
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
* If you want to chroot into the image have a look at [this script](https://github.com/CIRCL/Circlean/blob/master/proper_chroot.sh)
|
* If you want to chroot into the image have a look at [this script](https://github.com/CIRCL/Circlean/blob/master/proper_chroot.sh)
|
||||||
|
|
||||||
* Remove screensaver from `/etc/xdg/lxsession/LXDE/autostart`
|
* Remove screensaver from `/etc/xdg/lxsession/LXDE/autostart `
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo vi /etc/xdg/lxsession/LXDE/autostart
|
sudo vi /etc/xdg/lxsession/LXDE/autostart
|
||||||
```
|
```
|
||||||
|
|
||||||
* Copy the files present in `root_files` accordingly on the file system
|
* Copy the files present in `root_files` accordingly on the file system
|
||||||
* Set the hostname: replace the content of `/etc/hostname` with doorbuzz
|
** sets IP without using dhcp
|
||||||
|
** sets hostname (replace the content of `/etc/hostname` with door-buzz)
|
||||||
|
** sets localhost alias
|
||||||
|
** removes screensaver in /etc/xdg/lxsession/LXDE/autostart
|
||||||
|
** configures lirc
|
||||||
|
|
||||||
* Install the suff
|
* Install the stuff
|
||||||
|
|
||||||
``` bash
|
``` bash
|
||||||
sudo apt-get install unclutter xdotool git-core screen imagemagick x11-xserver-utils
|
sudo apt-get install unclutter xdotool git-core screen imagemagick x11-xserver-utils
|
||||||
|
cd /home/pi
|
||||||
git clone git://git.drogon.net/wiringPi
|
git clone git://git.drogon.net/wiringPi
|
||||||
cd wiringPi
|
cd wiringPi
|
||||||
./build
|
./build
|
||||||
|
|
||||||
git clone https://github.com/syn2cat/doorbuzz
|
cat > /home/pi/.config/lxsession/LXDE-pi/autostart <<"EOF"
|
||||||
mkdir -p /home/pi/.config/lxsession/LXDE/
|
@lxpanel --profile LXDE-pi
|
||||||
cat > /home/pi/.config/lxsession/LXDE/autostart <<"EOF"
|
@pcmanfm --desktop --profile LXDE-pi
|
||||||
@xset s off
|
@xset s off
|
||||||
@xset -dpms
|
@xset -dpms
|
||||||
@xset s noblank
|
@xset s noblank
|
||||||
|
@ -62,14 +98,13 @@ when booting, the button led uses morsecode to send the low byte of the IP adres
|
||||||
|
|
||||||
`phone_notification_client.sh` communicates with pidor's `doorbuzz_wrapper.sh` to command the flash light
|
`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
|
* new: using redis to manage the 60 led circle
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo apt-get install python-pip redis-server
|
sudo apt-get install python-pip redis-server python-redis
|
||||||
sudo pip install redis neopixel
|
|
||||||
```
|
```
|
||||||
|
|
||||||
# the redi.sh comes from here: https://github.com/crypt1d/redi.sh
|
* redi.sh comes from here: https://github.com/crypt1d/redi.sh
|
||||||
|
|
||||||
```
|
```
|
||||||
cd ~
|
cd ~
|
||||||
|
@ -77,16 +112,15 @@ git clone https://github.com/jgarff/rpi_ws281x.git
|
||||||
cd rpi_ws281x
|
cd rpi_ws281x
|
||||||
sudo apt-get install scons swig python-dev
|
sudo apt-get install scons swig python-dev
|
||||||
scons
|
scons
|
||||||
sudo scons
|
|
||||||
cd python
|
cd python
|
||||||
sudo python setup.py install
|
sudo python setup.py install
|
||||||
```
|
```
|
||||||
|
|
||||||
# setup watchdog
|
* setup watchdog
|
||||||
|
|
||||||
```
|
```
|
||||||
sudo modprobe bcm2708_wdog
|
sudo modprobe bcm2835_wdt
|
||||||
echo "bcm2708_wdog" | sudo tee -a /etc/modules
|
echo "bcm2835_wdt" | sudo tee -a /etc/modules
|
||||||
|
|
||||||
|
|
||||||
sudo apt-get install watchdog
|
sudo apt-get install watchdog
|
||||||
|
@ -103,6 +137,21 @@ 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.
|
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`
|
The remote command works with ssh, so install pidor's root pub key into `~pi/.ssh/authorized_keys`
|
||||||
|
|
||||||
|
* setup lirc for AV-receiver remote control
|
||||||
|
|
||||||
|
this is the new way of doing lirc, doc is not yet tested to replay correctly. ymmv
|
||||||
|
|
||||||
|
copy (if not yet done) files from ~pi/doorbuzz/root_files/etc/lirc/ to /etc/lirc/
|
||||||
|
https://www.raspberrypi.org/forums/viewtopic.php?t=192891
|
||||||
|
```
|
||||||
|
sudo apt-get install lirc
|
||||||
|
sudo /bin/su -c "echo 'dtoverlay=lirc-rpi,gpio_out_pin=17,gpio_in_pin=21' >> /boot/config.txt"
|
||||||
|
echo "lirc_dev" >> /etc/modules
|
||||||
|
echo "lirc_rpi gpio_in_pin=21 gpio_out_pin=17" >> /etc/modules
|
||||||
|
systemctl start lidcd.socket lircd.service
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
todo
|
todo
|
||||||
====
|
====
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,6 @@ cd $(dirname "$0")
|
||||||
|
|
||||||
showleds() {
|
showleds() {
|
||||||
./redi.sh <<EOF
|
./redi.sh <<EOF
|
||||||
valid=no
|
|
||||||
neoaction=$1
|
neoaction=$1
|
||||||
neored=$2
|
neored=$2
|
||||||
neogreen=$3
|
neogreen=$3
|
||||||
|
@ -125,10 +124,10 @@ do
|
||||||
else
|
else
|
||||||
while wget -O - --timeout=1 --tries=1 $BUZZERSTATUSURL|grep '<relay1state>1</relay1state>'
|
while wget -O - --timeout=1 --tries=1 $BUZZERSTATUSURL|grep '<relay1state>1</relay1state>'
|
||||||
do
|
do
|
||||||
ledcolor 0 255 0
|
ledcolor 0 255 0
|
||||||
sleep 0.9
|
# sleep 0.2
|
||||||
ledcolor 0 255 255
|
ledcolor 0 255 255
|
||||||
sleep 0.1
|
# sleep 0.2
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
logger $0 "button push action finished"
|
logger $0 "button push action finished"
|
||||||
|
|
|
@ -0,0 +1,20 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
set -x
|
||||||
|
|
||||||
|
if [ -z "$1" ]; then
|
||||||
|
echo "Path to the mounted image needed."
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
|
CHROOT_PATH=${1}
|
||||||
|
|
||||||
|
if [ "$(id -u)" != "0" ]; then
|
||||||
|
echo "This script must be run as root" 1>&2
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# prepare fs archive
|
||||||
|
tar -cvpzf backup.tar.gz -C root_files/ .
|
||||||
|
tar -xzf backup.tar.gz -C ${CHROOT_PATH}/
|
|
@ -13,7 +13,7 @@ do
|
||||||
sleep 1
|
sleep 1
|
||||||
while true
|
while true
|
||||||
do
|
do
|
||||||
read -t 1 status <&"${COPROC[0]}"
|
read -t 1 status <&"${COPROC[0]}" 2>/dev/null
|
||||||
ret=$?
|
ret=$?
|
||||||
if [ $ret -eq 1 ] # no more coprocess
|
if [ $ret -eq 1 ] # no more coprocess
|
||||||
then
|
then
|
||||||
|
@ -32,14 +32,18 @@ do
|
||||||
done
|
done
|
||||||
ocounter="$counter"
|
ocounter="$counter"
|
||||||
echo "peoplecounter" >&"${COPROC[1]}"
|
echo "peoplecounter" >&"${COPROC[1]}"
|
||||||
read counter <&"${COPROC[0]}"
|
read -t 1 counter <&"${COPROC[0]}"
|
||||||
|
if [ $? -ne 0 ]
|
||||||
|
then
|
||||||
|
counter=-1
|
||||||
|
fi
|
||||||
if [ "$counter" != "$ocounter" ]
|
if [ "$counter" != "$ocounter" ]
|
||||||
then
|
then
|
||||||
logger $0 peoplecounter=$counter
|
logger $0 peoplecounter=$counter
|
||||||
echo "neocounter=$counter" | ./redi.sh
|
echo "neocounter=$counter" | ./redi.sh
|
||||||
fi
|
fi
|
||||||
echo "spacestatus" >&"${COPROC[1]}"
|
echo "spacestatus" >&"${COPROC[1]}"
|
||||||
read status <&"${COPROC[0]}"
|
read -t 1 status <&"${COPROC[0]}"
|
||||||
if ! [ "$status" = "open" ]; then # do nothing if space is closed
|
if ! [ "$status" = "open" ]; then # do nothing if space is closed
|
||||||
continue
|
continue
|
||||||
else
|
else
|
||||||
|
@ -56,10 +60,10 @@ do
|
||||||
fi
|
fi
|
||||||
logger $0 "phone status change detected"
|
logger $0 "phone status change detected"
|
||||||
if [ "$new_status" -eq 0 ]; then
|
if [ "$new_status" -eq 0 ]; then
|
||||||
echo "neoaction=flash" | ./redi.sh
|
printf "neoaction=flash\nvalid=yes\n" | ./redi.sh
|
||||||
echo "flashon" >&"${COPROC[1]}"
|
echo "flashon" >&"${COPROC[1]}"
|
||||||
else
|
else
|
||||||
echo "neoaction=pulse" | ./redi.sh
|
printf "neoaction=pulse\nvalid=yes\n" | ./redi.sh
|
||||||
echo "flashoff" >&"${COPROC[1]}"
|
echo "flashoff" >&"${COPROC[1]}"
|
||||||
fi
|
fi
|
||||||
# echo $new_status > ${run_file}
|
# echo $new_status > ${run_file}
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
|
||||||
# this gives number of people present via spaceapi
|
# this gives number of people present via spaceapi
|
||||||
# but if network down, this does not work
|
# but if network down, this does not work
|
||||||
# better get data direct from pidor or peoplecounter
|
# better get data direct from pidor or peoplecounter
|
||||||
|
|
|
@ -43,4 +43,3 @@ nohook lookup-hostname
|
||||||
interface eth0
|
interface eth0
|
||||||
static ip_address=10.2.113.9/24
|
static ip_address=10.2.113.9/24
|
||||||
static routers=10.2.113.1
|
static routers=10.2.113.1
|
||||||
static domain_name_servers=10.2.113.1
|
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
door-buzz
|
|
@ -0,0 +1,6 @@
|
||||||
|
127.0.0.1 localhost
|
||||||
|
::1 localhost ip6-localhost ip6-loopback
|
||||||
|
ff02::1 ip6-allnodes
|
||||||
|
ff02::2 ip6-allrouters
|
||||||
|
|
||||||
|
127.0.1.1 door-buzz
|
|
@ -0,0 +1,26 @@
|
||||||
|
########################################################
|
||||||
|
# /etc/lirc/hardware.conf
|
||||||
|
#
|
||||||
|
# Arguments which will be used when launching lircd
|
||||||
|
LIRCD_ARGS="--uinput"
|
||||||
|
|
||||||
|
# Don't start lircmd even if there seems to be a good config file
|
||||||
|
# START_LIRCMD=false
|
||||||
|
|
||||||
|
# Don't start irexec, even if a good config file seems to exist.
|
||||||
|
# START_IREXEC=false
|
||||||
|
|
||||||
|
# Try to load appropriate kernel modules
|
||||||
|
LOAD_MODULES=true
|
||||||
|
|
||||||
|
# Run "lircd --driver=help" for a list of supported drivers.
|
||||||
|
DRIVER="default"
|
||||||
|
# usually /dev/lirc0 is the correct setting for systems using udev
|
||||||
|
DEVICE="/dev/lirc0"
|
||||||
|
MODULES="lirc_rpi"
|
||||||
|
|
||||||
|
# Default configuration files for your hardware if any
|
||||||
|
LIRCD_CONF=""
|
||||||
|
LIRCMD_CONF=""
|
||||||
|
########################################################
|
||||||
|
|
|
@ -0,0 +1,19 @@
|
||||||
|
[lircd]
|
||||||
|
nodaemon = False
|
||||||
|
driver = default
|
||||||
|
device = /dev/lirc0
|
||||||
|
output = /var/run/lirc/lircd
|
||||||
|
pidfile = /var/run/lirc/lircd.pid
|
||||||
|
plugindir = /usr/lib/arm-linux-gnueabihf/lirc/plugins
|
||||||
|
permission = 666
|
||||||
|
allow-simulate = No
|
||||||
|
repeat-max = 600
|
||||||
|
uinput = True
|
||||||
|
|
||||||
|
[lircmd]
|
||||||
|
uinput = False
|
||||||
|
nodaemon = False
|
||||||
|
|
||||||
|
[modinit]
|
||||||
|
code = modprobe lirc_rpi
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
|
||||||
|
# Populated config files can be found at http://sf.net/p/lirc-remotes. The
|
||||||
|
# irdb-get(1) and lirc-setup(1) tools can be used to search and download
|
||||||
|
# config files.
|
||||||
|
#
|
||||||
|
# From 0.9.2 config files could just be dropped as-is in the lircd.conf.d
|
||||||
|
# directory and be included by this file.
|
||||||
|
|
||||||
|
include "lircd.conf.d/*.conf"
|
|
@ -0,0 +1,182 @@
|
||||||
|
# Please make this file available to others
|
||||||
|
# by sending it to <lirc@bartelmus.de>
|
||||||
|
#
|
||||||
|
# this config file was automatically generated
|
||||||
|
# using lirc-0.9.0-pre1(default) on Sun Mar 13 09:40:54 2016
|
||||||
|
#
|
||||||
|
# contributed by
|
||||||
|
#
|
||||||
|
# brand: /etc/lirc/pioneer.conf
|
||||||
|
# model no. of remote control:
|
||||||
|
# devices being controlled by this remote:
|
||||||
|
#
|
||||||
|
|
||||||
|
begin remote
|
||||||
|
|
||||||
|
name PIONEER
|
||||||
|
flags RAW_CODES|CONST_LENGTH
|
||||||
|
eps 30
|
||||||
|
aeps 100
|
||||||
|
|
||||||
|
gap 89162
|
||||||
|
|
||||||
|
begin raw_codes
|
||||||
|
|
||||||
|
name KEY_POWER
|
||||||
|
9109 4481 562 1674 587 518
|
||||||
|
589 1654 580 519 587 519
|
||||||
|
588 1647 589 517 588 1648
|
||||||
|
588 517 588 1655 557 542
|
||||||
|
588 1648 588 1648 588 518
|
||||||
|
563 1680 581 517 588 518
|
||||||
|
588 1648 587 518 589 1647
|
||||||
|
589 1654 582 517 563 542
|
||||||
|
588 517 590 1647 588 517
|
||||||
|
589 1648 587 524 582 518
|
||||||
|
587 1649 588 1648 588 1648
|
||||||
|
587
|
||||||
|
|
||||||
|
name KEY_POWER2
|
||||||
|
9103 4497 555 1672 588 519
|
||||||
|
562 1673 588 518 589 517
|
||||||
|
563 1672 588 518 564 1672
|
||||||
|
588 518 562 1674 569 537
|
||||||
|
587 1648 587 1650 587 518
|
||||||
|
588 1648 588 518 570 1666
|
||||||
|
588 1648 563 543 562 1674
|
||||||
|
587 1648 596 510 587 519
|
||||||
|
587 518 587 518 564 542
|
||||||
|
588 1648 587 519 563 542
|
||||||
|
595 1641 588 1648 564 1673
|
||||||
|
587
|
||||||
|
|
||||||
|
name KEY_CD
|
||||||
|
8455 4283 493 1590 534 516
|
||||||
|
534 1591 534 516 534 515
|
||||||
|
534 1595 531 515 535 1591
|
||||||
|
509 541 509 1590 534 517
|
||||||
|
534 1595 530 1590 535 515
|
||||||
|
535 1589 511 540 509 541
|
||||||
|
509 516 534 1595 530 1591
|
||||||
|
534 516 534 516 534 1591
|
||||||
|
534 516 534 1566 534 1590
|
||||||
|
535 515 535 515 535 1590
|
||||||
|
535 1590 534 516 539 1561
|
||||||
|
535
|
||||||
|
|
||||||
|
name KEY_DVD
|
||||||
|
8479 4243 556 1542 558 492
|
||||||
|
559 1565 560 490 560 490
|
||||||
|
560 1570 555 490 560 1565
|
||||||
|
560 490 560 1540 560 490
|
||||||
|
560 1564 565 1561 559 491
|
||||||
|
559 1565 560 490 560 1540
|
||||||
|
560 490 560 1570 555 490
|
||||||
|
560 490 560 490 576 473
|
||||||
|
561 1565 560 490 560 1570
|
||||||
|
530 490 560 1565 560 1565
|
||||||
|
560 1565 560 1569 531 514
|
||||||
|
536
|
||||||
|
|
||||||
|
name KEY_TAPE
|
||||||
|
8479 4246 554 1566 534 490
|
||||||
|
561 1564 560 490 560 490
|
||||||
|
561 1569 556 489 561 1564
|
||||||
|
561 489 560 1539 561 490
|
||||||
|
560 1565 561 1564 560 489
|
||||||
|
561 1565 560 489 561 1540
|
||||||
|
560 490 565 485 560 489
|
||||||
|
561 1564 561 489 561 489
|
||||||
|
561 489 561 489 561 1569
|
||||||
|
556 1564 535 1565 561 489
|
||||||
|
560 1565 560 1565 565 1560
|
||||||
|
535
|
||||||
|
|
||||||
|
name KEY_TUNER
|
||||||
|
8506 4214 560 1566 534 519
|
||||||
|
531 1565 560 490 560 489
|
||||||
|
561 1565 560 489 561 1565
|
||||||
|
565 484 561 1564 536 489
|
||||||
|
561 1564 561 1564 560 490
|
||||||
|
561 1564 561 489 561 1539
|
||||||
|
561 1564 561 1563 561 489
|
||||||
|
566 485 560 489 562 1564
|
||||||
|
560 490 561 489 560 489
|
||||||
|
561 489 536 1569 556 1564
|
||||||
|
561 1564 560 490 561 1564
|
||||||
|
560
|
||||||
|
|
||||||
|
name KEY_TV
|
||||||
|
8512 4211 558 1572 554 490
|
||||||
|
560 1540 560 490 560 490
|
||||||
|
559 1566 560 490 560 1570
|
||||||
|
555 490 560 1564 536 515
|
||||||
|
535 1565 560 1565 560 495
|
||||||
|
555 1564 561 490 560 490
|
||||||
|
560 490 560 1540 560 1565
|
||||||
|
564 486 560 489 561 489
|
||||||
|
560 491 559 1565 560 1565
|
||||||
|
561 489 561 494 555 1540
|
||||||
|
560 1565 560 1564 561 1565
|
||||||
|
560
|
||||||
|
|
||||||
|
name KEY_VCR
|
||||||
|
8510 4213 558 1565 560 490
|
||||||
|
560 1545 555 490 560 490
|
||||||
|
560 1564 561 490 560 1565
|
||||||
|
559 491 559 1566 560 489
|
||||||
|
535 1566 559 1565 560 490
|
||||||
|
560 1570 555 490 560 1566
|
||||||
|
559 1540 560 1565 560 1565
|
||||||
|
564 487 559 490 560 490
|
||||||
|
560 490 560 490 560 490
|
||||||
|
560 489 560 491 560 1544
|
||||||
|
556 1565 559 1565 570 1555
|
||||||
|
561
|
||||||
|
|
||||||
|
name KEY_VCR2
|
||||||
|
8504 4215 559 1567 559 490
|
||||||
|
560 1540 560 490 565 485
|
||||||
|
559 1566 560 490 560 1565
|
||||||
|
560 490 560 1565 560 494
|
||||||
|
556 1540 559 1566 559 491
|
||||||
|
559 1565 561 490 559 490
|
||||||
|
565 1561 559 1541 559 1565
|
||||||
|
560 490 560 490 560 490
|
||||||
|
560 495 555 1565 559 492
|
||||||
|
559 490 560 490 560 1565
|
||||||
|
535 1565 564 1560 561 1565
|
||||||
|
560
|
||||||
|
|
||||||
|
name KEY_VOLUMEUP
|
||||||
|
8505 4216 558 1567 559 490
|
||||||
|
560 1571 529 515 535 490
|
||||||
|
560 1565 560 490 560 1564
|
||||||
|
561 490 560 1565 560 490
|
||||||
|
560 1540 559 1566 560 490
|
||||||
|
559 1565 561 489 561 490
|
||||||
|
560 1564 561 489 561 1539
|
||||||
|
560 490 560 490 565 485
|
||||||
|
560 490 560 1566 559 490
|
||||||
|
560 1565 560 490 560 1569
|
||||||
|
531 1565 560 1565 560 1565
|
||||||
|
560
|
||||||
|
|
||||||
|
name KEY_VOLUMEDOWN
|
||||||
|
8510 4211 559 1566 560 494
|
||||||
|
556 1565 560 490 535 514
|
||||||
|
536 1565 560 490 560 1565
|
||||||
|
564 486 560 1564 561 490
|
||||||
|
560 1565 535 1565 559 490
|
||||||
|
560 1565 560 490 560 1565
|
||||||
|
560 1565 535 515 534 1566
|
||||||
|
565 485 559 491 560 490
|
||||||
|
560 490 560 490 560 490
|
||||||
|
559 1566 560 490 560 1570
|
||||||
|
555 1540 560 1564 561 1565
|
||||||
|
560
|
||||||
|
|
||||||
|
end raw_codes
|
||||||
|
|
||||||
|
end remote
|
||||||
|
|
|
@ -0,0 +1,97 @@
|
||||||
|
|
||||||
|
# this config file was automatically generated
|
||||||
|
# using lirc-0.8.6(default) on Tue Sep 21 17:58:58 2010
|
||||||
|
#
|
||||||
|
# contributed by Robert Bedlinski
|
||||||
|
#
|
||||||
|
# brand:
|
||||||
|
# model no. of remote control: RMT B104P
|
||||||
|
# devices being controlled by this remote:
|
||||||
|
# SONY BLU RAY BDP S360
|
||||||
|
|
||||||
|
begin remote
|
||||||
|
|
||||||
|
name SONY_BD2
|
||||||
|
bits 12
|
||||||
|
flags SPACE_ENC|CONST_LENGTH
|
||||||
|
eps 30
|
||||||
|
aeps 100
|
||||||
|
|
||||||
|
header 2426 565
|
||||||
|
one 1221 569
|
||||||
|
zero 627 569
|
||||||
|
post_data_bits 8
|
||||||
|
post_data 0x47
|
||||||
|
gap 44934
|
||||||
|
min_repeat 2
|
||||||
|
toggle_bit_mask 0x0
|
||||||
|
|
||||||
|
begin codes
|
||||||
|
KEY_POWER 0xA8B
|
||||||
|
KEY_1 0x00B
|
||||||
|
KEY_2 0x80B
|
||||||
|
KEY_3 0x40B
|
||||||
|
KEY_4 0xC0B
|
||||||
|
KEY_5 0x20B
|
||||||
|
KEY_6 0xA0B
|
||||||
|
KEY_7 0x60B
|
||||||
|
KEY_8 0xE0B
|
||||||
|
KEY_9 0x10B
|
||||||
|
KEY_0 0x90B
|
||||||
|
KEY_AUDIO 0x26B
|
||||||
|
KEY_SUBTITLE 0xC6B
|
||||||
|
KEY_ANGLE 0xA6B
|
||||||
|
KEY_TIME 0X14B
|
||||||
|
KEY_RED 0xE6B
|
||||||
|
KEY_GREEN 0x16B
|
||||||
|
KEY_YELLOW 0x96B
|
||||||
|
KEY_BLUE 0x66B
|
||||||
|
KEY_MENU 0x34B
|
||||||
|
X_KEY_POPUPMENU 0x94B # Was: KEY_POPUPMENU
|
||||||
|
KEY_LEFT 0xDCB
|
||||||
|
KEY_RIGHT 0x3CB
|
||||||
|
KEY_DOWN 0x5CB
|
||||||
|
KEY_UP 0x9CB
|
||||||
|
X_KEY_RETURN 0xC2B # Was: KEY_RETURN
|
||||||
|
X_KEY_OPTIONS 0xFCB # Was: KEY_OPTIONS
|
||||||
|
KEY_OK 0xBCB
|
||||||
|
KEY_HOME 0x42B
|
||||||
|
KEY_PLAY 0x58B
|
||||||
|
KEY_PAUSE 0x98B
|
||||||
|
KEY_STOP 0x18B
|
||||||
|
KEY_DISPLAY 0x82B
|
||||||
|
X_KEY_FAST_REWERSE 0xD8B # Was: KEY_FAST_REWERSE
|
||||||
|
X_KEY_FAST_FORWARD 0x38B # Was: KEY_FAST_FORWARD
|
||||||
|
KEY_PREVIOUS 0xEAB
|
||||||
|
X_KEY_INSTANT_REPLAY 0x6EB # Was: KEY_INSTANT_REPLAY
|
||||||
|
X_KEY_INSTANT_ADVENCE 0xAEB # Was: KEY_INSTANT_ADVENCE
|
||||||
|
KEY_NEXT 0x6AB
|
||||||
|
end codes
|
||||||
|
|
||||||
|
end remote
|
||||||
|
|
||||||
|
|
||||||
|
begin remote
|
||||||
|
|
||||||
|
name SONY-BD
|
||||||
|
bits 12
|
||||||
|
flags SPACE_ENC|CONST_LENGTH
|
||||||
|
eps 30
|
||||||
|
aeps 100
|
||||||
|
|
||||||
|
header 2441 556
|
||||||
|
one 1234 557
|
||||||
|
zero 637 557
|
||||||
|
gap 44888
|
||||||
|
min_repeat 2
|
||||||
|
toggle_bit_mask 0x0
|
||||||
|
|
||||||
|
begin codes
|
||||||
|
KEY_VOLUMEUP 0x490
|
||||||
|
KEY_VOLUMEDOWN 0xC90
|
||||||
|
KEY_POWER2 0xA90
|
||||||
|
X_KEY_INPUT 0xA50 # Was: KEY_INPUT
|
||||||
|
end codes
|
||||||
|
|
||||||
|
end remote
|
||||||
|
|
|
@ -1,23 +0,0 @@
|
||||||
# interfaces(5) file used by ifup(8) and ifdown(8)
|
|
||||||
|
|
||||||
# Please note that this file is written to be used with dhcpcd
|
|
||||||
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'
|
|
||||||
|
|
||||||
# Include files from /etc/network/interfaces.d:
|
|
||||||
source-directory /etc/network/interfaces.d
|
|
||||||
|
|
||||||
auto lo
|
|
||||||
iface lo inet loopback
|
|
||||||
|
|
||||||
iface eth0 inet static
|
|
||||||
address 10.2.113.9
|
|
||||||
netmask 255.255.255.0
|
|
||||||
gateway 10.2.113.1
|
|
||||||
|
|
||||||
allow-hotplug wlan0
|
|
||||||
iface wlan0 inet manual
|
|
||||||
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
|
||||||
|
|
||||||
allow-hotplug wlan1
|
|
||||||
iface wlan1 inet manual
|
|
||||||
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
|
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/python
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
# sets color of first neo pixel
|
# sets color of first neo pixel
|
||||||
from __future__ import division
|
from __future__ import division
|
||||||
import time
|
import time
|
||||||
|
@ -43,11 +44,11 @@ if __name__ == '__main__':
|
||||||
myredis=redis.StrictRedis(host='localhost', port=6379, db=0)
|
myredis=redis.StrictRedis(host='localhost', port=6379, db=0)
|
||||||
while True:
|
while True:
|
||||||
time.sleep(50/1000.0)
|
time.sleep(50/1000.0)
|
||||||
try:
|
try:
|
||||||
r=int(myredis.get('neored'))
|
r=int(myredis.get('neored'))
|
||||||
except:
|
except:
|
||||||
r=0
|
r=0
|
||||||
try:
|
try:
|
||||||
g=int(myredis.get('neogreen'))
|
g=int(myredis.get('neogreen'))
|
||||||
except:
|
except:
|
||||||
g=0
|
g=0
|
||||||
|
@ -65,10 +66,11 @@ if __name__ == '__main__':
|
||||||
valid="yes"
|
valid="yes"
|
||||||
if ( valid != "yes" ):
|
if ( valid != "yes" ):
|
||||||
continue
|
continue
|
||||||
|
myredis.set('valid','no')
|
||||||
if(action == "set"):
|
if(action == "set"):
|
||||||
print "Color set to: ",r,g,b
|
print "Color set to: ",r,g,b
|
||||||
for i in range(0,LED_COUNT):
|
for i in range(0,LED_COUNT):
|
||||||
strip.setPixelColor(i, Color(r,g,b))
|
strip.setPixelColor(i, Color(g,r,b))
|
||||||
showit()
|
showit()
|
||||||
if(action == "number"):
|
if(action == "number"):
|
||||||
tmp=myredis.get('neovalue')
|
tmp=myredis.get('neovalue')
|
||||||
|
@ -109,7 +111,7 @@ if __name__ == '__main__':
|
||||||
morsep+=1
|
morsep+=1
|
||||||
strip.setPixelColor(morsep, Color(0,0,0))
|
strip.setPixelColor(morsep, Color(0,0,0))
|
||||||
morsep+=1
|
morsep+=1
|
||||||
showit()
|
showit()
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
if(action == "pulse"):
|
if(action == "pulse"):
|
||||||
print "Pulsing with: ",r,g,b
|
print "Pulsing with: ",r,g,b
|
||||||
|
@ -132,14 +134,15 @@ if __name__ == '__main__':
|
||||||
for j in range(0,60,5):
|
for j in range(0,60,5):
|
||||||
strip.setPixelColor(clockcalc(j), color)
|
strip.setPixelColor(clockcalc(j), color)
|
||||||
# put the current people count as magenta
|
# put the current people count as magenta
|
||||||
strip.setPixelColor(clockcalc(myredis.get('neocounter')),Color(10,0,10))
|
if myredis.get('neocounter') >= 0:
|
||||||
|
strip.setPixelColor(clockcalc(myredis.get('neocounter')),Color(10,0,10))
|
||||||
# put the minute hand as red
|
# put the minute hand as red
|
||||||
strip.setPixelColor(clockcalc(time.strftime('%M',time.localtime())),Color(30,0,0))
|
strip.setPixelColor(clockcalc(time.strftime('%M',time.localtime())),Color(30,0,0))
|
||||||
# put the seconds hand as green
|
# put the seconds hand as green
|
||||||
strip.setPixelColor(clockcalc(time.strftime('%S',time.localtime())),Color(0,30,0))
|
strip.setPixelColor(clockcalc(time.strftime('%S',time.localtime())),Color(0,30,0))
|
||||||
showit()
|
showit()
|
||||||
time.sleep(50/1000.0)
|
time.sleep(50/1000.0)
|
||||||
|
|
||||||
if(action == "flash"):
|
if(action == "flash"):
|
||||||
print "Flashing with: ",r,g,b
|
print "Flashing with: ",r,g,b
|
||||||
print myredis.get('neoaction')
|
print myredis.get('neoaction')
|
||||||
|
@ -154,7 +157,7 @@ if __name__ == '__main__':
|
||||||
for q in range(3):
|
for q in range(3):
|
||||||
for i in range(0, strip.numPixels(), 3):
|
for i in range(0, strip.numPixels(), 3):
|
||||||
strip.setPixelColor(i+q, wheel((i+j) % 255))
|
strip.setPixelColor(i+q, wheel((i+j) % 255))
|
||||||
showit()
|
showit()
|
||||||
time.sleep(wait_ms/1000.0)
|
time.sleep(wait_ms/1000.0)
|
||||||
for i in range(0, strip.numPixels(), 3):
|
for i in range(0, strip.numPixels(), 3):
|
||||||
strip.setPixelColor(i+q, 0)
|
strip.setPixelColor(i+q, 0)
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
buttonpin=24
|
buttonpin=24
|
||||||
import RPi.GPIO as GPIO
|
import RPi.GPIO as GPIO
|
||||||
import time
|
import time
|
||||||
|
@ -7,15 +10,15 @@ import os
|
||||||
GPIO.setmode(GPIO.BCM)
|
GPIO.setmode(GPIO.BCM)
|
||||||
|
|
||||||
GPIO.setup(buttonpin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
|
GPIO.setup(buttonpin, GPIO.IN, pull_up_down=GPIO.PUD_UP)
|
||||||
|
exit
|
||||||
while True:
|
while True:
|
||||||
print "waiting..."
|
print "waiting..."
|
||||||
os.system('logger shutdownbutton waiting for press...')
|
os.system('logger shutdownbutton waiting for press...')
|
||||||
try:
|
try:
|
||||||
GPIO.wait_for_edge(buttonpin, GPIO.FALLING)
|
GPIO.wait_for_edge(buttonpin, GPIO.FALLING)
|
||||||
print('Button Pressed')
|
print('Button Pressed')
|
||||||
os.system('logger shutdownbutton pressen. bye bye')
|
os.system('logger shutdownbutton pressen. bye bye')
|
||||||
os.system("shutdown now -h")
|
# os.system("shutdown now -h")
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
GPIO.cleanup() # clean up GPIO on CTRL+C exit
|
GPIO.cleanup() # clean up GPIO on CTRL+C exit
|
||||||
GPIO.cleanup() #
|
GPIO.cleanup() #
|
||||||
|
|
|
@ -1,4 +1,8 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
import urllib, json
|
import urllib, json
|
||||||
|
|
||||||
url = "https://spaceapi.syn2cat.lu/status/json"
|
url = "https://spaceapi.syn2cat.lu/status/json"
|
||||||
response = urllib.urlopen(url);
|
response = urllib.urlopen(url);
|
||||||
data = json.loads(response.read())
|
data = json.loads(response.read())
|
||||||
|
|
Loading…
Reference in New Issue