Closed jipp closed 1 year ago
Hmmm, just a few scattered thoughts before I look deeper into it:
fritz.box
instead of the IP for the cURL request. Maybe check if your box is really using 192.168.178.1
http://192.168.178.1:49000/tr64desc.xml
- can you check what that returns if you cURL it?some quick answers - not all you asked for:
--
Could be related to #21
Don't think so as "Serial.println
" is executed in the main loop
-- You use fritz.box instead of the IP for the cURL request. Maybe check if your box is really using 192.168.178.1
nslookup fritz.box
Server: 192.168.178.1
Address: 192.168.178.1#53
Name: fritz.box
Address: 192.168.178.1
Also the web interface reacts on both: name and IP.
-- The first request that the library sends is to http://192.168.178.1:49000/tr64desc.xml - can you check what that returns if you cURL it?
one more thing - when only posting the 1st xml statement using cURL:
curl -s -k -m 5 "http://192.168.178.1:49000/upnp/control/deviceinfo" -H 'Content-Type: text/xml; charset="utf-8"' -H "SoapAction:urn:dslforum-org:service:DeviceInfo:1#GetInfo" -d "<?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:InitChallenge xmlns:h=\"http://soap-authentication.org/digest/2001/10/\" s:mustUnderstand=\"1\"><UserID>doorbell</UserID></h:InitChallenge ></s:Header><s:Body><u:GetGenericAssociatedDeviceInfo xmlns:u='urn:dslforum-org:service:WLANConfiguration:1'><NewAssociatedDeviceIndex>1</NewAssociatedDeviceIndex></u:GetGenericAssociatedDeviceInfo></s:Body></s:Envelope>"
<?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>FBE96F5D7D9F3FDF</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>
Tried another example, same result
how to use https in your setup? cURL is also working with http
I just started testing on my hardware and seeing the same thing. Looks like I messed up somewhere. I'll try to figure it out asap and let you know.
Ok, so the reason why it was not working for me was simply because I deactivated the option to require a password to log into the UI; turns out the FB does not even provide Nonce's then (as it just allows you to do anything without authentication). I guess that is not the case for you? Can you maybe try the code on this branch ? Maybe it'll help...
Ok, after delving into this for a few hours I ended up adding many improvements to the lib (see above mentioned branch). I hope one of them will help you. If you still get a 500, try the new example 'simple-router-info' (only available on that branch for now).
Hi
thanks a lot for your effort and time.
I have downloaded the branch you referred and started the "simple-router.info.ino". below the output. I think we are a step further. but I see a crash at the end of the execution - using a wemos d1 mini pro.
will try the original sketch as well.
tested now the original sketch for dialing out - no crash and no success:
[action] Call with extraction of return arguments.
[action] Call with parameters/arguments to be passed.
[action] Attempt 1 of calling X_AVM-DE_DialNumber on urn:dslforum-org:service:X_VoIP:1
[HTTP] Prepare HTTP request to URL: 'http://192.168.178.1:49000'.
[HTTP] Printing the XML to be posted (between lines):
---------------------------------
<?xml version="1.0"?>
<s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Header><h:InitChallenge xmlns:h="http://soap-authentication.org/digest/2001/10/" s:mustUnderstand="1"><UserID>doorbell</UserID></h:InitChallenge ></s:Header><s:Body><u:X_AVM-DE_DialNumber xmlns:u='urn:dslforum-org:service:X_VoIP:1'><NewX_AVM-DE_PhoneNumber>**1</NewX_AVM-DE_PhoneNumber></u:X_AVM-DE_DialNumber></s:Body></s:Envelope>
---------------------------------
[HTTP] POSTing the XML to SOAPACTION: 'urn:dslforum-org:service:X_VoIP:1#X_AVM-DE_DialNumber'
[HTTP] Request code: 500
[HTTP] Printing received reply (between lines):
---------------------------------
---------------------------------
[action] Response status:
[action]<error> Got an empty reply (e.g. http error). Trying again in 10s.
Hmmm, mysterious. The error message you get means: "Attempt to read/write memory with an unaligned address (for example, trying to read/write a 32-bit word at an address that is not a multiple of 4)", see more here.
For the other program; I guess you already did this, rigtht?
Can you also show me the code you are using? I just realized, that the line
[HTTP] Prepare HTTP request to URL: 'http://192.168.178.1:49000'.
should read
[HTTP] Prepare HTTP request to URL: 'http://192.168.178.1:49000/upnp/control/x_voip'.
which makes me wonder if the request is proper.
the crash got simply fixed by changing the usb port on the laptop - not reliable power ....
here the code for the router info. seems to have a problem wit hthis "http://192.168.178.1:49000/upnp/control/deviceinfo" -> not found webpage error 404 when pasted to a browser
here the log and sketch for the caller.ino (I checked the link you posted and enabled the check-box)
here the code for the router info. seems to have a problem wit hthis "http://192.168.178.1:49000/upnp/control/deviceinfo" -> not found webpage error 404 when pasted to a browser
Not sure what you are saying here: does it work from the ESP or does it not? If it does not work, can you post the log again?
Have you tried putting in **9
as a number (call all phones) for the caller example? Just thinking because if I place a request for a non-existing MAC I get the 500 error.
@kirk-loeten have you maybe encountered this error before?
Hi
just reducing the troubleshooting to the simple-router-info.ino in a first trial to avoid config problems. Took your sketch and just entered my credentials and ip. also moved the loop content to the setup. to avoid multiple executions.
the syslog messages on the fritz box shows that the user authenticated correct.
the log messages from the sketch below:
Hi, Sorry things are a bit turbulent with COVID right now. I'll come back to you ASAP.
Hi
no problem - there are more urgent things in live than coding. - hope all is fine.
nevertheless I have run the "simple-router-info.ino" on platformio and tried again. looks like " connection.init()" was the key here - seems to be mandatory.
[main] Info retrieved.
[main] Router Model: FRITZ!Box 6590 Cable
[main] Router software version: 148.07.12
[main] Router up time: 198542s
Next try would be doing some dialout.
cheers Wolfgang
HI
just added one additional printout in the tr064.cpp to see the reply from the router - typically it is only printed with return code 200:
[HTTP] POSTing the XML to SOAPACTION: 'urn:dslforum-org:service:X_VoIP:1#X_AVM-DE_DialNumber'
[HTTP] Request code: 500
<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<s:Body>
<s:Fault>
<faultcode>s:Client</faultcode>
<faultstring>UPnPError</faultstring>
<detail>
<UPnPError xmlns="urn:schemas-upnp-org:control-1-0">
<errorCode>401</errorCode>
<errorDescription>Invalid Action</errorDescription>
</UPnPError>
</detail>
</s:Fault>
</s:Body>
</s:Envelope>
[HTTP] Printing received reply (between lines):
---------------------------------
---------------------------------
from the avm docs I see that this is:
If an unknown action is used the returned code is 401. This return code is used for obsoleted actions, too.
cheers Wolfgang
no problem - there are more urgent things in live than coding. - hope all is fine.
Yes, all is fine :) Just got a bit busy.
nevertheless I have run the "simple-router-info.ino" on platformio and tried again. looks like " connection.init()" was the key here - seems to be mandatory.
That is indeed required, but that should have been there as also witnessed by the output you posted:
21:03:18.942 -> [initServiceURLs] Detected Services: [...]
Weird. But whatever they say about gift horses... It seems to work now.
On top, I'll push a change soon that makes sure .init()
runs before any .action
is triggered.
Which brings me to the new error you see
[HTTP] POSTing the XML to SOAPACTION: 'urn:dslforum-org:service:X_VoIP:1#X_AVM-DE_DialNumber' and If an unknown action is used the returned code is 401. This return code is used for obsoleted actions, too.
indeed looking at the services provided by your router that service does not seem to be available...
Maybe try to explore these?
I did not follow all steps you discussed in perfect detail, but I just wanted to confirm that this problem also happens on the 7590. I tried your and also get the error
17:17:58.334 -> Button pressed[action] no nonce/realm found. requesting...
17:17:58.334 -> [HTTP] prepare request to URL: http://192.168.178.1:49000
17:17:58.369 -> [HTTP] POST... SOAPACTION: 'urn:dslforum-org:service:WLANConfiguration:1#GetGenericAssociatedDeviceInfo'
17:17:58.369 -> [HTTP] request code: 500
Also, just as above:
curl -s -k -m 5 --anyauth -u "klingel:ringdingringdingringdingringding" "http://192.168.178.1:49000/upnp/control/deviceinfo" -H 'Content-Type: text/xml; charset="utf-8"' -H "SoapAction:urn:dslforum-org:service:DeviceInfo:1#GetInfo" -d "<?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:InitChallenge xmlns:h=\"http://soap-authentication.org/digest/2001/10/\" s:mustUnderstand=\"1\"><UserID>doorbell</UserID></h:InitChallenge ></s:Header><s:Body><u:GetGenericAssociatedDeviceInfo xmlns:u='urn:dslforum-org:service:WLANConfiguration:1'><NewAssociatedDeviceIndex>1</NewAssociatedDeviceIndex></u:GetGenericAssociatedDeviceInfo></s:Body></s:Envelope>"
creates
<?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>353C512DBD67CCFF</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>
Let me know if I can do anything to help :)
Let's move this into a separate issue, otherwise it'll be a bit messy here (also I'm not sure yet, if this really is the same problem).
Hi Wolfgang, did you make any progress with this?
was stuck with other projects - will continue soon
HI
I started looking into the issue again and tried the latest version from main - still no success.
shall we open the current TR again, or is ther another to jump on?
cheers Wolfgang
There is a new release now (1.2.0 / 3fb0d1b) that might fix it.
Hi @jipp , Please try the new release 1.2.1. If this does not solve your issue, please reopen this issue.
Hi
I just copied the example caller and changed the credentials for wifi (working) also added username/password for the FB account using. Now trying to place a call. wit debug enabled I got the following output:
using some trial curl requests like:
curl -s -k -m 5 --anyauth -u "xxx:1234567890" "http://Fritz.Box:49000/upnp/control/deviceinfo" -H 'Content-Type: text/xml; charset="utf-8"' -H "SoapAction:urn:dslforum-org:service:DeviceInfo:1#GetInfo" -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:GetInfo xmlns:u='urn:dslforum-org:service:DeviceInfo:1'></u:GetInfo></s:Body></s:Envelope>"
works
do you have any hint what an I doing wrong?
thanks lot