gruijter / netgear.js

Node js module to communicate with Netgear routers via SOAP
Mozilla Public License 2.0
58 stars 11 forks source link

Fixed 5G enable for R8000 #3

Closed alackmann closed 6 years ago

alackmann commented 6 years ago

Hi Robin,

I retested your update v.1.5.0 and it does not function on my R8000. (Firmware: V1.0.4.18_10.1.49 which I believe is the latest).

While it does seems strange - this PR uses values that function correctly. Somewhat strangely, the Set5G1GuestAccessEnabled2 action value actually corresponds to the first 5G Guest network in the web admin, while the Set5GGuestAccessEnabled seems to be the second (at least for me).

Maybe there is someone else with an R8000 who can confirm?

alackmann commented 6 years ago

Oh - also the specific SOAP-ENV:Body for the second network isn't required. It doesn't work with that set either. Weird that it's different than the 2.4Ghz values.

gruijter commented 6 years ago

For the R7800 the first 5G network is using Set5GGuestAccessEnabled, which makes more sense then Set5G1GuestAccessEnabled2.

I suggest to get more info from other users on what is the common soap command (assuming Netgear bothered to make a standard)

alackmann commented 6 years ago

Robin, FYI I've deployed my pr now into my home automation system and it's successfully switching the guest wiki on/off. I'm pretty certain it's good. Do you want me to recapture the traffic from the Netgear Genie app and share?

gruijter commented 6 years ago

Yes, please share the capture! Do you have both 2.4 and 5g as second guest wifi?

alackmann commented 6 years ago

The R8000 has:

On guest, I'm using 2.4Ghz and only one fo the 5Ghz channels.

I've gone to town capturing some network traffic for the R8000 SOAP interactions while using Netgear Genie on Android. You can find the output in this gdoc

gruijter commented 6 years ago

Super @alackmann ! I even see some other soap commands I could add to the node module like ' check firmware update'. Would be great if you could also add captures for 'do firmware update' and 'do speed check' / 'get speed check results' 😉

alackmann commented 6 years ago

@gruijter doesn't seem to be options for those in Genie - only the web interface. There are a few more command for parental controls and such I haven't mapped.

I'm thinking it'd be great to create a node based CLI command that exposed each of the library functions to the command line. I've done a rudimentary one for my home automation task, but full featured would enable all sorts of fun stuff.

gruijter commented 6 years ago

@alackmann I significantly changed the guest wifi. I found out that Netgear has made an even greater mess of their soap interface then I thought. I introduced an automatic check that will try 2 alternative methods for enabling/disabling the guest wifi. The method seems to depend on the router type. I have only been able to test it with my own R7800. Could you test with the R8000? Please use the new commands for guestWifi (see readme).

Furthermore I found and added the soap command for checking new firmware. I have not found the right commands yet to perform a firmware upgrade, but I'm sure they exist. Maybe you can check again in your genie app? They are under a different menu. Would be awesome if you could capture that! And also to do a bandwith speedcheck would be really nice.

alackmann commented 6 years ago

@gruijter so, the fallback method doesn't work. The SOAP interaction just accepts the first request as-if it's valid, but nothing changes on the R8000 router. Here's the exchange that occurred:

REQUEST

        <SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
                xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
                xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
                xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
        <SOAP-ENV:Header>
        <SessionID>A7D88AE69687E58D9A00</SessionID>
        </SOAP-ENV:Header>
        <SOAP-ENV:Body>
                <M1:Set5GGuestAccessEnabled2 xmlns:M1="urn:NETGEAR-ROUTER:service:WLANConfiguration:1">
                        <NewGuestAccessEnabled>1</NewGuestAccessEnabled>
                </M1:Set5GGuestAccessEnabled2>
        </SOAP-ENV:Body>
        </SOAP-ENV:Envelope>

RESPONSE

<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:Set5GGuestAccessEnabled2Response
        xmlns:m="urn:NETGEAR-ROUTER:service:WLANConfiguration:1">
    </m:Set5GGuestAccessEnabled2Response>
    <ResponseCode>000</ResponseCode>
</soap-env:Body>
</soap-env:Envelope>
gruijter commented 6 years ago

Mmh, ok.. so the response code of the first request is also 000? If that is the case I could switch the order around (first do Set5GGuestAccessEnabled2, and on error do Set5GGuestAccessEnabled). Maybe you can try if that works for you?

alackmann commented 6 years ago

Yeah - that works. Have raised a PR #5 with it.