Skip to content
This repository has been archived by the owner on Sep 4, 2021. It is now read-only.

new switches different port #64

Open
Jefronty opened this issue Nov 14, 2019 · 3 comments
Open

new switches different port #64

Jefronty opened this issue Nov 14, 2019 · 3 comments

Comments

@Jefronty
Copy link

Jefronty commented Nov 14, 2019

My older plugs (KMC) broadcast to port 6666 both from 49155. My new Tuya/Smart Life plugs (Teckin) both broadcast to port 6667 from 49154.
I can get the status and control the older plugs using pytuya, but whenever trying to interact with the newer plugs with python, even retrieving the status I get an error. I'd guess that maybe these new plugs are listening on a port other than 6668, but I don't know which one. I ran a port scan and these new plugs are listening on TCP port 6668, but pytuya cannot communicate with them.
The error output when trying to get the status is:

  File "/usr/local/lib/python2.7/dist-packages/pytuya/__init__.py", line 281, in status
    data = self._send_receive(payload)
  File "/usr/local/lib/python2.7/dist-packages/pytuya/__init__.py", line 179, in _send_receive
    data = s.recv(1024)

I've also tried Python3 and it doesn't work any better.

@clach04
Copy link
Owner

clach04 commented Nov 15, 2019

@Jefronty thanks for sharing, that is interesting. I would check in with https://github.com/codetheweb/tuyapi they have been actively updating protocol support. I'm not following it closely but I thought I saw a discussion about a new protocol seen with some devices.

@Jefronty
Copy link
Author

Jefronty commented Nov 15, 2019

@clach04 Thanks for the response. I did check TuyApi and wrote a quick test js script to try. Using the parameter version=3.3 when adding the device worked. I see your code has a set_version function. Even after trying that I still cannot communicate with the new switches.

d.set_version( 3.3 )
d.status()

still throws an exception

@doubledrat
Copy link

doubledrat commented Dec 26, 2019

I'm having the same problem with teckin smart plugs bought in December 2019.

Did you resolve the issue?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants