Compare commits

...

8 Commits

Author SHA1 Message Date
313acdb600 Add Amazon link 2023-06-02 19:57:37 +00:00
30e5983273 Update 'install.sh' 2023-06-02 15:43:33 +00:00
104211b810 Use personnal git repo 2023-06-02 15:30:52 +00:00
dca8ddffc9 Use personnal git repo 2023-06-02 15:26:04 +00:00
d782c8db5a LCD install 2023-06-02 11:33:11 +02:00
9b4ce2932e Readme update 2023-06-02 11:08:57 +02:00
26ea541e37 improve directory tree 2023-06-02 11:03:44 +02:00
b6a5199fdc install.sh 2023-06-02 10:21:53 +02:00
10 changed files with 76 additions and 38 deletions

View File

@ -4,50 +4,17 @@ Il peut etre transporté ou etre utilisé dans un magasin pour vendre un service
## Le matériel nécessaire :
- 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 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
## 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 :
Après avoir installé Python3.x, vous devez installer la librairie Flask.
Lancement du script d'installation :
```sh
python3 -m pip install flask
```
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
chmod +x install.sh
./install.sh
```
## Configuration :
Vous pouvez changer le nom du répertoire des dumps avec la variable

71
install.sh Normal file
View 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 "$@"