TuyaAPI / cli

🔧 A CLI for Tuya devices
MIT License
262 stars 44 forks source link

List-app does not work #39

Closed 5akir closed 4 years ago

5akir commented 4 years ago

Hi!

In the experiment I used: — iPhone Xs max (firmware 13.2.2) — MacBook Pro (Mac OS Catalina 10.15.1), as an alternative to running tuya-cli, also used Raspberry Pi 3B+ (Raspbian Debian Buster), Intel NUC (Debian Stretch). — Tuya Smart application (installed on the iPhone) — Multiple Tuya devices (mostly smart sockets)

After fulfilling all the necessary requirements, such as installing tuya-cli, launching tuya-cli list-app, downloading and installing a profile (certificate for iPhone), setting up the proxy for the specified tuya-cli in the WiFi connection, I tried to open the Tuya Smart application and do a swipe down on the device list.

However, in the proxy, I see only “Waiting for request”. Nothing more. In the application itself, I get a network connection error. There were no firewalls or any other restrictions for network connection on tuya-cli hosts.

Using the Burp program, I tried to see the addresses where the Tuya Smart application was making requests. I saw two addresses:

  1. a1.tuyaeu.com
  2. 18.194.74.72

According to the application logic, calls to a1.tuyaeu.com should have been caught, but this did not happen.

What could be here?

codetheweb commented 4 years ago

It sounds like it's halfway working if the Tuya app errors out. Try running tuya-cli with a DEBUG=* prefix and it should print out some more info.

insanehunter commented 4 years ago

Looks like you missed a critical step described here: https://github.com/codetheweb/tuyapi/blob/master/docs/SETUP.md

Enable full trust of certificate by going to Settings > General > About > Certificate Trust Settings

I had the same problem until I did this and got it working.

kylekyle commented 4 years ago

Just did ran it and it worked great. The Smart Life app complained that it had to connection, but tuya-cli still intercepted device information.

And, by the way, can I just say that I am thoroughly impressed with this code? It generates a QR code that displays on the command-line, spins up a MITM proxy, and has CLI syntax coloring. Well done!

Blizzardo1 commented 4 years ago

I'm on Android and cannot see the certificate for me to approve/trust. Further more I don't even know the name of the certificate I installed, which now makes me skeptical.

Edit I may be a little stupid regarding the api, forgive me.

codetheweb commented 4 years ago

I'm closing this because of inactivity. @Blizzardo1, please open a new issue if you continue to have problems (I haven't actually tried it on Android but other people have reported that it works).