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

Support for InternetGatewayDevice:2 #4

Open
phpbg opened this issue May 8, 2020 · 2 comments
Open

Support for InternetGatewayDevice:2 #4

phpbg opened this issue May 8, 2020 · 2 comments

Comments

@phpbg
Copy link

phpbg commented May 8, 2020

Hi,

currently you only support InternetGatewayDevice:1 -> WANDevice:1

can you also add support for InternetGatewayDevice:2 -> WANDevice:2

Only search string has to be changed, metrics are the same.

device = st.find("d:device[d:deviceType='urn:schemas-upnp-org:device:InternetGatewayDevice:1']/d:deviceList/d:device[d:deviceType='urn:schemas-upnp-org:device:WANDevice:1']", ns)
@fatpat
Copy link

fatpat commented Nov 6, 2020

fatpat@3a10813

@yrro
Copy link
Owner

yrro commented Jun 17, 2022

Interesting. I now have a cable modem with InternetGatewayDevice:2 and WANDevice:2 but I'm unable to fetch metrics from it.

To be precise, I send:

POST /ctl/CmnIfCfg HTTP/1.1                                                                                                                                                                                                         
Accept-Encoding: identity                                                                                                                                                                                                                    
Content-Length: 272                                                                                                                                                                                                                          
Host: 192.168.0.1:55589                    
User-Agent: Python-urllib/3.6                                                                                                                   
Content-Type: text/xml                                                                                                                                                                                                                       
Soapaction: "urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1#GetTotalPacketsReceived"                                                                                                                                                
Connection: close                                                                                                                                                                                                                            

<?xml version="1.0"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
  <s:Body>
    <u:GetTotalPacketsReceived/>
  </s:Body>
</s:Envelope>

and receive:

HTTP/1.1 500 Internal Server Error                                                                                                                                                                                             
Content-Type: text/xml; charset="utf-8"                                                                                                                                                                                                      
Connection: close                          
Content-Length: 398
Server: CommonRG IGD 2.0 UPnP/1.1 MiniUPnPd/2.0                                                                                                                                                                                              
Ext:                                       
Date: Fri, 17 Jun 2022 12:18:46 GMT
                                                                                                                                                                                                                                             
<?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>

... I guess because there's no GetTotalPacketsReceived method declared. The only method declared for this service is GetCommonLinkProperties.

State variables TotalPacketsReceived and so on are declared, but there's no method declared to fetch them!

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

No branches or pull requests

3 participants