Hallo ihr Lieben,
hab heute mal versucht alles in den Flashspeicher zu laden. Server geht dann zwar online, aber es reagiert keine Taste mehr und die IR-LED sendet die ganze Zeit.
Was habe ich geändert?
Zu erst: strmp zu strmp_p
void loop() {
char* command = httpServer();
if (strcmp_P(command, "6an=") == 0) {
mySwitch.switchOn("01111", "00010");
} else if (strcmp_P(command, "6aus=") == 0) {
mySwitch.switchOff("01111", "00010");
}
if (strcmp_P(command, "7an=") == 0) {
mySwitch.switchOn("01111", "00001");
} else if (strcmp_P(command, "7aus=") == 0) {
mySwitch.switchOff("01111", "00001");
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "VolDown=") ==0) {
irsend.sendRC6(0x11, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "VolUp=") ==0) {
irsend.sendRC6(0x10, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "CHUp=") ==0) {
irsend.sendRC6(0xD4, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "CHDown=") ==0) {
irsend.sendRC6(0xC4, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "0=") ==0) {
irsend.sendRC6(0x00, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "9=") ==0) {
irsend.sendRC6(0x09, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "8=") ==0) {
irsend.sendRC6(0x08, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "7=") ==0) {
irsend.sendRC6(0x07, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "6=") ==0) {
irsend.sendRC6(0x06, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "5=") ==0) {
irsend.sendRC6(0x05, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "4=") ==0) {
irsend.sendRC6(0x04, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "3=") ==0) {
irsend.sendRC6(0x03, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "2=") ==0) {
irsend.sendRC6(0x02, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "1=") ==0) {
irsend.sendRC6(0x01, 20); // Samsung TV source
delay(40);
}
}
for (int i = 0; i < 3; i++) {
if (strcmp_P(command, "Power=") ==0) {
irsend.sendRC6(0x0C, 20); // Samsung TV source
delay(40);
}
}
}
Und dann noch das: println("irgendwas steht drinn") in println(F("irgendwas steht drinn"))
/**
* HTML-Seite die dem Client zurückgeschickt wird.
*/
void httpResponse(EthernetClient c) {
c.println(F("HTTP/1.1 200 OK"));
c.println(F("Content-Type: text/html"));
c.println();
c.println(F("<html>"));
c.println(F("<head>"));
c.println(F("<title>Funksteckdosen</title>"));
c.println(F("</head>"));
c.println(F("<body bgcolor=black>"));
c.println(F("
"));
c.println(F("<form method=get name=togl>"));
c.println(F("<button name=5an type=submit style=font-weight:bold;background-color:GREEN;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Schreibtisch-PC</font></button>"));
c.println(F("
"));
c.println(F("<button name=5aus type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Schreibtisch-PC</font></button>"));
c.println(F("
"));
c.println(F("<center><text><font color=white>_______________________</font></text></center>
"));
c.println(F("
"));
c.println(F("<button name=7an type=submit style=font-weight:bold;background-color:GREEN;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Wohnzimmer-PC</font></button>"));
c.println(F("
"));
c.println(F("<button name=7aus type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Wohnzimmer-PC</font></button>"));
c.println(F("
"));
c.println(F("<center><text><font color=white>_______________________</font></text></center>
"));
c.println(F("
"));
c.println(F("<button name=6an type=submit style=font-weight:bold;background-color:GREEN;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Zusatzsteckdose</font></button>"));
c.println("
");
c.println(F("<button name=6aus type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Zusatzsteckdose</font></button>"));
c.println(F("
"));
c.println(F("<button name=VolUp type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Volume Up</font></button>"));
c.println(F("<button name=VolDown type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Volume Down</font></button>"));
c.println(F("<button name=CHUp type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Channel Up</font></button>"));
c.println(F("<button name=CHDown type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Channel Down</font></button>"));
c.println(F("<button name=0 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7> 0</font></button>"));
c.println(F("<button name=9 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>9 </font></button>"));
c.println(F("<button name=8 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>8 </font></button>"));
c.println(F("<button name=7 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>7 </font></button>"));
c.println(F("<button name=6 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>6 </font></button>"));
c.println(F("<button name=5 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>5 </font></button>"));
c.println(F("<button name=4 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>4 </font></button>"));
c.println(F("<button name=3 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>3 </font></button>"));
c.println(F("<button name=2 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>2 </font></button>"));
c.println(F("<button name=1 type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7> 1</font></button>"));
c.println(F("<button name=Power type=submit style=font-weight:bold;background-color:RED;padding:10px;margin:2px;color:WHITE;height:100px;width:1000px><font size=7>Power </font></button>"));
c.println(F("</form>"));
c.println(F("</body>"));
c.println(F("</html>"));
}
Auserdem hab ich noch ein paar Fehler in meinem Sketch korrigiert, hatte ein paar Klammern vergessen. Hab ihn oben gleich aktualisiert. So wie er jetzt ist, funktioniert er auch.
LG aus Berlin