2022-09-03 06:36:20 +02:00
|
|
|
Telecommande Domotique
|
|
|
|
===========================
|
2023-03-31 10:32:59 +02:00
|
|
|
<img src="http://xavier.debert.free.fr/telecom/relais.jpg" width="25%">
|
|
|
|
<img src="http://xavier.debert.free.fr/telecom/1662140437397.jpg" width="25%">
|
2023-03-31 10:33:22 +02:00
|
|
|
<img src="http://xavier.debert.free.fr/telecom/1662013232649.jpg" width="20%"><br>
|
|
|
|
<img src="http://xavier.debert.free.fr/telecom/1662140437409.jpg" width="20%">
|
2023-03-31 10:32:59 +02:00
|
|
|
<img src="http://xavier.debert.free.fr/telecom/schema_funduino_keyes.jpg" width="25%">
|
|
|
|
<img src="http://xavier.debert.free.fr/telecom/funduino_keyes_8_prises.jpg" width="25%"><br>
|
2022-09-03 06:36:20 +02:00
|
|
|
## Pre-requis
|
|
|
|
|
2023-03-31 10:31:52 +02:00
|
|
|
<code>sudo apt-get install rpi.gpio git</code>
|
2022-09-03 06:36:20 +02:00
|
|
|
|
2022-09-03 06:39:13 +02:00
|
|
|
<br>ou en manuel
|
2022-09-03 06:36:20 +02:00
|
|
|
|
2023-03-31 10:31:52 +02:00
|
|
|
<code>wget https://pypi.python.org/packages/source/R/RPi.GPIO/RPi.GPIO-0.5.11.tar.gz</code><br>
|
|
|
|
<code>tar -xvf RPi.GPIO-0.5.11.tar.gz</code><br>
|
|
|
|
<code>cd RPi.GPIO-0.5.11</code><br>
|
|
|
|
<code>sudo python setup.py install</code><br>
|
2022-09-03 06:36:20 +02:00
|
|
|
|
2023-01-18 21:30:35 +01:00
|
|
|
## 1) Installation
|
2022-09-03 06:45:24 +02:00
|
|
|
J'ai utilisé un onduleur HS, comme boitier et gestion de 8 prises 220V<br>
|
|
|
|
ayant 4 relais, j ai utilisé 2 prises par canal.<br>
|
|
|
|
Pour installer ce script, aller dans /home/pi<br>
|
|
|
|
|
|
|
|
copier index.html gohttp.py et relay.py et favicon.ico<br>
|
|
|
|
par <br>
|
2022-09-03 06:36:20 +02:00
|
|
|
|
2023-03-31 10:31:52 +02:00
|
|
|
<code>git clone http://in4matik.port0.org:3000/magnum88/Gestion_Relay</code>
|
2022-09-03 06:36:20 +02:00
|
|
|
|
2022-09-03 06:45:24 +02:00
|
|
|
## 2) Pour un démarrage auto
|
2022-09-03 06:36:20 +02:00
|
|
|
|
2022-09-03 06:45:24 +02:00
|
|
|
éditer dans /etc/rc.local<br>
|
2023-03-31 10:31:52 +02:00
|
|
|
<code>sudo nano /ettc/rc.local</code><br>
|
2022-09-03 06:39:13 +02:00
|
|
|
ajouter en fin avant exit<br>
|
2022-09-03 06:36:20 +02:00
|
|
|
|
2022-09-03 12:09:51 +02:00
|
|
|
#gestion Relay a 0<br>
|
2023-03-31 10:31:52 +02:00
|
|
|
<code>./home/pi/relay.py power 1</code><br>
|
|
|
|
<code>gohttp.sh</code><br>
|
2022-09-03 06:36:20 +02:00
|
|
|
|
2023-01-18 21:29:56 +01:00
|
|
|
puis de faire un fichier executable<br>
|
|
|
|
gohttp.sh dans /usr/local/sbin contenant:<br>
|
2023-03-31 10:31:52 +02:00
|
|
|
```
|
|
|
|
#!/bin/bash
|
|
|
|
cd /home/pi
|
|
|
|
./gohttp.py
|
|
|
|
exit 0
|
|
|
|
```
|
2023-01-18 21:29:56 +01:00
|
|
|
|
2022-09-03 14:23:20 +02:00
|
|
|
faire un reboot<br>
|
2022-09-03 06:36:20 +02:00
|
|
|
|
2022-09-03 14:23:20 +02:00
|
|
|
configurer config.json<br>
|
|
|
|
|
|
|
|
url= ip du RPi<br>
|
|
|
|
port= le port choisi<br>
|
|
|
|
com1 à 4 = les discription des relais<br>
|