Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
|
projets:cctv_disco:start [2021/11/22 13:29] admin [Esp8266 page web controle] |
projets:cctv_disco:start [2025/11/21 07:34] (Version actuelle) enseignant [CCTV disco] |
||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| ====== CCTV disco ====== | ====== CCTV disco ====== | ||
| * Porteur du projet : Boris arouimi | * Porteur du projet : Boris arouimi | ||
| - | * Fichiers utiles : //mettre un lien vers un code ou un fichier// | + | * Fichiers utiles : code dans l' |
| {{tag> | {{tag> | ||
| ===== Note d' | ===== Note d' | ||
| - | Une camera | + | Cette installation détourne une caméra |
| - | La camera filme l'instant | + | La caméra enregistre cet instant |
| + | |||
| + | L’œuvre s’inscrit dans une filiation avec les détournements critiques de Harun Farocki et l’esthétique de surveillance chorégraphiée chez Trevor Paglen, tout en convoquant une dimension presque carnavalesque. | ||
| {{ : | {{ : | ||
| ==== Références et liens ==== | ==== Références et liens ==== | ||
| + | * Harun Farocki | ||
| + | * Trevor Paglen | ||
| * https:// | * https:// | ||
| * https:// | * https:// | ||
| Ligne 21: | Ligne 25: | ||
| ===== Notes techniques et matériaux ===== | ===== Notes techniques et matériaux ===== | ||
| - | * Esp 32 | + | * **ESP32 cam** [[https:// |
| - | | + | la camera envoie un flux video en wifi...eventuellement avec Motioneye (sur linux) on peut ajouter des fonction de detection mouvement/ |
| - | | + | |
| - | | + | |
| - | | + | |
| - | | + | |
| + | * **ESP8266 :** Permet de commander en wifi l' | ||
| - | **ESP32 cam** [[https:// | + | |
| - | la camera envoie un flux video en wifi...eventuellement avec Motioneye | + | * :!: **Led 4mm** [[https:// |
| - | **ESP8266 :** Permet de commander en wifi l' | + | |
| + | | ||
| + | | ||
| + | * Enceinte Bluetooth si besoin son fort | ||
| - | **Lecteur mp3** (se declenche avec une arduino ou esp..) necessite une carte micro SD ! | ||
| - | [[https:// | ||
| - | necessite un ampli et enceinte pour faire :!: un son assez puissant.... ou enceinte bluetooth...batterie integrée.. | ||
| - | * Fonctionne avec librairie Redmp3.h | ||
| - | :!: **Led 4mm** ne seront pas puissante a cette taille.... | ||
| - | [[https:// | ||
| ==== Esp8266 page web controle ==== | ==== Esp8266 page web controle ==== | ||
| Ligne 55: | Ligne 53: | ||
| ==== Code ==== | ==== Code ==== | ||
| + | Code qui cree une pageweb avec deux boutons, déclenchant allumage de deux led et lancant fichier mp3. | ||
| + | L'url de la page est donné en serie. (en l' | ||
| + | |||
| <code c+> | <code c+> | ||
| - | /********* | + | // MP3 lib |
| - | Rui Santos | + | #include < |
| - | | + | #include " |
| - | *********/ | + | |
| + | #define MP3_RX 12//RX of Serial MP3 module connect to D7 of wemos | ||
| + | #define MP3_TX 13//TX to D8, wemos | ||
| + | MP3 mp3(MP3_RX, MP3_TX); | ||
| + | |||
| + | int8_t track = 0x01;//the first song in the TF card | ||
| + | int8_t track2 | ||
| + | int8_t volume = 0x1a;//0~0x1e (30 adjustable level) | ||
| + | |||
| // Load Wi-Fi library | // Load Wi-Fi library | ||
| #include < | #include < | ||
| + | |||
| // Replace with your network credentials | // Replace with your network credentials | ||
| const char* ssid = " | const char* ssid = " | ||
| const char* password = " | const char* password = " | ||
| + | |||
| // Set web server port number to 80 | // Set web server port number to 80 | ||
| WiFiServer server(80); | WiFiServer server(80); | ||
| + | |||
| // Variable to store the HTTP request | // Variable to store the HTTP request | ||
| String header; | String header; | ||
| + | |||
| // Auxiliar variables to store the current output state | // Auxiliar variables to store the current output state | ||
| String output5State = " | String output5State = " | ||
| String output4State = " | String output4State = " | ||
| + | |||
| // Assign output variables to GPIO pins | // Assign output variables to GPIO pins | ||
| const int output5 = 5; | const int output5 = 5; | ||
| const int output4 = 4; | const int output4 = 4; | ||
| + | |||
| // Current time | // Current time | ||
| unsigned long currentTime = millis(); | unsigned long currentTime = millis(); | ||
| Ligne 88: | Ligne 98: | ||
| // Define timeout time in milliseconds (example: 2000ms = 2s) | // Define timeout time in milliseconds (example: 2000ms = 2s) | ||
| const long timeoutTime = 2000; | const long timeoutTime = 2000; | ||
| + | |||
| void setup() { | void setup() { | ||
| Serial.begin(115200); | Serial.begin(115200); | ||
| Ligne 97: | Ligne 107: | ||
| digitalWrite(output5, | digitalWrite(output5, | ||
| digitalWrite(output4, | digitalWrite(output4, | ||
| + | |||
| // Connect to Wi-Fi network with SSID and password | // Connect to Wi-Fi network with SSID and password | ||
| Serial.print(" | Serial.print(" | ||
| Ligne 113: | Ligne 123: | ||
| server.begin(); | server.begin(); | ||
| } | } | ||
| + | |||
| void loop(){ | void loop(){ | ||
| WiFiClient client = server.available(); | WiFiClient client = server.available(); | ||
| + | |||
| if (client) { // If a new client connects, | if (client) { // If a new client connects, | ||
| Serial.println(" | Serial.println(" | ||
| Ligne 138: | Ligne 148: | ||
| client.println(" | client.println(" | ||
| client.println(); | client.println(); | ||
| - | | + | |
| // turns the GPIOs on and off | // turns the GPIOs on and off | ||
| if (header.indexOf(" | if (header.indexOf(" | ||
| Ligne 144: | Ligne 154: | ||
| output5State = " | output5State = " | ||
| digitalWrite(output5, | digitalWrite(output5, | ||
| + | mp3.playWithVolume(track2, | ||
| + | delay(50); | ||
| + | |||
| + | | ||
| } else if (header.indexOf(" | } else if (header.indexOf(" | ||
| Serial.println(" | Serial.println(" | ||
| output5State = " | output5State = " | ||
| digitalWrite(output5, | digitalWrite(output5, | ||
| + | mp3.stopPlay(); | ||
| + | delay(50); | ||
| + | |||
| + | | ||
| } else if (header.indexOf(" | } else if (header.indexOf(" | ||
| Serial.println(" | Serial.println(" | ||
| output4State = " | output4State = " | ||
| + | |||
| + | // | ||
| digitalWrite(output4, | digitalWrite(output4, | ||
| + | mp3.playWithVolume(track, | ||
| + | delay(50); | ||
| + | |||
| + | | ||
| } else if (header.indexOf(" | } else if (header.indexOf(" | ||
| Serial.println(" | Serial.println(" | ||
| output4State = " | output4State = " | ||
| digitalWrite(output4, | digitalWrite(output4, | ||
| + | mp3.stopPlay(); | ||
| + | delay(50); | ||
| } | } | ||
| - | | + | |
| // Display the HTML web page | // Display the HTML web page | ||
| client.println("< | client.println("< | ||
| Ligne 168: | Ligne 194: | ||
| client.println(" | client.println(" | ||
| client.println(" | client.println(" | ||
| - | | + | |
| // Web Page Heading | // Web Page Heading | ||
| client.println("< | client.println("< | ||
| - | | + | |
| // Display current state, and ON/OFF buttons for GPIO 5 | // Display current state, and ON/OFF buttons for GPIO 5 | ||
| client.println("< | client.println("< | ||
| Ligne 180: | Ligne 206: | ||
| client.println("< | client.println("< | ||
| } | } | ||
| - | + | ||
| // Display current state, and ON/OFF buttons for GPIO 4 | // Display current state, and ON/OFF buttons for GPIO 4 | ||
| client.println("< | client.println("< | ||
| Ligne 190: | Ligne 216: | ||
| } | } | ||
| client.println("</ | client.println("</ | ||
| - | | + | |
| // The HTTP response ends with another blank line | // The HTTP response ends with another blank line | ||
| client.println(); | client.println(); | ||
| Ligne 211: | Ligne 237: | ||
| } | } | ||
| } | } | ||
| - | |||
| </ | </ | ||
| - | ===== Photos et médias===== | + | {{: |
| Code pour afficher les images du projet : | Code pour afficher les images du projet : | ||
| {{gallery>?& | {{gallery>?& | ||