Salut j’essaie d'avancer avec mes petits moyens
voici ce que j'ai fais:
/*
* WiFi IR Blaster by Buddy Crotty
* Use an ESP8266 module or dev board to receive HTTP GET request
* and then send IR codes to an attached IR LED based on those requests.
* This works best with another web server acting as a front end that
* sends cURL requests based on which buttons are pressed.
* cURL format:
http://ESP8266/IRcode
*/
#include <ESP8266WiFi.h>
#include <IRremoteESP8266.h>
#include <ESP8266mDNS.h>
const char* ssid = "xxxx";
const char* password = "xxxxxxx";
MDNSResponder mdns;
int khz = 38; // 38kHz carrier frequency for both NEC and Samsung
IRsend irsend(4); //an IR led is connected to GPIO4 (pin D2 on NodeMCU)
// Insert RAW IR signal for "Lamp On"
unsigned int irLampon[] = {9000,4400, 550,600, 550,1700, 550,600, 500,600, 550,600, 550,600, 500,600, 550,600, 500,600, 550,1700, 550,1700, 550,1650, 550,1700, 550,1650, 550,1700, 550,1700, 550,1650, 550,600, 550,600, 550,600, 500,600, 550,600, 550,550, 550,600, 550,600, 500,1700, 550,1700, 550,1700, 550,1650, 550,1700, 550,1650, 550,1700, 550};
// Insert RAW IR signal for "Lamp Off"
unsigned int irLampoff[] = {9000,4400, 600,600, 500,1700, 550,550, 600,600, 500,600, 550,600, 500,600, 550,600, 550,600, 500,1700, 550,1700, 550,1700, 500,1700, 550,1700, 550,1650, 550,1750, 500,600, 550,1650, 600,550, 550,600, 550,550, 550,600, 550,600, 550,600, 500,1700, 550,600, 550,1700, 550,1650, 550,1700, 550,1700, 550,1700, 500,1750, 500};
// Insert RAW IR signal for "Varmin"
unsigned int irVarmin[] = {9050,4400, 550,600, 550,1650, 550,600, 550,600, 500,600, 550,600, 550,600, 500,600, 550,600, 550,1650, 550,1700, 550,1650, 600,1650, 550,1700, 550,1650, 600,1650, 550,600, 550,550, 600,600, 500,600, 550,1650, 600,550, 550,600, 550,550, 550,1700, 550,1700, 550,1650, 600,1650, 550,600, 550,1650, 550,1700, 550,1700, 550};
// Insert RAW IR signal for "Varmax"
unsigned int irVarmax[] = {9000,4450, 550,600, 500,1700, 550,550, 600,550, 550,600, 550,600, 550,600, 500,600, 550,600, 500,1700, 550,1700, 550,1700, 550,1650, 550,1700, 550,1650, 600,1650, 550,1700, 550,600, 500,650, 500,1700, 550,550, 600,550, 550,600, 550,600, 550,550, 550,1700, 550,1650, 550,600, 550,1700, 550,1700, 550,1650, 550,1700, 550};
// Insert RAW IR signal for "Blancagre"
unsigned int irBlancagre[] = {9000,4400, 550,600, 550,1650, 600,600, 500,600, 550,600, 500,600, 550,600, 550,600, 500,600, 550,1650, 600,1650, 550,1700, 550,1650, 600,1650, 550,1700, 550,1700, 550,1650, 550,600, 550,600, 550,600, 500,1700, 550,600, 550,600, 500,600, 550,600, 500,1700, 550,1700, 550,1650, 600,550, 550,1700, 550,1650, 600,1650, 550};
// Insert RAW IR signal for "Blancchau"
unsigned int irBlanchau[] = {9000,4400, 550,600, 550,1650, 550,600, 550,600, 500,600, 550,600, 550,600, 500,600, 550,600, 550,1650, 550,1700, 550,1650, 550,1700, 550,1700, 550,1650, 600,1650, 550,600, 550,1650, 550,600, 550,1650, 600,600, 500,600, 550,600, 500,600, 550,1700, 550,550, 550,1700, 550,600, 550,1650, 550,1700, 550,1700, 550,1650, 550};
// Insert RAW IR signal for "Blancneut"
unsigned int irBlancneut[] = {9000,4400, 550,600, 550,1650, 550,600, 550,600, 500,600, 550,600, 550,600, 500,600, 550,600, 550,1650, 550,1700, 550,1650, 550,1700, 550,1700, 550,1650, 600,1650, 550,600, 550,1650, 550,600, 550,1650, 600,600, 500,600, 550,600, 500,600, 550,1700, 550,550, 550,1700, 550,600, 550,1650, 550,1700, 550,1700, 550,1650, 550};
// Insert RAW IR signal for "Blancfroi"
unsigned int irRBlancfroi[] = {9000,4450, 550,600, 500,1700, 550,600, 550,600, 500,600, 550,600, 550,600, 500,600, 550,600, 500,1700, 550,1700, 550,1650, 550,1700, 550,1700, 550,1650, 550,1700, 550,1700, 550,1650, 550,600, 550,600, 550,600, 500,600, 550,600, 500,650, 500,600, 550,600, 500,1700, 550,1700, 550,1650, 550,1700, 550,1700, 550,1650, 600}; // NEC 4B36D32C
// Insert RAW IR signal for "Receiver Power On"
un//signed int irRECpwrON[] = {9000,4400, 600,550, 600,1600, 600,500, 600,550, 600,1600, 600,500, 600,1600, 650,1600, 600,1600, 600,500, 650,1600, 600,1600, 600,500, 650,1600, 600,1600, 600,500, 600,550, 600,500, 600,1600, 600,550, 600,500, 600,500, 650,500, 600,500, 600,1600, 650,1600, 600,500, 600,1600, 650,1600, 600,1600, 600,1600, 600,1600, 650}; // NEC 4BB620DF
// Insert RAW IR signal for "Receiver Power Off"
un//signed int irRECpwrOFF[] = {9000,4400, 600,550, 550,1650, 600,550, 550,550, 600,1650, 550,550, 600,1650, 550,1650, 600,550, 550,550, 550,1650, 600,1650, 600,550, 550,1650, 600,1650, 550,550, 600,1650, 550,1650, 600,1650, 600,500, 600,550, 550,550, 600,1650, 550,550, 600,500, 600,550, 550,550, 550,1700, 550,1650, 600,1650, 550,550, 600,1650, 550}; // NEC 4B36E21D
// Insert RAW IR signal for "Receiver Mute"
un//signed int irRECmute[] = {9000,4400, 650,450, 650,1600, 600,500, 600,500, 650,1600, 600,500, 600,1650, 600,1600, 600,1600, 650,500, 600,1600, 650,1600, 600,500, 600,1600, 650,1600, 600,500, 600,1650, 600,500, 600,1600, 650,500, 600,500, 600,500, 600,500, 650,500, 600,500, 600,1600, 650,500, 600,1600, 600,1600, 650,1600, 600,1650, 600,1600, 600}; // NEC 4BB6A05F
// Insert RAW IR signal for "Receiver Volume Down"
un//signed int irRECvdn[] = {9150,4250, 750,350, 700,1550, 700,400, 700,450, 650,1550, 700,450, 600,1600, 650,1600, 600,1650, 600,500, 600,1650, 600,1600, 600,550, 600,1600, 600,1650, 600,500, 600,1650, 600,1600, 650,500, 600,500, 600,500, 650,500, 600,500, 600,500, 600,550, 600,500, 600,1650, 600,1600, 600,1650, 600,1650, 600,1600, 600,1650, 600}; // NEC 4BB6C03F
// Insert RAW IR signal for "Receiver Volume Up"
un//signed int irRECvup[] = {9050,4400, 650,500, 600,1600, 600,550, 600,500, 600,1650, 600,500, 600,1600, 650,1600, 600,1600, 600,550, 600,1600, 600,1600, 650,500, 600,1600, 650,1600, 600,500, 600,550, 600,1600, 600,550, 600,500, 600,550, 600,500, 600,550, 600,500, 600,1600, 650,500, 600,1600, 600,1650, 600,1600, 600,1650, 600,1600, 600,1600, 600}; // NEC 4BB640BF
// Insert RAW IR signal for "Receiver Source CBL/SAT"
un//signed int irRECsrc[] = {8950,4450, 600,500, 600,1650, 600,500, 600,500, 600,1650, 600,500, 600,1600, 600,1650, 600,1600, 600,550, 600,1600, 600,1650, 600,500, 600,1600, 600,1650, 600,500, 600,500, 600,1650, 600,1600, 600,1650, 600,500, 600,500, 600,500, 650,500, 600,1600, 600,500, 600,550, 600,500, 600,1600, 600,1650, 600,1600, 600,1650, 600}; // NEC 4BB6708F
// Create an instance of the server
// specify the port to listen on as an argument
WiFiServer server(80);
void setup() {
Serial.begin(115200);
delay(10);
irsend.begin();
// Connect to WiFi network
Serial.println();
Serial.println();
Serial.print("Connecting to ");
Serial.println(ssid);
WiFi.begin(ssid, password);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi Connected");
// Start the server
server.begin();
Serial.println("HTTP Server Started");
// Print the IP address
Serial.print("IP Address: ");
Serial.println(WiFi.localIP());
if (mdns.begin("IRBlasterLR", WiFi.localIP())) {
Serial.println("MDNS Responder Started");
}
Serial.println();
Serial.println();
}
void loop() {
// Check if a client has connected
WiFiClient client = server.available();
if (!client) {
return;
}
// Wait until the client sends some data
Serial.println("new client");
while(!client.available()){
delay(1);
}
// Read the first line of the request
String req = client.readStringUntil('\r');
Serial.println(req);
client.flush();
// Match the request
if (req.indexOf("/irLampon") != -1){
irsend.sendRaw(irLampon, sizeof(irTLampon) / sizeof(irLampon[0]), khz);
Serial.println("IRreq irLampon sent");
}
else if (req.indexOf("/irLampoff") != -1){
irsend.sendRaw(irLampoff, sizeof(irLampoff) / sizeof(irLampoff[0]), khz);
Serial.println("IRreq irLampoff sent");
}
else if (req.indexOf("/irVarmin") != -1){
irsend.sendRaw(irVarmin, sizeof(irVarmin) / sizeof(irVarmin[0]), khz);
Serial.println("IRreq irVarmin sent");
}
else if (req.indexOf("/irVarmax") != -1){
irsend.sendRaw(irVarmax, sizeof(irVarmax) / sizeof(irVarmax[0]), khz);
Serial.println("IRreq irVarmax sent");
}
else if (req.indexOf("/irBlancagre") != -1){
irsend.sendRaw(irBlancagre, sizeof(irBlancagre) / sizeof(irBlancagre[0]), khz);
Serial.println("IRreq irBlancagre sent");
}
else if (req.indexOf("/irBlanchau") != -1){
irsend.sendRaw(irBlanchau, sizeof(irBlanchau) / sizeof(irBlanchau[0]), khz);
Serial.println("IRreq irBlanchau sent");
}
else if (req.indexOf("/irBlancneut") != -1){
irsend.sendRaw(irBlancneut, sizeof(irBlancneut) / sizeof(irBlancneut[0]), khz);
Serial.println("IRreq irBlancneut sent");
}
else if (req.indexOf("/irRBlancfroi") != -1){
irsend.sendRaw(irRBlancfroi, sizeof(irRBlancfroi) / sizeof(irRBlancfroi[0]), khz);
Serial.println("IRreq irRBlancfroi sent");
}
else {
Serial.println("invalid request");
client.stop();
return;
}
client.flush();
// Send the response to the client
//client.print(s);
client.print("HTTP/1.1 200 OK\r\n");
delay(1);
Serial.println("Client Disconnected");
Serial.println();
// The client will actually be disconnected
// when the function returns and 'client' object is detroyed
}
et j'ai cette erreur :
Jedi_lampe.ino:11:29: fatal error: IRremoteESP8266.h: No such file or directory
compilation terminated.
Erreur lors de la compilation.
je n'arrive pas à trouver cette librairie même sur le site que tu m'as indiqué.
une idée ?