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

P115 changing WI-FI #199

Open
DrAssExplosion opened this issue Apr 15, 2024 · 5 comments
Open

P115 changing WI-FI #199

DrAssExplosion opened this issue Apr 15, 2024 · 5 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@DrAssExplosion
Copy link

Hi

I would like to change the WI-FI for the outlet, without having to install the Tarot application,
using the example of the set_qs_info method from https://gitlab.com/0xSamy/TapoPlug-Rest-API/-/blob/master/tapo_plug/tapoPlugApi.py

That is, I reset the settings, connected to WI-FI "Tapo_Plug_XXXX", and sent a request to 192.168.0.1,
but if I do this, then in the "handshake1" method - server_hash will differ from local_hash and nothing will work

So is there a way to do this? Maybe when the settings are reset, a different connection method or a special username/password is used?

Thank you in advance

@mihai-dinculescu
Copy link
Owner

Have you tried calling .refresh_session()?

@DrAssExplosion
Copy link
Author

I'm sorry, the translator accidentally translated "Tarot", I wanted to write an application "Tapo"

I'm afraid to call .refresh_session() will not work because first we create a device let my device = ApiClient::new(tapo_username, tapo_password).p110(ip_address).await?; and then device.refresh_session().await;

But the call occurs along the following chain .p110(ip_address) -> login(ip_address) -> KlapProtocol.login() -> handshake() -> handshake1(), and in handshake1 the incorrect "local_hash" and "server_hash" are generated, .refresh_session() also causes handshake()

In general, the idea is to assemble a *.exe file that will scan the network, connect to the device's WI-FI and connect the device itself to the home network (what the Tapo mobile app does)
Only without the need for the user to install this application

@mihai-dinculescu
Copy link
Owner

Ah, I see.
So you basically want to be able to set up the wifi of a new device or a device that's been reset programmatically?

@DrAssExplosion
Copy link
Author

I think it would be nice in both cases (if possible)
For example, if you take a new outlet P115, connect it using the "Tapo", then reset it by pressing the button on the outlet itself (+- 5 sec.) then, when reconnecting, "Tapo" will detect some part of the old settings and offer to use them
Therefore, it is not clear whether these old settings are used when reconnecting or not

@mihai-dinculescu
Copy link
Owner

Yes, it sounds useful to add, indeed.
I'm happy to talk over contributions if someone is willing to add support for this.

@mihai-dinculescu mihai-dinculescu added help wanted Extra attention is needed good first issue Good for newcomers labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants