Closed JimKnopfIoT closed 2 years ago
Today i successfully tried the curl script:
#!/bin/bash
credentials="<user>:<pwd>"
FB="fritz.box:49443"
Rufnummer="**611";
curl -4 -k --anyauth -u "${credentials}" \
"https://${FB}/upnp/control/x_voip" \
-H 'Content-Type: text/xml; charset="utf-8"' \
-H 'SoapAction: urn:dslforum-org:service:X_VoIP:1#X_AVM-DE_DialNumber' \
-d '<?xml version="1.0" encoding="utf-8"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<u:X_AVM-DE_DialNumber xmlns:u="urn:dslforum-org:service:X_VoIP:1">
<NewX_AVM-DE_PhoneNumber>'${Rufnummer}'</NewX_AVM-DE_PhoneNumber>
</u:X_AVM-DE_DialNumber>
</s:Body>
</s:Envelope>' > /dev/null 2>&1
netcat -4 fritz.box 10
The phone (this time **611) rang immediately. In the ino file the value "IP" is of type char. In tr064.cpp and in ESPHTTPClient.cpp it is type String. I noticed that ESPHTTPClient.cpp will inspect the url String if it'S http or https. So instead of using the ip as a value of "IP", i inserted "https://fritz.box" as the value for "IP" in my ino file. I removed the "HTTP" from line 400 (String TR064 ... starts at line 399). Now line 399/400 of tr064.cpp looks like:
String TR064::httpRequest(String url, String xml, String soapaction, bool retry) {
deb_println("[HTTP] Prepare HTTP request to URL: " + _ip + ":" + _port + url + "'.", DEBUG_INFO);
After some atempts, it gives up. The phone did not rang. The last line in the logfile is just the last printf message before the ESP12E goes into DeepSleep.
Any idea how to setup a proper https request? Seems http is disabled for requests like this on a Fritzbox.
Same Issue at my setup
moin,
there is probably an error on loading the initial XML. as you can see the URL String has no Service "https://fritz.box:49443" This should be : http://fritz.box:49000/upnp/control/x_voip
you can further Debug:
If you use wireshark you will probably see the correct httpResponse with the XML https://www.it-techblog.de/fritzbox-und-wireshark-wlan-router-von-avm-monitoren-teil-1/11/2017/
you can debug HTTPClient as well. use HTTPClient in step 2
https://github.com/esp8266/Arduino/blob/master/doc/Troubleshooting/debugging.rst
@JimKnopfIoT , @PhilKaBoom were either of you able to solve your issue yet?
@Aypac No. i didn'T solve the issue. I'm not a programmer. For now i disabled tr064 in my ESP doorbell. I only receive telegram msg's at the moment.
@saak2820 does your PR solve this issue?
@JimKnopfIoT @Aypac "Wählhilfe" in Fritzbox must be activated. https://service.avm.de/help/de/FRITZ-Box-Fon-WLAN-7490/017p1/hilfe_fon_waehlhilfe
@saak2820 does your PR solve this issue?
should be. if not there will be proper error messages
I consider this issue closed then. Please re-open or open new issue and refer to this.
Since i updated my Fritz!Box 7590 to 7.25 i have a problem with the tr064 stuff. I used the script published in c't and it was working well. In addition to the tr064 call, i use a telegram bot to message me if the doorbell rings. Anyway, since the mentioned update to 7.25 firmware, i noticed that it takes some time till i get the telegram msg after the doorbell rings. The tr064 calls a phone in the basement, so i didn't notice that it stops working because i'm not that often there. Today i startet an investigation, updated my Arduino libs and reflashed my Klingel.ino to the ESP 12E that i'm using. It seems, that something is wrong with http request from the Fritz!Box. Maybe AVM did some changes to not allow unsafe http requests? I tried to connect to port 49443 instead of 49000 but get the same error. I tried the script from roehrenkramladen.de but it creates the same error. Only the tr064 stuff stoped working. I receive the telegram notification with a delay because of the non working tr064 trials. I swapped the order in the ino file to first receive telegram notification before the internal phone call.
I do have a dedicated user/pwd and i can reach https://:49443/tr64desc.xml (http://:49000/tr64desc.xml is not working).
What changes are needed in the tr064.h and tr064.cpp (and of course in the ino file) to get the tr064 stuff working again? I tried to insert in tr064.cpp
WIFIClient client;
just before the lineHTTPClient http;
andhttp.begin(client, ip, _port, url);
instead ofhttp.begin(ip, _port, url);
But it didn't fix the problem.
This are my include files:
This is the tr064 stuff from my ino file:
This is the serial output before swapping the order for telegram notification (click to show)
Connecting toThis is the serial output after swapping the order for telegram notification (click to show)
Connecting to