Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't access services apart from urn:dslforum-org:service #69

Open
overwerk opened this issue Sep 22, 2023 · 3 comments
Open

Can't access services apart from urn:dslforum-org:service #69

overwerk opened this issue Sep 22, 2023 · 3 comments
Labels

Comments

@overwerk
Copy link

overwerk commented Sep 22, 2023

Hi,

I tried for a couple of days to get the external IPv6 address of my FB 7490 via TR064 on my ESP32.

The IPv6 is available here:
TR064connection.action("urn:schemas-upnp-org:service:WANIPConnection:1", "X_AVM_DE_GetExternalIPv6Address", params, 0, req, 1, "/igdupnp/control/WANIPConn1");

The problem is, in the function "action_raw" the const _servicePrefix will be added infront of every service name.

_servicePrefix = "urn:dslforum-org:service:";

Therefore I couldn't access "urn:schemas-upnp-org:service:WANIPConnection:1", because in the end it was always "urn:dslforum-org:service:urn:schemas-upnp-org:service:WANIPConnection:1" and returned a 500er http request error.

In the same function you call "cleanOldServiceName", that strips away the prefixes of the services, if provided and later you use above mentioned const to add the prefixes.

Maybe it possible that cleanOldServiceName just adds the prefix, if not provided (service not starting with "urn:" than add it here, otherwise keep the servicename. Afterwards you can get rid of all the _servicePrefix concats in "action_raw".

Best regards and thank you for the library!

@overwerk overwerk added the bug label Sep 22, 2023
@Aypac
Copy link
Owner

Aypac commented Sep 22, 2023

Hey,
Thanks for the report. I'll have to see when I have the time to fix it. In the meantime you could try to simply overwrite the _servicePrefix before URL init

@saak2820
Copy link
Contributor

Hey @overwerk

The TR-064 protocol is based on the UPnP standard, but the upnp addresses are not part of it.
I don't know what is in your project and if you need the Tr064 library for it. Otherwise a simple POST request will give you the desired result.
As an example here a CURL request:

curl -s "http://fritz.box:49000/igdupnp/control/WANIPConn1" -H "Content-Type: text/xml; charset="utf-8"" -H "SoapAction:urn:schemas-upnp-org:service:WANIPConnection:1#X_AVM_DE_GetExternalIPv6Address" -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_GetExternalIPv6Address xmlns:u='urn:schemas-upnp-org:service:WANIPConnection:1'/> </s:Body> </s:Envelope>" -s | grep -Eo '\<[[:alnum:]]{0,}(\:[[:alnum:]]{0,4}){7}\>'

But since the SOAP request is the same, I created a method that handles this. you can try this in the branch develop.

https://github.com/saak2820/Arduino-TR-064-SOAP-Library.git

@overwerk
Copy link
Author

overwerk commented Sep 27, 2023

Thank you, I tested it and it seems to work, but I get this error message too:

08:09:08.586 -> [TR064][processGeneralXMLParam] TR064 error, errorCode: '503'
08:09:08.650 -> [TR064][processGeneralXMLParam] TR064 error, errorCodeMessage: 'Authentication failed. No Secret in Header?'
08:09:08.779 -> [TR064][processGeneralXMLParam] TR064 error, errorDescription: auth. failed`

Request I made:

  String params[][2] = { {} };
  String req[][2] = { { "NewX_AVM-DE_HostListPath", "" } };
  TR064connection.action("urn:dslforum-org:service:Hosts:1", "X_AVM-DE_GetHostListPath", params, 0, req, 1);

Strangely it seems to work though, I get the result...

EDIT: Nevermind.. I get the same error message with the old configuration. I dig deeper when I have the time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants