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

H200 support #144

Open
cecchisandrone opened this issue Dec 15, 2023 · 23 comments
Open

H200 support #144

cecchisandrone opened this issue Dec 15, 2023 · 23 comments

Comments

@cecchisandrone
Copy link

Is there any plan to support H200 hub?

@mihai-dinculescu
Copy link
Owner

What functionality are you looking for?
I believe that there's a high chance that the one that exists for H100 will work for H200 too. Have you tried it?

@cecchisandrone
Copy link
Author

cecchisandrone commented Dec 17, 2023 via email

@mihai-dinculescu
Copy link
Owner

If you end up giving it a try, please let us know how it goes!

@JeyC0b
Copy link

JeyC0b commented Jan 11, 2024

Hello,
I just testing H200 and looks it not working:
cargo run --example tapo_h100 Finished dev [unoptimized + debuginfo] target(s) in 0.13s Running target/debug/examples/tapo_h100 Error: Http(Error { kind: Timeout, context: None, source: Some(Error { description: "Timeout was reached", code: 28, extra: None }), source_type: Some("curl::error::Error"), local_addr: None, remote_addr: None })

When I triedL530 it works.

@mihai-dinculescu
Copy link
Owner

Hmm, a timeout error is not what I was expecting.

Can I double-check that you've pulled the correct IP address from the Tapo app?
Also, can you please post the logs you get from RUST_LOG=debug cargo run --example tapo_h100?

@JeyC0b
Copy link

JeyC0b commented Jan 12, 2024

Sure

My IP is right, because I have static IP for HUB

Linux:
tapo_hub

Tapo mobile APP:
tapo_hub2

Linux ping:
tapo_hub3

@mihai-dinculescu
Copy link
Owner

Interesting.

As a test, could you please replace the contents of the is_passthrough_supported function with Ok(false) and then see what RUST_LOG=debug cargo run --example tapo_h100 outputs?

@JeyC0b
Copy link

JeyC0b commented Jan 13, 2024

It looks same:

tapo_res

idk...

@JeyC0b
Copy link

JeyC0b commented Jan 13, 2024

I just tried IP in browser. When I try L530 I will get 200 OK but when I try HUB 200 I will get time out...

@mihai-dinculescu
Copy link
Owner

Hmm, I get timeouts with H100 when I try to access it from a different network adapter (H100 on Wifi and a PC on LAN).
Is it the same case for you?

@JeyC0b
Copy link

JeyC0b commented Jan 13, 2024

Ok, HUB 200 is probably using port 443 (HTTPS), when I try it in browser I will get: {}

tapo_res2

tapo_res3

@JeyC0b
Copy link

JeyC0b commented Jan 13, 2024

Hmm, I get timeouts with H100 when I try to access it from a different network adapter (H100 on Wifi and a PC on LAN). Is it the same case for you?

I dont have H100

On H200 I will get always timeout on port 80

@mihai-dinculescu
Copy link
Owner

I was wondering if you have the same setup as me, with the hub on wifi and a PC/laptop on LAN (or a different Wifi) trying to call it.

@mihai-dinculescu
Copy link
Owner

If you want to try it over HTTPS, you can change the URL at

let url = format!("http://{}/app", ip_address);

@JeyC0b
Copy link

JeyC0b commented Jan 13, 2024

If you want to try it over HTTPS, you can change the URL at

let url = format!("http://{}/app", ip_address);

Problem with SSL:
Error: Http(Error { kind: BadServerCertificate, context: None, source: Some(Error { description: "SSL peer certificate or SSH remote key was not OK", code: 60, extra: None }), source_type: Some("curl::error::Error"), local_addr: Some(1.1.1.100:41144), remote_addr: Some(1.1.1.111:443) })

@JeyC0b
Copy link

JeyC0b commented Jan 13, 2024

I was wondering if you have the same setup as me, with the hub on wifi and a PC/laptop on LAN (or a different Wifi) trying to call it.

I have:
router -> switch -> server, hub 200, PC, Access point

I am on PC and try it with PUTTY from server.
Hub is connected with LAN

@JeyC0b
Copy link

JeyC0b commented Jan 13, 2024

I found this:

petretiandrea/home-assistant-tapo-p100/issues/578

They have same problem


I am going out, will be back later

@mihai-dinculescu
Copy link
Owner

mihai-dinculescu commented Jan 13, 2024

Argh, I was afraid of this. This library also supports only the legacy protocol and the newer Klap one.

It might be worth doing one last hurrah and disable the SSL verification by replacing https://github.com/mihai-dinculescu/tapo/blob/main/tapo/src/api/api_client.rs#L68 with

        let client = HttpClient::builder()
            .title_case_headers(true)
            .ssl_options(isahc::config::SslOption::DANGER_ACCEPT_INVALID_CERTS)
            .build()?;

But I wouldn't hold my breath.

I'm considering purchasing a camera and/or H200 to look into the third protocol in the following weeks/months.

@JeyC0b
Copy link

JeyC0b commented Jan 13, 2024

Ok,

I tested with ssl_option and same problem:
tapo_res4

@Nereuxofficial
Copy link

Nereuxofficial commented Jan 18, 2024

Argh, I was afraid of this. This library also supports only the legacy protocol and the newer Klap one.

It might be worth doing one last hurrah and disable the SSL verification by replacing main/tapo/src/api/api_client.rs#L68 with

        let client = HttpClient::builder()
            .title_case_headers(true)
            .ssl_options(isahc::config::SslOption::DANGER_ACCEPT_INVALID_CERTS)
            .build()?;

But I wouldn't hold my breath.

I'm considering purchasing a camera and/or H200 to look into the third protocol in the following weeks/months.

Hey, I am currently having the same issue. Is there any implementation of the Tapo Camera protocol or documentation of it? I'm having a really hard time reversing it.

I have some network logs and it seems to encrypt communication pretty swiftly on the latest version. It seems to use AES-256-CBC-PKCS#7.

@mihai-dinculescu
Copy link
Owner

Having a look at the decompiled tapo app would be my first port of call.

Also, this library might might be a useful source of inspiration.

@petretiandrea
Copy link

It uses a different protocol, like the one used by Tapo Camera

@Nereuxofficial
Copy link

It uses a different protocol, like the one used by Tapo Camera

Yes, however it seems to have changed protocols again in a newer firmware version. In this issue someone seems to have gotten it working, however an authentication packet on the latest firmware looks like this:

{
    "method": "login",
    "params": {
        "cnonce": "9AAF7F6F13190C8F",
        "digest_passwd": "5BBC5A0C5B08876DA6F08A0380AC60ECE55EE135FB8610010E580BEF0A2C37FD9AAF7F6F13190C8F080693488D027476",
        "encrypt_type": "3",
        "username": "admin"
    }
}

Whereas authentication previously looked like this:

"method": "login",
            "params": {
                "hashed": True,
                "password": self.hashedPassword,
                "username": self.user,
            },

If anyone knows how to reset it to the previous authentication mechanism please let me know, i tried resetting the hub and using another fresh account already but the encryption persists for all requests.

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

5 participants