Hintergrund:
In einer Eigentumswohungsanlage stellt die Eigentuemergemeinschaft per WLAN Internet zur Verfuegung. Jeder Eigentuemer hat Benutzername und Passwort erhalten. Zum LogIn muss man sich per WLAN mit diesen Daten auf einer Anmeldeseite anmelden. Die Verbindung bleibt dann fuer laengere Zeit bestehen. Nach nicht kalkulierbarer Zeit wird die Verbindung jedoch beendet und man muss sich erneut mit Benutzername und Passwort anmelden.
Solange ich vor Ort bin, ist das auch kein Problem. Manchmal ist aber die Homematic dort allein und verliert so den Kontakt zur Aussenwelt.
Ich moechte nun, dass die Homematic die Anmeldung per Script durchfuehrt:
meine Versuche mit:
system.Exec("wget --post-data 'username=XYZ&password=1234' http://192.168.16.1/login/");
haben leider keinen Erfolg.
Kann mir jemand helfen?
Hier ist der Quelltext der Anmeldeseite:
Code: Alles auswählen
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>internet hotspot > login</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="-1" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/>
<style type="text/css">
body {
color: #737373;
font-size: 10px;
font-family: verdana;
background: url('img/bg.jpg') no-repeat;
background-size: cover;
}
@media (max-width: 1000px) {
body {
background-size: auto;
}
}
textarea,input,select {
background-color: #FDFBFB;
border: 1px solid #BBBBBB;
padding: 2px;
margin: 1px;
font-size: 14px;
color: #808080;
}
a, a:link, a:visited, a:active { color: #AAAAAA; text-decoration: none; font-size: 10px; }
a:hover { border-bottom: 1px dotted #c1c1c1; color: #AAAAAA; }
img {border: none;}
td { font-size: 14px; color: #7A7A7A; }
.container {
padding: 15px;
}
</style>
</head>
<body>
<form name="sendin" action="http://192.168.16.1/login" method="post">
<input type="hidden" name="username" />
<input type="hidden" name="password" />
<input type="hidden" name="dst" value="" />
<input type="hidden" name="popup" value="true" />
</form>
<script type="text/javascript" src="/md5.js"></script>
<script type="text/javascript">
<!--
function doLogin() {
document.sendin.username.value = document.login.username.value;
document.sendin.password.value = hexMD5('\217' + document.login.password.value + '\354\244\150\162\177\153\276\023\152\303\054\066\134\131\166\110');
document.sendin.submit();
return false;
}
//-->
</script>
<table width="100%" style="margin-top: 10%;">
<tr class="container">
<td align="center" valign="middle">
<!--
<div class="notice" style="color: #c1c1c1; font-size: 9px">Please log on to use the internet hotspot service<br /></div><br />
-->
<table width="280" height="280" style="border: 1px solid #cccccc; padding: 0px;background-color: white;border-radius:15px;" cellpadding="0" cellspacing="0">
<tr>
<td align="center">
<a href="http://www.XXXXXXXXX.com" target="_blank" style="border: none;">
<img src="img/logo_300.png" alt="Rentel Wifi" style="width: 100%; max-width: 50px;"/></a><br>
XXXXXXXXXXX
</td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
<h1>XXXXXXXXXXX</h1>
</td>
</tr>
<tr>
<td align="center" valign="center" height="175" colspan="2">
<form name="login" action="http://192.168.16.1/login" method="post"
onSubmit="return doLogin()" >
<input type="hidden" name="dst" value="" />
<input type="hidden" name="popup" value="true" />
<table width="100" style="background-color: #ffffff">
<tr><td align="right">Usuario:</td>
<td><input style="width: 80px" name="username" type="text" value=""/></td>
</tr>
<tr><td align="right">Contraseña:</td>
<td><input style="width: 80px" name="password" type="password"/></td>
</tr>
<tr><td> </td>
<td><input type="submit" value="Conectar" style="padding: 5px 10px;" /></td>
</tr>
<tr>
<td colspan="2" style="text-align: center;">
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
document.login.username.focus();
//-->
</script>
</body>
</html>