jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
879 stars 159 forks source link

Please help #388

Open Electrik-rich546456 opened 12 months ago

Electrik-rich546456 commented 12 months ago

Hi, how's it going ?

I hope it's something i've done but can't find anything wrong I'm getting this error lots.

Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.9/site-packages/tinytuya/core.py", line 875, in _get_socket
    self.socket.connect((self.address, self.port))
OSError: [Errno 113] No route to host
DEBUG:ERROR Network Error: Device Unreachable - 905 - payload: null
DEBUG:set_status received data={'Error': 'Network Error: Device Unreachable', 'Err': '905', 'Payload': None}

However the cloud code examples work fine its just the snapshot.py that doesnt work

jasonacox commented 12 months ago

OSError: [Errno 113] No route to host

Are you able to ping the IP address from the same host?

Electrik-rich546456 commented 12 months ago

I can ping all the other lights apart from one. How do I scan for ip change ? All Ip address are set no not change according to my router. However It has changed. Is there a known way to tell the smart lights to not change local ip address

uzlonewolf commented 12 months ago

You're going to need to check your router to see if it has an option to reserve an address for the device.

Alternately, you can set address=None (i.e. d = tinytuya.Device( '...', address=None, ...)) when creating the device to have tinytuya auto-detect the IP.