Hi,
ich bin gerade am Versuchen, einem ESP8266 (D1 Mini) beizubringen, über meine Fritzbox 7490 alle Telefone klingeln zu lassen, wenn die Haustürklingel geht - ein bekanntes Projekt mit diversen Anleitungen.
An sich funktioniert alles, wo wie es soll - nur klingelt kein Telefon.
Stattdessen bekomme ich immer wieder folgenden Fehler, sofern es damit zusammenhängt:
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Header>
<h:Challenge xmlns:h="http://soap-authentication.org/digest/2001/10/" s:mustUnderstand="1">
<Status>Unauthenticated</Status>
<Nonce>9B5965CDC2565C53</Nonce>
<Realm>F!Box SOAP-Auth</Realm>
</h:Challenge>
</s:Header>
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:dslforum-org:control-1-0">
<errorCode>503</errorCode>
<errorDescription></errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
Hat jemand ähnliche Probleme gehabt und diese gelöst bekommen?
Mein Sketch:
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
#include <ESP8266HTTPClient.h>
#include <tr064.h>
#define USE_SERIAL Serial
#define KLINGEL 0
ESP8266WiFiMulti WiFiMulti;
const char WIFI_SSID[] = "MEINE_SSID";
const char WIFI_PASSWORD[] = "MEIN_PW";
const char USER[] = "FRITZ_USER";
const char PASSWORD[] = "USER_PASSWORT";
const char FRITZBOX_IP[] = "192.168.1.1";
const int FRITZBOX_PORT = 49000;
TR064 tr064_connection(FRITZBOX_PORT, FRITZBOX_IP, USER, PASSWORD);
const char DEVICE_NAME[] = "Klingel";
const IPAddress STATIC_IP(192, 168, 1, 230);
const IPAddress GATEWAY(192, 168, 1, 1);
const IPAddress SUBNET(255, 255, 255, 0);
const IPAddress DNS(GATEWAY);
void setup() {
Serial.begin(115200);
delay(1000);
WiFi.hostname(DEVICE_NAME);
WiFi.config(STATIC_IP, SUBNET, GATEWAY, DNS);
WiFi.begin(WIFI_SSID, WIFI_PASSWORD);
WiFi.mode(WIFI_STA);
while (WiFi.status() != WL_CONNECTED) {
Serial.println("Verbinde...");
delay(100);
}
tr064_connection.init();
Serial.println("Verbunden!");
pinMode(KLINGEL, INPUT_PULLUP);
}
void loop() {
int klingel_stat = 0;
klingel_stat = digitalRead(KLINGEL);
if (klingel_stat == LOW) {
Serial.println();
Serial.printf("ANRUF!");
makecall();
}
else {
//Serial.println();
//Serial.printf("KEINE Klingel!");
delay(100);
}
}
int makecall() {
String tr064_service = "urn:dslforum-org:service:X_VoIP:1";
String call_params[][2] = {{"NewX_AVM-DE_PhoneNumber", "**9"}};
String req[][2] = {{}};
String params1[][2] = {{}};
tr064_connection.action(tr064_service, "X_AVM-DE-DialNumber", call_params, 1, req, 0);
delay(4000);
tr064_connection.action(tr064_service, "X_AVM-DE_DialHangup", params1, 1, req, 0);
}
Die komplette Ausgabe, wenn "KLINGEL" LOW geht:
ANRUF!action_3
action_1
The auth token is 88f63e0536a95156047059f54cd27182
[HTTP] begin: 192.168.1.1:49000/upnp/control/x_voip
<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Header><h:ClientAuth xmlns:h="http://soap-authentication.org/digest/2001/10/" s:mustUnderstand="1"><Nonce>9B5965CDC2565C53</Nonce><Auth>88f63e0536a95156047059f54cd27182</Auth><UserID>esp</UserID><Realm>F!Box SOAP-Auth</Realm></h:ClientAuth></s:Header><s:Body><u:X_AVM-DE-DialNumber xmlns:u='urn:dslforum-org:service:X_VoIP:1'><NewX_AVM-DE_PhoneNumber>**9</NewX_AVM-DE_PhoneNumber></u:X_AVM-DE-DialNumber></s:Body></s:Envelope>
[HTTP] POST... SOAPACTION: urn:dslforum-org:service:X_VoIP:1#X_AVM-DE-DialNumber
[HTTP] POST... code: 500
action_3
action_1
The auth token is 88f63e0536a95156047059f54cd27182
[HTTP] begin: 192.168.1.1:49000/upnp/control/x_voip
<?xml version="1.0"?><s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Header><h:ClientAuth xmlns:h="http://soap-authentication.org/digest/2001/10/" s:mustUnderstand="1"><Nonce>9B5965CDC2565C53</Nonce><Auth>88f63e0536a95156047059f54cd27182</Auth><UserID>esp</UserID><Realm>F!Box SOAP-Auth</Realm></h:ClientAuth></s:Header><s:Body><u:X_AVM-DE_DialHangup xmlns:u='urn:dslforum-org:service:X_VoIP:1'></u:X_AVM-DE_DialHangup></s:Body></s:Envelope>
[HTTP] POST... SOAPACTION: urn:dslforum-org:service:X_VoIP:1#X_AVM-DE_DialHangup
[HTTP] POST... code: 200
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Header>
<h:NextChallenge xmlns:h="http://soap-authentication.org/digest/2001/10/" s:mustUnderstand="1">
<Status>Authenticated</Status>
<Nonce>9E0471B8E39471D5</Nonce>
<Realm>F!Box SOAP-Auth</Realm>
</h:NextChallenge>
</s:Header>
<s:Body>
<u:X_AVM-DE_DialHangupResponse xmlns:u="urn:dslforum-org:service:X_VoIP:1"></u:X_AVM-DE_DialHangupResponse>
</s:Body>
</s:Envelope>
Und noch alles, was bis zum "Verbunden!" passiert:
Verbinde...Verbinde...Verbinde...[HTTP] begin: 192.168.1.1:49000/tr64desc. - Pastebin.com (zu viele Zeichen fürs Forum)
- Fritzbox-Nutzer ist angelegt und funktioniert
- Anwendungen im Netzwerk werden zugelassen
- Der ESP8266 hat eine feste IP (192.168.1.230) und UPnP ist erlaubt
- SIP-Telefon ist erstellt
- Virtuelles Telefon als Wählhelfer ist erstellt und so eingerichtet
Rundruf mit **9 funktioniert genauso wenig, wie die Direktwahl eines Telefons mit **610.
Ich weiß nicht mehr weiter...keine Ahnung, wo das Problem liegt...hoffentlich, weiß hier jemand eine Lösung.
Gruß,
Jannomag