K4CZP3R/tapo-p100-java-poc

Does code work with latest Tapo firmware?

dobbers opened this issue · 1 comments

Downloaded the code and tried on my new Tapo P110 plug. I get an initial HTTP 200 response but then it fails:

[TAPO-PoC] Generating keypair...
[TAPO-PoC] Sending handshake!
[TAPO-PoC] Making handshake...
Exception in thread "main" [TAPO-PoC] Server responded with:

200 OK
java.lang.NullPointerException: Cannot invoke "String.split(String)" because the return value of "com.squareup.okhttp.Response.header(String)" is null
at TapoFlow.makeHandshake(TapoFlow.java:30)
at Main.main(Main.java:30)

Looking at the code I see this line is where it fails:
String cookie = response.header("Set-Cookie").split(";")[0];

Please see #4.
(NB: I'm not the original creator).