WiFi - IR Sender und Empfänger

Begonnen von gloob, 23 Januar 2017, 19:11:39

Vorheriges Thema - Nächstes Thema

gloob

Hallo,

Ich habe ein "WiFi - IR Sender und Empfänger" Modul abzugeben.

Ich habe damit meinen Samsung TV ein und aus geschaltet, benötige das Modul jetzt aber nicht mehr.

geschaltet werden kann über einen einfachen Befehl: http://192.168.1.13/ir?code=E0E040BF&bits=32&protocol=Samsung
Es kann der zu sendende Code gesetzt werden sowie die Anzahl der Bits und das Protocol.

Zusätzlich ist ein Empfänger verbaut um die Signale einer Fernbedienung zu dekodieren.

Weitere Informationen zu dem Modul gibt es hier: IR WLAN Gateway

Ich hätte gerne 18€ 15€ für das Modul und kann als Versand einen gepolsterten Umschlag anbieten für 2€ oder als versichertes Paket für 5€.

Edit: Der Sketch auf dem Modul muss angepasst werden an das eigene WLAN, kann ich aber auch für euch übernehmen.


Wer selber flashen möchte, hier ist der Sketch den ich nutze:


#include <ESP8266WiFi.h>
#include <WiFiClient.h>
#include <ESP8266WebServer.h>
#include <ESP8266mDNS.h>
#include <IRremoteESP8266.h>

// WLAN data
const char* ssid = "xxx";
const char* password = "yyy";

// static IP
IPAddress ip(192,168,1,100);
IPAddress gateway(192,168,1,1);
IPAddress subnet(255,255,255,0);

MDNSResponder mdns;
ESP8266WebServer server(80);

// set your pin here  NOTE: Mapping to Arduino PIN
IRsend irsend(4);

void handleRoot() {
server.send(200, "text/html", "Please specify command! Form: /ir?code=xxx&bits=xx&protocol=x");
}

void handleIr(){
  String codestring=server.arg("code");
  String protocol=server.arg("protocol");
  String bitsstring=server.arg("bits");

  String webOutput = "Protocol: "+protocol+"; Code: "+codestring+"; Bits: "+bitsstring;
  Serial.println(webOutput);
   
  if ((codestring != "")&&(bitsstring != "")){
    //unsigned long code = codestring.toInt();
    char tarray[15];
    codestring.toCharArray(tarray, sizeof(tarray));
    unsigned long code = strtoul(tarray,NULL,16); 
    // unsigned long code = atol(codestring);
    int bits = bitsstring.toInt();
    Serial.println(code);
   
    if (protocol == "NEC"){
      server.send(200, "text/html", webOutput);
      irsend.sendNEC(code, bits);
    }
    else if (protocol == "Sony"){
      server.send(200, "text/html", webOutput);
      irsend.sendSony(code, bits);
    }
    else if (protocol == "Whynter"){
      server.send(200, "text/html", webOutput);
      irsend.sendWhynter(code, bits);
    }
    else if (protocol == "LG"){
      server.send(200, "text/html", webOutput);
      irsend.sendLG(code, bits);
    }
    else if (protocol == "RC5"){
      server.send(200, "text/html", webOutput);
      irsend.sendRC5(code, bits);
    }
    else if (protocol == "RC6"){
      server.send(200, "text/html", webOutput);
      irsend.sendRC6(code, bits);
    }
    else if (protocol == "DISH"){
      server.send(200, "text/html", webOutput);
      irsend.sendDISH(code, bits);
    }
    else if (protocol == "SharpRaw"){
      server.send(200, "text/html", webOutput);
      irsend.sendSharpRaw(code, bits);
    }
    else if (protocol == "Samsung"){
      server.send(200, "text/html", webOutput);
      irsend.sendSAMSUNG(code, bits);
    }
    else {
      server.send(200, "text/html", "Protocol not implemented!");
    }
  }
  else {
    server.send(200, "text/html", "Missing code or bits!");
  }
}

void handleNotFound(){
  server.send(404, "text/plain", "404");
}

void setup(void){
  irsend.begin();
  Serial.begin(9600);
  WiFi.begin(ssid, password);
// WiFi.config(ip, gateway, subnet);
  Serial.println("");
  // Wait for connection
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print("=");
  }
  Serial.println("");
  Serial.print("Connected to ");
  Serial.println(ssid);
  Serial.print("IP address: ");
  Serial.println(WiFi.localIP());
 
  if (mdns.begin("irsvr", WiFi.localIP())) {
    Serial.println("MDNS responder started");
  }
 
  server.on("/", handleRoot);
  server.on("/ir", handleIr);
  server.onNotFound(handleNotFound);
 
  server.begin();
  Serial.println("HTTP server started");
}

void loop(void){
  server.handleClient();
}
Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

gloob

#1
Ich hab auch noch ein 2. Modul abzugeben, allerdings bekomme ich da irgendwie den Empfänger nicht ans laufen. Das Senden funktioniert allerdings ohne Probleme.
Für 12€ 10€ trenne ich mich von dem Modul.
Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

gloob

Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

Markus

Raspberry Pi2 als FHEM-Plattform
HM, FS20, 1-Wire, PanStamp,LW12,Intertechno,ESPEasy,Alexa

gloob

Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

accessburn

Vielleicht ist hier ein Hilferuf erlaubt. Ich habe immer noch Probleme damit klar zu kommen wie ich die Software auf das Gerät bekomme.
Wäre schön wenn sich jemand melden würde der einem blutigen Anfänger hilft :-)
Wezzy Rpi2b> FHEM, Elro, Intenso, FTUI, Jeelink v3, Max!Cube, Fire5, Foscam, NAS, Fritz!Box + Fon, Max!Wandthermostat, Amazon Echo
Wezzy Rp3b> OctoPi
Jessie Rp3b> UPNP, NAS, Pi-Hole

gloob

Der Link im ersten Post hilft dir nicht?

Ich habe den Jumper zum flashen gebrückt, stecke dann den FTDI an, flashe das Modul, ziehen den FTDI ab, ziehe den Jumper ab und versorge das Modul über den USB Anschluss mit Strom.
Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway

tschennings

Hi gloob,
zu dem zweiten Modul: Du hast eine PM!
Grüße
tschennings

gloob

Raspberry Pi 3 | miniCUL 433MHz | nanoCUL 868 MHz | nanoCUL 433 MHz | MySensors WLAN Gateway | LaCrosse WLAN Gateway | SignalESP 433 MHz | SignalESP 868 MHz | HM-MOD-UART WLAN Gateway | IR - 360 Grad WLAN Gateway