Skip to content
Snippets Groups Projects
Select Git revision
  • 4031e24203c2a6a908c2c914e154cc9aa0d5039d
  • master default
  • feat/pull_changes
3 results

tv_panel

user avatar
Hermod authored
Merge branch 'master' into feat/badge-reader
4031e242
History

Hermod TV Panel

Installation

Beginning

  • Create user hermod: adduser hermod
  • Put it in the same groups as pi (other than the pi group): groups pi | sed 's/ /,/g', usermod -a -G group1,group2,... hermod change pi and root passwords
  • sudo apt remove wolfram-engine minecraft-pi
  • sudo apt autoremove
  • sudo apt update && sudo apt upgrade && sudo reboot
  • sudo apt install git vim screen htop
  • sudo date -s '2018-02-15 2:26:00' if needed
  • Generate RSA key ssh-keygen -t rsa -C "hermod.inno@gmail.com" -b 4096 and add it to gitlab
  • Clone project in ~: git clone git@gitlab.viarezo.fr:hermod/tv_panel.git
  • cp front/src/config.template.js front/src/config.js
  • cp server/config.template.js server/config.js
  • Useful links: ln -s ~/tv_panel/scripts/.screenrc ~/, ln -s ~/tv_panel/scripts/.vimrc ~/

Boot config

vim /boot/config.txt to comment out dtparam=audio=on -> #dtparam=audio=on and add

# Serial
enable_uart=1
dtoverlay=pi3-disable-bt

Reboot

Download nodejs:

  • wget https://nodejs.org/dist/v9.7.1/node-v9.7.1-linux-armv6l.tar.xz (to adapt to most recent version)
  • tar xf node-v9.7.1-linux-armv6l.tar.xz
  • sudo mv node-v9.7.1-linux-armv6l /usr/lib/nodejs/node-v9
  • vim .profile to add:
# Nodejs
export NODEJS_HOME=/usr/lib/nodejs/node-v9
export PATH=$NODEJS_HOME/bin:$PATH

After reboot or log out - log in, npm install -g yarn

WS2812

  • Wiring: VCC -> |<diode| -> 5V, GND -> GND, Data -> (resistor ~100 ohm) -> (pin 12 / BCM 18 / PWM0)
  • sudo apt install scons
  • git clone https://github.com/jgarff/rpi_ws281x.git && cd rpi_ws281x
  • Edit main.c to put good stuff (width height for testing)
  • scons
  • sudo ./test to test
  • follow ./python/README.md for python installation

Script without password for sudo:

  • sudo mkdir /hermod_bin
  • cp tv_panel/scripts/statusRGB.py /hermod_bin/
  • sudo visudo to add
# Allow the scripts here to be run without sudo password
hermod ALL=(ALL) NOPASSWD: /hermod_bin/statusRGB.py

Disable screen sleeping

vim .config/lxsession/LXDE-pi/autostart to add

@xset s noblank
@xset s off
@xset -dpms

RFID reader

  • Wiring: VCC -> 5V, GND -> GND, RX -> TX, TX -> RX
  • In sudo raspi-config, disable serial messages but enable serial interface
tar xvjf libnfc-1.7.1.tar.bz2
cd libnfc-1.7.1
./configure --prefix=/usr --sysconfdir=/etc
make
make install
sudo mkdir /etc/nfc
sudo cp libnfc.conf.sample /etc/nfc/libnfc.conf
sudo mkdir -p /etc/nfc/devices.d
sudo cp contrib/libnfc/pn532_uart_on_rpi.conf.sample /etc/nfc/devices.d/
sudo cp contrib/udev/42-pn53x.rules /lib/udev/rules.d/