Skip to content

Installation everything DRAFT

Alexander Mextner edited this page Jan 27, 2018 · 25 revisions

Smart Home

Setup

sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get upgrade
sudo apt-get -y install git vim zsh tree vlc mplayer omxplayer httpie htop

# TODO: zsh

git clone [email protected]:a-x-/.files.git # TODO

# node&npm
curl -L https://git.io/n-install | bash
source ~/.zshrc

# TODO everything else

rutracker-cli (a-x- forked)

and rutracker-api

~/.config/rutracker-cli/config.json:

{
  "downloadPath": "/home/pi/Downloads",
  "username": "login",
  "password": "psswd"
}

setup wiringpi

git clone git://git.drogon.net/wiringPi
cd wiringPi
./build

setup AirPlay (iPhone stream)

cd ~/services
git clone https://github.com/mikebrady/shairport-sync.git
cd shairport-sync
sudo apt-get install -y build-essential git xmltoman \
autoconf automake libtool libdaemon-dev libpopt-dev libconfig-dev \
libasound2-dev \
avahi-daemon libavahi-client-dev \
libssl-dev \
libsoxr-dev
autoreconf -i -f
./configure --with-alsa  --sysconfdir=/etc --with-avahi --with-ssl=openssl --with-metadata --with-soxr --with-systemd
make
sudo make install
sudo systemctl enable shairport-sync

apply conf:
`curl -qO- https://gist.githubusercontent.com/a-x-/a8edb82105cfd5019021f4a60bcb1e8d/raw/9bcc31891e9afbb9ddfaa9d1fd554300533e2c4d/shairport-sync.conf | sudo cat - > /etc/shairport-sync.conf`

improve audio on rpi3, fix shairport rpi over wi-fi

doc: https://github.com/mikebrady/shairport-sync/issues/525

rpi-update
echo audio_pwm_mode=2 >> /boot/config.txt
amixer cset numid=3 1
# uncomment into shairport-sync.conf
#	  volume_range_db = 30
# add into /etc/network/interfaces after line iface wlan0 inet
#   wireless-power off
fix something

https://adventuresandwhathaveyou.wordpress.com/2013/09/02/airplay-mirroring-on-raspberry-pi-with-rplay/
https://kropochev.com/?go=all/airplay-and-raspberry-pi/

/etc/shairport-sync.conf
general = {
	volume_range_db = 40 ;
	volume_max_db = 3.0 ;
}

setup HomeKIT (Siri light)

cd ~/services
git clone [email protected]:a-x-/HAP-NodeJS.git
cd HAP-NodeJS
sudo apt-get install -y libavahi-compat-libdnssd-dev
npm i

setup hifiberry dac+

doc: https://support.hifiberry.com/hc/en-us/articles/205377651-Configuring-Linux-4-x-or-higher

in /boot/config.txt: 1. Comment the line dtparam=audio=on 2. Add dtoverlay=hifiberry-dacplus

create /etc/asound.conf:

pcm.!default  {
 type hw card 0
}
ctl.!default {
 type hw card 0
}

setup snapcast (sync play)

  1. install
mkdir -p ~/services/snapcast/installation
cd ~/services/snapcast/installation
wget https://github.com/badaix/snapcast/releases/download/v0.12.0/snapserver_0.12.0_armhf.deb
wget https://github.com/badaix/snapcast/releases/download/v0.12.0/snapclient_0.12.0_armhf.deb
sudo dpkg -i snapserver_0.12.0_armhf.deb
sudo dpkg -i snapclient_0.12.0_armhf.deb
sudo apt-get -f install # deps
  1. (optional) config: https://github.com/badaix/snapcast#configuration
  2. connect with player: https://github.com/badaix/snapcast/blob/master/doc/player_setup.md#mplayer
  3. connect another rpis

setup tg-cli

active fork: https://github.com/vysheng/tg/issues/1435#issuecomment-343691245
https://github.com/vysheng/tg
https://github.com/vysheng/tg/issues/781
https://github.com/vysheng/tg/issues/1339
https://github.com/vysheng/tg/issues/1189
https://github.com/vysheng/tg
https://github.com/a-x-/tgl/

sudo apt-get install libreadline-dev libconfig-dev libssl-dev lua5.2 liblua5.2-dev libevent-dev libjansson-dev libpython-dev make
git clone --recursive https://github.com/vysheng/tg.git && cd tg
cd tgl
git remote set-url origin  [email protected]:a-x-/tgl.git
git fetch && git checkout patch-1
cd ..
./configure && make
ln -s ~/services/tg/bin/telegram-cli ~/bin
sudo mkdir -p /etc/telegram-cli
sudo cp tg-server.pub /etc/telegram-cli/server.pub

telegram-cli -W

bin

git clone [email protected]:a-x-/rpi-bin.git ~/bin (repo)

Setup Rpi3

deluge torrent client

~/.config/deluge/core.conf /var/lib/deluged/config/core.conf

wtf

http://dev.deluge-torrent.org/wiki/Installing/Source http://dev.deluge-torrent.org/wiki/UserGuide/Service/systemd

https://github.com/deluge-torrent/deluge

🚧 todo

Kodi

🚧 todo

~/services, ~/bin

🚧 todo


todo/fix later

arduino autonomous light

  • /Users/mxtnr/xp/arduino/arduino-light-control
  • /Users/mxtnr/Library/Mobile Documents/comappleCloudDocs/arduino/CH34x_Install_V1.4.pkg
  • Arduino.app

arduino light + wifi

https://www.arduino.cc/en/Tutorial/ReadASCIIString http://dalpix.com/blog/connecting-your-arduino-wifi-esp-8266-module https://geektimes.ru/post/255594/ Понижение напряжения http://shemu.ru/raznoe/504-ams1117 — 5 >> 3.3

light button

http://www.cl.cam.ac.uk/~db434/raspi/downloads/ http://www.cl.cam.ac.uk/~db434/raspi/buttons_and_switches/ http://wiringpi.com/reference/priority-interrupts-and-threads/

youtube cli

http://www.armlinux.ru/смотрим-youtube-из-командной-строки/ https://github.com/0xPr0xy/youtube-cli mps-youtube

платформа

youtube

youtube-dl youtube to raspberry chrom* extension

kodi media center

esp docs

doc GPIO0 к GND при загрузке нового firmware

crontab


PATH=$PATH:/home/pi/n/bin/:/usr/bin/:/usr/local/bin/:/home/pi/bin
# m h  dom mon dow   command

#@reboot /home/pi/bin/reboot-job
#29 09  *  *   *     cd /home/pi/bin/megapolisfm-itunes-tracks-uris/; ./job > log # cvlc -I http --http-port 43822 last-tracks.list

#28  9 *   *   *     get-weather | jq '"Погода: \(.description), \(.temp | floor) градусов"' | tts
#59 11 *   *   *     get-weather | jq '"Погода: \(.description), \(.temp | floor) градусов"' | tts
#00  1 *   *   *     light 0
#30  9 *   *   *     light 1
#00 12 *   *   *     light 0
#30 21 *   *   *     light 1

#40 11 *   *   *     mpg321 /home/pi/Maroon5-SundayMorning.mp3

 30 09 *   *   *     vol  80 louder
 00 10 *   *   *     vol  90 louder
 30 10 *   *   *     vol 100 louder
 00 23 *   *   *     vol  90 quieter
 00  1 *   *   *     vol  80 quieter
 00  2 *   *   *     vol  70 quieter

#@reboot telegram-cli -s /home/pi/tg/action.lua



sudo



# m h  dom mon dow   command
#@reboot mount -t ext4 /dev/sda1 /mnt/ehdd                              #mount hdd
#@reboot /usr/local/bin/gpio -1 mode 22 out;light 1                     #light on
##@reboot /home/pi/wait-light-button/wait-light-button                  #button light control
Clone this wiki locally