Compare commits
8 Commits
master
...
add-instal
| Author | SHA1 | Date | |
|---|---|---|---|
| 313acdb600 | |||
| 30e5983273 | |||
| 104211b810 | |||
| dca8ddffc9 | |||
| d782c8db5a | |||
| 9b4ce2932e | |||
| 26ea541e37 | |||
| b6a5199fdc |
43
README.md
43
README.md
@ -4,50 +4,17 @@ Il peut etre transporté ou etre utilisé dans un magasin pour vendre un service
|
|||||||
|
|
||||||
## Le matériel nécessaire :
|
## Le matériel nécessaire :
|
||||||
- Un raspberry pi
|
- Un raspberry pi
|
||||||
- Un écran lcd tactile
|
- Un écran lcd tactile ([Lien Amazon](https://amzn.to/3WTLLis))
|
||||||
- Un lecteur nfc acr122u ([Lien Amazon](https://amzn.to/45w3fVP))
|
- Un lecteur nfc acr122u ([Lien Amazon](https://amzn.to/45w3fVP))
|
||||||
- Un clavier numérique
|
- Un clavier numérique ([Lien Amazon](https://amzn.to/3qj24c9))
|
||||||
|
|
||||||
Le script peut aussi se lancer sur un ordinateur linux ayant accès à un lecteur nfc acr122u
|
Le script peut aussi se lancer sur un ordinateur linux ayant accès à un lecteur nfc acr122u
|
||||||
|
|
||||||
## Dépendances du script :
|
|
||||||
- [Python 3.x](https://www.python.org/downloads/) : Qui permet de lancer le script.
|
|
||||||
- [Librarie Python Flask](https://pypi.org/project/Flask/) : Qui permet de mettre en place un serveur web et donc l'interface graphique dans ce projet.
|
|
||||||
- [Libnfc](http://nfc-tools.org/index.php/Libnfc)
|
|
||||||
- [MFOC](https://github.com/nfc-tools/mfoc)
|
|
||||||
|
|
||||||
## Installation :
|
## Installation :
|
||||||
Après avoir installé Python3.x, vous devez installer la librairie Flask.
|
Lancement du script d'installation :
|
||||||
```sh
|
```sh
|
||||||
python3 -m pip install flask
|
chmod +x install.sh
|
||||||
```
|
./install.sh
|
||||||
Vous pouvez ensuite télécharger le projet.
|
|
||||||
Pour que le script fonctionne correctement vous devez désactiver 2 modules (il est aussi possible d'enlever ces modules de facon permanente, un exemple [ici]( https://wiki.archlinux.org/index.php/Touchatag_RFID_Reader)).
|
|
||||||
```sh
|
|
||||||
sudo modprobe -r pn533_usb pn533
|
|
||||||
```
|
|
||||||
Mfoc et LibNFC peuvent etre installer avec ces commandes :
|
|
||||||
```sh
|
|
||||||
sudo apt install libnfc*
|
|
||||||
sudo apt install mfoc
|
|
||||||
```
|
|
||||||
Pour lancer le projet au lancement du raspberry :
|
|
||||||
```sh
|
|
||||||
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
|
|
||||||
```
|
|
||||||
et vous devez ajouter ces commandes (vous pouvez ensuite fermer le fichier) :
|
|
||||||
```
|
|
||||||
@sh /home/pi/launcher.sh &
|
|
||||||
@chromium-browser --incognito --kiosk http://localhost:5000
|
|
||||||
```
|
|
||||||
Pour finir il faut créer le fichier launcher.sh
|
|
||||||
```sh
|
|
||||||
nano ~/launcher.sh
|
|
||||||
```
|
|
||||||
et y ajouter ce texte :
|
|
||||||
```
|
|
||||||
cd /home/pi/BadgeCloner
|
|
||||||
python3 server.py
|
|
||||||
```
|
```
|
||||||
## Configuration :
|
## Configuration :
|
||||||
Vous pouvez changer le nom du répertoire des dumps avec la variable
|
Vous pouvez changer le nom du répertoire des dumps avec la variable
|
||||||
|
|||||||
71
install.sh
Normal file
71
install.sh
Normal file
@ -0,0 +1,71 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
set -e
|
||||||
|
|
||||||
|
install_packages() {
|
||||||
|
command -v git >/dev/null 2>&1 || { echo >&2 "Git n'est pas installé. Installation..."; sudo apt-get install git; }
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get install libusb-dev autoconf libpcsclite-dev -y
|
||||||
|
}
|
||||||
|
|
||||||
|
clone_repos() {
|
||||||
|
local repos=(
|
||||||
|
"https://gitea.jarodcajna.fr/jarjar/BadgeCloner.git"
|
||||||
|
"https://gitea.jarodcajna.fr/jarjar/libnfc.git"
|
||||||
|
"https://gitea.jarodcajna.fr/jarjar/mfoc.git"
|
||||||
|
"https://gitea.jarodcajna.fr/jarjar/LCD-show.git"
|
||||||
|
)
|
||||||
|
|
||||||
|
for repo in "${repos[@]}"
|
||||||
|
do
|
||||||
|
git clone $repo
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
compile_libnfc() {
|
||||||
|
cd ~/libnfc
|
||||||
|
autoreconf -is --force
|
||||||
|
./configure
|
||||||
|
make distclean
|
||||||
|
sudo make install
|
||||||
|
cd ~
|
||||||
|
}
|
||||||
|
|
||||||
|
compile_mfoc() {
|
||||||
|
cd ~/mfoc
|
||||||
|
autoreconf -is
|
||||||
|
./configure
|
||||||
|
make && sudo make install
|
||||||
|
cd ~
|
||||||
|
}
|
||||||
|
|
||||||
|
update_autostart() {
|
||||||
|
sudo sed -i '1,3s/^/@#/' /etc/xdg/lxsession/LXDE-pi/autostart
|
||||||
|
echo "@sh /home/$USER/launcher.sh &" | sudo tee -a /etc/xdg/lxsession/LXDE-pi/autostart
|
||||||
|
echo "@chromium-browser --incognito --kiosk http://localhost:5000" | sudo tee -a /etc/xdg/lxsession/LXDE-pi/autostart
|
||||||
|
}
|
||||||
|
|
||||||
|
create_launcher() {
|
||||||
|
echo "cd /home/$USER/BadgeCloner/BadgeCloner" > ~/launcher.sh
|
||||||
|
echo "python3 server.py" >> ~/launcher.sh
|
||||||
|
chmod +x ~/launcher.sh
|
||||||
|
}
|
||||||
|
|
||||||
|
install_lcd_drivers() {
|
||||||
|
cd ~/LCD-show
|
||||||
|
sudo chmod +x LCD35-show
|
||||||
|
sudo ./LCD35-show
|
||||||
|
}
|
||||||
|
|
||||||
|
main() {
|
||||||
|
cd ~
|
||||||
|
install_packages
|
||||||
|
clone_repos
|
||||||
|
compile_libnfc
|
||||||
|
compile_mfoc
|
||||||
|
sudo ldconfig
|
||||||
|
update_autostart
|
||||||
|
create_launcher
|
||||||
|
install_lcd_drivers
|
||||||
|
}
|
||||||
|
|
||||||
|
main "$@"
|
||||||
Loading…
x
Reference in New Issue
Block a user