MatMaul / pynetgear

Python library to control Netgear wireless routers through the SOAP-api.
MIT License
238 stars 75 forks source link

Error parsing xml response #44

Closed dmyers closed 6 years ago

dmyers commented 6 years ago

I'm not sure what I'm doing wrong, but my router is a Netgear R6200. I'm attempting to use this package with Home Assistant, but ran into an issue and ran it manually to try to debug more. The XML looks fine to me and even has the list of devices though I removed them. My logs look similar to the capture folder files too.

@MatMaul Have you seen this before by chance?

python -m pynetgear XXXXXX 192.168.1.1 admin   
Error parsing xml response: <?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope
        xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
        soap-env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        >
<soap-env:Body>
    <m:GetTrafficMeterStatisticsResponse
        xmlns:m="urn:NETGEAT-ROUTER:service:DeviceConfig:1">
        <NewTodayConnectionTime>--:--</NewTodayConnectionTime>
        <NewTodayUpload>2.00</NewTodayUpload>
        <NewTodayDownload>3.95</NewTodayDownload>
        <NewYesterdayConnectionTime>--:--</NewYesterdayConnectionTime>
        <NewYesterdayUpload>0.00</NewYesterdayUpload>
        <NewYesterdayDownload>0.00</NewYesterdayDownload>
        <NewWeekConnectionTime>--:--</NewWeekConnectionTime>
        <NewWeekUpload>2.00/0.29</NewWeekUpload>
        <NewWeekDownload>3.95/0.56</NewWeekDownload>
        <NewMonthConnectionTime>--:--</NewMonthConnectionTime>
        <NewMonthUpload>2.00/0.07</NewMonthUpload>
        <NewMonthDownload>3.95/0.13</NewMonthDownload>
        <NewLastMonthConnectionTime>--:--</NewLastMonthConnectionTime>
        <NewLastMonthUpload>0.00/0.00</NewLastMonthUpload>
        <NewLastMonthDownload>0.00/0.00</NewLastMonthDownload>
    </m:GetTrafficMeterStatisticsResponse>
    <ResponseCode>000</ResponseCode>
</soap-env:Body>
</soap-env:Envelope>

None
Error parsing xml response: <?xml version="1.0" encoding="UTF-8"?>
<soap-env:Envelope
        xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
        soap-env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
        >
<soap-env:Body>
    <m:GetAttachDeviceResponse
        xmlns:m="urn:NETGEAT-ROUTER:service:DeviceInfo:1">
        <NewAttachDevice>XXXXXXXXXXXX</NewAttachDevice>
    </m:GetAttachDeviceResponse>
    <ResponseCode>000</ResponseCode>
</soap-env:Body>
</soap-env:Envelope>

Error communicating with the Netgear router
MatMaul commented 6 years ago

Have you tried v0.4.1 ? I just tried and it works perfectly fine with your example.

MatMaul commented 6 years ago

Closing, you are using an old version for sure, "error parsing xml response" doesn't even exist anymore as an error in the code.