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

TinyTuya Debug: getaddressinfofailed #598

Open
piercalderan opened this issue Mar 4, 2025 · 1 comment
Open

TinyTuya Debug: getaddressinfofailed #598

piercalderan opened this issue Mar 4, 2025 · 1 comment

Comments

@piercalderan
Copy link

Hello Jason,
I try to connect to my Tuya device but I always get this error 901 network error. I also tried to print the deb ug and the result is this here. Can you help me?

import tinytuya
DEVICEIP = "192.168.1.100"
DEVICEID = "bf4713ddc37d443162a17i"
DEVICEKEY= "x|Pc?pRwkn2J`pf["
tinytuya.set_debug(True) # use tinytuya.set_debug(True,False) for non-ANSI color terminal
#d = tinytuya.OutletDevice(DEVICEID, DEVICEIP, DEVICEKEY, 'device22')
d = tinytuya.OutletDevice('DEVICEID', 'DEVICEIP', 'DEVICEKEY', version=3.3, persist=True)
data = d.status()
print(data)

�[31;1mDEBUG:TinyTuya [1.16.1]
�[0m
�[31;1mDEBUG:Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32�[0m
�[31;1mDEBUG:Using pyca/cryptography 44.0.1 for crypto, GCM is supported�[0m
�[31;1mDEBUG:status() entry (dev_type is default)�[0m
�[31;1mDEBUG:final payload_dict for 'DEVICEID' ('v3.4'/'default'): {1: {'command': {'gwId': '', 'devId': '', 'uid': '', 't': ''}}, 7: {'command': {'protocol': 5, 't': 'int', 'data': {}}, 'command_override': 13}, 8: {'command': {'gwId': '', 'devId': ''}}, 9: {'command': {'gwId': '', 'devId': ''}}, 10: {'command': {}, 'command_override': 16}, 13: {'command': {'protocol': 5, 't': 'int', 'data': {}}}, 16: {'command': {}}, 18: {'command': {'dpId': [18, 19, 20]}}, 64: {'command': {'reqType': '', 'data': {}}}}�[0m
�[31;1mDEBUG:building command 10 payload=b'{}'�[0m
�[31;1mDEBUG:socket unable to connect (exception) - retry 1/5�[0m
Traceback (most recent call last):
File "C:\Users\pier\AppData\Local\Programs\Python\Python310\lib\site-packages\tinytuya\core\XenonDevice.py", line 337, in _get_socket
self.socket.connect((self.address, self.port))
socket.gaierror: [Errno 11001] getaddrinfo failed
�[31;1mDEBUG:socket unable to connect (exception) - retry 2/5�[0m

@uzlonewolf
Copy link
Collaborator

d = tinytuya.OutletDevice('DEVICEID', 'DEVICEIP', 'DEVICEKEY', version=3.3, persist=True)

Those are variables and thus should not be quoted:

d = tinytuya.OutletDevice(DEVICEID, DEVICEIP, DEVICEKEY, version=3.3, persist=True)

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

2 participants