Hallo!
Ich möchte mal gerne nachfragen, ob schon mal jemand das selbe Problem hatte wie ich, und warum das so ist!
Ich habe ein Arduino Uno bord mit EthernetShield und ThinkerKit, worauf ein einfaches Webinterface (Tabelle mit buttons und statusmeldungen) zum setzen von Ausgängen läuft.
Funktion grundsätzlich OK, HTML source am client wie erwünscht und Website wird ebenso angezeigt.
<!DOCTYPE HTML>
<html><head>
<title>SAS-RC</title>
</head>
<body bgcolor="#444444">
<hr />
<h1><div align="center"><font color="#2076CD">SAS-RC</font></div></h1>
<hr />
<table id="OutputTable" border="1" cellpadding="5">
<tr bgColor="#222222">
<th width="70"> OutPut: </th>
<th width="60"> ON: </th>
<th width="60"> OFF: </th>
<th width="70"> State: </th>
</tr>
<tr bgColor="#222222">
<td align="center" bgcolor="#222222"><font face="Verdana" color="#CFCFCF" size="5">O2</font></td>
<td align="center" bgcolor="#222222"><form name="FON2" method="get"><input type="submit" name="OnO2" value="I" /></form></td>
<td align="center" bgcolor="#222222"><form name="FOFF2" method="get"><input type="submit" name="OffO2" value="O" /></form></td>
<td align="center"><font color="red" size="5">OFF</font></td>
</tr>
<tr bgColor="#222222">
<td align="center" bgcolor="#222222"><font face="Verdana" color="#CFCFCF" size="5">O3</font></td>
<td align="center" bgcolor="#222222"><form name="FON3" method="get"><input type="submit" name="OnO3" value="I" /></form></td>
<td align="center" bgcolor="#222222"><form name="FOFF3" method="get"><input type="submit" name="OffO3" value="O" /></form></td>
<td align="center"><font color="red" size="5">OFF</font></td>
</tr>
<tr bgColor="#222222">
<td align="center" bgcolor="#222222"><font face="Verdana" color="#CFCFCF" size="5">O4</font></td>
<td align="center" bgcolor="#222222"><form name="FON4" method="get"><input type="submit" name="OnO4" value="I" /></form></td>
<td align="center" bgcolor="#222222"><form name="FOFF4" method="get"><input type="submit" name="OffO4" value="O" /></form></td>
<td align="center"><font color="red" size="5">OFF</font></td>
</tr>
<tr bgColor="#222222">
<td align="center" bgcolor="#222222"><font face="Verdana" color="#CFCFCF" size="5">O5</font></td>
<td align="center" bgcolor="#222222"><form name="FON5" method="get"><input type="submit" name="OnO5" value="I" /></form></td>
<td align="center" bgcolor="#222222"><form name="FOFF5" method="get"><input type="submit" name="OffO5" value="O" /></form></td>
<td align="center"><font color="red" size="5">OFF</font></td>
</tr>
</table>
<table id="OutputTable" border="1" cellpadding="5">
<tr bgColor="#222222">
<th width="70"> OutPut: </th>
<th width="60"> ON: </th>
<th width="60"> OFF: </th>
<th width="70"> State: </th>
</tr>
<tr bgColor="#222222">
<td align="center" bgcolor="#222222"><font face="Verdana" color="#CFCFCF" size="5">O2</font></td>
<td align="center" bgcolor="#222222"><form name="FON2" method="get"><input type="submit" name="OnO2" value="I" /></form></td>
<td align="center" bgcolor="#222222"><form name="FOFF2" method="get"><input type="submit" name="OffO2" value="O" /></form></td>
<td align="center"><font color="red" size="5">OFF</font></td>
</tr>
<tr bgColor="#222222">
<td align="center" bgcolor="#222222"><font face="Verdana" color="#CFCFCF" size="5">O3</font></td>
<td align="center" bgcolor="#222222"><form name="FON3" method="get"><input type="submit" name="OnO3" value="I" /></form></td>
<td align="center" bgcolor="#222222"><form name="FOFF3" method="get"><input type="submit" name="OffO3" value="O" /></form></td>
<td align="center"><font color="red" size="5">OFF</font></td>
</tr>
<tr bgColor="#222222">
<td align="center" bgcolor="#222222"><font face="Verdana" color="#CFCFCF" size="5">O4</font></td>
<td align="center" bgcolor="#222222"><form name="FON4" method="get"><input type="submit" name="OnO4" value="I" /></form></td>
<td align="center" bgcolor="#222222"><form name="FOFF4" method="get"><input type="submit" name="OffO4" value="O" /></form></td>
<td align="center"><font color="red" size="5">OFF</font></td>
</tr>
<tr bgColor="#222222">
<td align="center" bgcolor="#222222"><font face="Verdana" color="#CFCFCF" size="5">O5</font></td>
<td align="center" bgcolor="#222222"><form name="FON5" method="get"><input type="submit" name="OnO5" value="I" /></form></td>
<td align="center" bgcolor="#222222"><form name="FOFF5" method="get"><input type="submit" name="OffO5" value="O" /></form></td>
<td align="center"><font color="red" size="5">OFF</font></td>
</tr>
</table>
<form name="AllOutputsOff" method="get"><input type="submit" name="allOut" value="Off Set All Outputs OFF" /></form>
</body></html>
Klicke ich nun auf einen Button, egal welchen treten eigenartige Darstellungsfehler auf. So wird in beiden Tabellen jeweils die folgende Zeile:
<td align="center" bgcolor="#222222"><form name="FOFF2" method="get"><input type="submit" name="OffO2" value="O" /></form></td>
zu
<td align="center" bgcolor="#222222"><form name="FOFF2" method="get"><input type="subm3" value="O" /></form></td>
Das hat zur Folge dass aus dem Button eine Eingabefeld wird.
So jetzt kommts: Wenn ich den Value von:
<form name="AllOutputsOff" method="get"><input type="submit" name="allOut" value="Off Set All Outputs OFF" /></form>
auf
<form name="AllOutputsOff" method="get"><input type="submit" name="allOut" value="Off" /></form>
abändere, ist dieses Problem behoben! Es tritt aber immer noch ein weitere Darstellungsfehler auf, so dass der Beginn des Html source (Client- seitig) wie folgt aussieht:
/1.1
T$
TP/1.1
<hr />
<h1><div align="center"><font color="#2076CD">SAS-RC</font></div></h1>
<hr />
Auch für dieses Problem gibt es eine Lösung!
Ich habe alle Serial.print(); Anweisungen (fürs debugging) aus dem Cpp source entfernt, und nun läuft es!
Ich wäre sehr dankbar wenn mir jemand erklären könnte, warum zum einen ein zu langer "value" eines Submit- Buttons und zum andern eine einfache Serial.print(); Anweisungen so einen Schrott produzieren kann.
Vielen Dank und
LG