hertzg / node-tplink-api

TP-Link Router API (EU version) for NodeJs to control the router directly.
15 stars 3 forks source link

[archer-mr600] Unable to authenticate (returns null) #5

Closed henrik242 closed 10 months ago

henrik242 commented 11 months ago

I see you state "TL-MR6000" in the readme, but I hope you mean the TPlink Archer MR600?

I have one of those, but I'm getting null from authenticate(). Any ideas why?

henrik242 commented 11 months ago

I see that both data and sign are set to seemingly sane values in fetchSessionId.js, but the fetch response is null.

hertzg commented 11 months ago

There are two cases when it can return null

when fetchBusy() returns isLoggedIn as false

https://github.com/hertzg/node-tplink-api/blob/4ff2c6d1aa14f903abc256fcd534a11e0ef5b1bb/src/authenticate.js#L21-L24

or if it was not abe to obtain sessionId (probably wrong password or smth?)

https://github.com/hertzg/node-tplink-api/blob/4ff2c6d1aa14f903abc256fcd534a11e0ef5b1bb/src/authenticate.js#L26-L34

since forceLogin is true by default, and assuming you didn't pass it as false most likely it's not able to obtain sessionId.

Without seeing request / response for each fetch or a packet capture it's hard to say whats happening in your case.

hertzg commented 11 months ago

I see you state "TL-MR6000" in the readme, but I hope you mean the TPlink Archer MR600?

The naming from tplink is weird, the one I have tested it on is TL-ML6400 the one you mention, the Archer MR6000 seems to be different.

I don't have the Archer device, I have a feeling there might be a new firmware and the request or response forcgi/login is different. Happy to review the PR to merge it if you manage to get it working.

If you set a dummy username & password and provide a packet capture for the fully authentication flow, might be useful as well.

I've fixed the wrong model number and also mentioned that there's an issue with Archer MR600 in the readme now linking to this issue.

hertzg commented 11 months ago

Did you manage to either do a packet capture or know why it's not working? @henrik242

hertzg commented 10 months ago

Closing this due to inactivity