Skip to content
Snippets Groups Projects
Commit e4bd84a3 authored by Aymeric Bernard's avatar Aymeric Bernard
Browse files

Updated README

parent da678a86
No related branches found
No related tags found
No related merge requests found
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
- `sudo apt remove wolfram-engine minecraft-pi` - `sudo apt remove wolfram-engine minecraft-pi`
- `sudo apt autoremove` - `sudo apt autoremove`
- `sudo apt update && sudo apt upgrade && sudo reboot` - `sudo apt update && sudo apt upgrade && sudo reboot`
- `sudo apt install git vim screen htop` - `sudo apt install git vim screen htop xdotool`
- `sudo date -s '2018-02-15 2:26:00'` if needed (change the date to current date ofc) - `sudo date -s '2018-02-15 2:26:00'` if needed (change the date to current date ofc)
- Generate RSA key `ssh-keygen -t rsa -C "hermod.inno@gmail.com" -b 4096` and add it to gitlab - 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` - Clone project in `~`: `git clone git@gitlab.viarezo.fr:hermod/tv_panel.git`
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
- `cp server/config.template.js server/config.js` - `cp server/config.template.js server/config.js`
- Useful links: `ln -s ~/tv_panel/scripts/.screenrc ~/`, `ln -s ~/tv_panel/scripts/.vimrc ~/` - Useful links: `ln -s ~/tv_panel/scripts/.screenrc ~/`, `ln -s ~/tv_panel/scripts/.vimrc ~/`
### Telegram message on statup to get IP address ### Telegram message on startup to get IP address
- `cp scripts/waitForNetwork /root/scripts/waitForNetwork` - `cp scripts/waitForNetwork /root/scripts/waitForNetwork`
- `cp scripts/startup-telegram-message /root/scripts/startup-telegram-message` - `cp scripts/startup-telegram-message /root/scripts/startup-telegram-message`
- `sudo vim /root/scripts/startup-telegram-message` to add the token and chat id - `sudo vim /root/scripts/startup-telegram-message` to add the token and chat id
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
@reboot sleep 1 && /root/scripts/waitForNetwork && /root/scripts/startup-telegram-message @reboot sleep 1 && /root/scripts/waitForNetwork && /root/scripts/startup-telegram-message
``` ```
### Boot config ### Boot config (only on Pi zeros?)
`vim /boot/config.txt` to comment out `dtparam=audio=on` -> `#dtparam=audio=on` and add `vim /boot/config.txt` to comment out `dtparam=audio=on` -> `#dtparam=audio=on` and add
``` ```
# Serial # Serial
...@@ -48,19 +48,44 @@ export NODEJS_HOME=/usr/lib/nodejs/node-v9 ...@@ -48,19 +48,44 @@ export NODEJS_HOME=/usr/lib/nodejs/node-v9
export PATH=$NODEJS_HOME/bin:$PATH export PATH=$NODEJS_HOME/bin:$PATH
``` ```
After reboot or log out - log in, `npm install -g yarn` After reboot or log out - log in, `npm install -g yarn pm2`
### WS2812 ### WS2812
- Wiring: VCC -> |<diode| -> 5V, GND -> GND, Data -> (resistor ~100 ohm) -> (pin 12 / BCM 18 / PWM0) - Wiring: VCC -> |<diode| -> 5V, GND -> GND, Data -> (resistor ~100 ohm) -> (pin 12 / BCM 18 / PWM0)
- `sudo apt install scons` - `sudo apt install scons python3-dev swig`
- `git clone https://github.com/jgarff/rpi_ws281x.git && cd rpi_ws281x` - `git clone https://github.com/jgarff/rpi_ws281x.git && cd rpi_ws281x`
- Edit `main.c` to put good stuff (width height for testing) - Edit `main.c` to put good stuff (width height for testing):
```
#define WIDTH 1
#define HEIGHT 1
```
##### Make it Python3 compatible:
In `python/neopixel.py` file:
- Add `from builtins import range` after `# Author: Tony DiCola...` line (beginning)
- `xrange` -> `range` in lines 33 and 46
In `python/setup.py` file, insert 3 lines after line 13:
```
url = 'https://github.com/jgarff/rpi_ws281x/',
install_requires=[
'future',
],
py_modules = ['neopixel'],
```
- `scons` - `scons`
- `sudo ./test` to test - `sudo ./test` to test
- `follow ./python/README.md for python installation`
To display a status LED without root ##### Python3 installation
- `cp scripts/statusRGB_listener.py /root/scripts/statusRGB_listener.py` (from `tv_panel` directory) In `python` folder,
- `python ./setup.py build`
- `sudo python ./setup.py install`
##### Display a status LED without root, and avoid overhead lag
Back to `tv_panel` directory
- `cp scripts/statusRGB_listener.py /root/scripts/statusRGB_listener.py`
- Add in root crontab (`sudo crontab -e`): - Add in root crontab (`sudo crontab -e`):
``` ```
@reboot /usr/bin/python3 /root/scripts/statusRGB_listener.py @reboot /usr/bin/python3 /root/scripts/statusRGB_listener.py
...@@ -79,15 +104,32 @@ To display a status LED without root ...@@ -79,15 +104,32 @@ To display a status LED without root
### RFID reader ### RFID reader
##### Communicate with the module
- Wiring: VCC -> 5V, GND -> GND, RX -> TX, TX -> RX - Wiring: VCC -> 5V, GND -> GND, RX -> TX, TX -> RX
- In `sudo raspi-config`, disable serial messages but enable serial interface - In `sudo raspi-config`, disable serial messages but enable serial interface
##### Get and compile libnfc
``` ```
wget https://github.com/nfc-tools/libnfc/releases/download/libnfc-1.7.1/libnfc-1.7.1.tar.bz2 wget https://github.com/nfc-tools/libnfc/releases/download/libnfc-1.7.1/libnfc-1.7.1.tar.bz2
tar xvjf libnfc-1.7.1.tar.bz2 tar xvjf libnfc-1.7.1.tar.bz2
cd libnfc-1.7.1 cd libnfc-1.7.1
vim examples/nfc-poll.c
```
Here you must comment out the bloc near the end of the file that waits for card
removing (if not, the stream doesn't end until card removal and this is very
impractical).
```
// printf("Waiting for card removing...");
// while (0 == nfc_initiator_target_is_present(pnd, NULL)) {}
// nfc_perror(pnd, "nfc_initiator_target_is_present");
// printf("done.\n");
```
Exit vim and continue to the compilation:
```
./configure --prefix=/usr --sysconfdir=/etc ./configure --prefix=/usr --sysconfdir=/etc
make make
make install sudo make install
sudo mkdir /etc/nfc sudo mkdir /etc/nfc
sudo cp libnfc.conf.sample /etc/nfc/libnfc.conf sudo cp libnfc.conf.sample /etc/nfc/libnfc.conf
sudo mkdir -p /etc/nfc/devices.d sudo mkdir -p /etc/nfc/devices.d
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment