tinytuya: Connection reset by peer: LSC WiFi Bulb, Hombli WiFi/BLE Gateway
Connection reset by peer: LSC WiFi Bulb, Hombli WiFi/BLE Gateway
Hello, I’m looking for a bit of help getting up and running with my local devices.
I am trying to connect and get status for the LSC Bulb device which has worked fine with the cloud integration / smart life app. I’m also trying to work out how to communicate with my Hombli radiator valves via the Bluetooth gateway.
Whatever I try, I just get ‘connection reset by peer’. I did get the local keys via the wizard but otherwise I’m pretty stuck at the moment. Any help would be great!
This was my last attempt based on the earlier thread about the LCS bulbs.
d = tinytuya.BulbDevice(item['id'], item['ip'], item['key'])
d.bulb_type = 'A'
d = devices.get(id)
d.set_version(3.3)
d.set_socketPersistent(True)
print(" > Send Request for Status < ")
payload = d.generate_payload(tinytuya.DP_QUERY)
d.send(payload)
print(" > Begin Monitor Loop <")
while(True):
# See if any data is available
data = d.receive()
print('Received Payload: %r' % data)
# Send keyalive heartbeat
print(" > Send Heartbeat Ping < ")
payload = d.generate_payload(tinytuya.HEART_BEAT)
d.send(payload)
DEBUG:status() entry (dev_type is default)
DEBUG:final payload_dict for '03010850600194d4bd7e' ('v3.3'/'default'): {1: {'command': {'gwId': '', 'devId': '', 'uid': '', 't': ''}}, 7: {'command': {'devId': '', 'uid': '', 't': ''}}, 8: {'command': {'gwId': '', 'devId': ''}}, 9: {'command': {'gwId': '', 'devId': ''}}, 10: {'command': {'gwId': '', 'devId': '', 'uid': '', 't': ''}}, 13: {'command': {'devId': '', 'uid': '', 't': ''}}, 16: {'command': {'devId': '', 'uid': '', 't': ''}}, 18: {'command': {'dpId': [18, 19, 20]}}, 64: {'command': {'reqType': '', 'data': {}}}}
DEBUG:building command 10 payload=b'{"gwId":"03010850600194d4bd7e","devId":"03010850600194d4bd7e","uid":"03010850600194d4bd7e","t":"1702420607"}'
DEBUG:sending payload
DEBUG:payload encrypted=b'000055aa000000010000000a000000782bb4032dc138f0aa955f1f86afc1feb269b13a4d7913ba0f00c4abe15570175c5c27a1bb858c97af70bf23677e26f0fb0ed9ad59c29bb6f3fa648848e3eceffe046b437b2e8de34f59a7c4b5ceb81ab7f9cb12c56a5dbeeb66bea6285de662af4dfdac39b91faeb7f769d00531177f00dbf5a4990000aa55'
DEBUG:Network connection error in _send_receive() - retry 1/5
Traceback (most recent call last):
File "/home/mark/.local/lib/python3.10/site-packages/tinytuya/core.py", line 1193, in _send_receive
rmsg = self._receive()
File "/home/mark/.local/lib/python3.10/site-packages/tinytuya/core.py", line 1081, in _receive
data = self._recv_all( min_len )
File "/home/mark/.local/lib/python3.10/site-packages/tinytuya/core.py", line 1055, in _recv_all
newdata = self.socket.recv(length)
ConnectionResetError: [Errno 104] Connection reset by peer
DEBUG:sending payload
DEBUG:payload encrypted=b'000055aa000000020000000a000000782bb4032dc138f0aa955f1f86afc1feb269b13a4d7913ba0f00c4abe15570175c5c27a1bb858c97af70bf23677e26f0fb0ed9ad59c29bb6f3fa648848e3eceffe046b437b2e8de34f59a7c4b5ceb81ab7f9cb12c56a5dbeeb66bea6285de662af4dfdac39b91faeb7f769d00531177f003593a7800000aa55'
DEBUG:Network connection error in _send_receive() - retry 2/5
Traceback (most recent call last):
File "/home/mark/.local/lib/python3.10/site-packages/tinytuya/core.py", line 1193, in _send_receive
rmsg = self._receive()
File "/home/mark/.local/lib/python3.10/site-packages/tinytuya/core.py", line 1081, in _receive
data = self._recv_all( min_len )
File "/home/mark/.local/lib/python3.10/site-packages/tinytuya/core.py", line 1055, in _recv_all
newdata = self.socket.recv(length)
ConnectionResetError: [Errno 104] Connection reset by peer
DEBUG:sending payload
DEBUG:payload encrypted=b'000055aa000000030000000a000000782
About this issue
- Original URL
- State: closed
- Created 7 months ago
- Comments: 41 (3 by maintainers)
Merry Christmas Jason and Tintuya!On Dec 25, 2023, at 11:10 AM, uzlonewolf @.***> wrote: You might want to check https://github.com/jasonacox/tinytuya/blob/master/DP_Mapping.md for both the hub and the device to see if you can convince it to give you more/better DP data.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>
It’s the way that tuya-local seems to work at the moment: https://github.com/make-all/tuya-local/discussions/522#discussioncomment-6514357
As a quick hack I used configured the devices to poll only mode, to see if dropping the connection each time works better: https://github.com/make-all/tuya-local/blob/50d053386e2041b357d2d97a2f70b5b320f3d419/custom_components/tuya_local/device.py#L244
I haven’t had time to dig into the code, but there must be a simple way to reuse a persistent connection of a parent device over the sub-devices, or at least get/reuse an existing connection…
Thanks everyone for the kind help!
Great news also, I was also able to get the status from the TRV by setting the parent correctly 😃 I don’t know what magic the force push uses, but seems it has brought them to life!
{'dps': {'8': True, '10': True, '27': 0, '40': False, '101': True, '102': 245, '103': 240, '105': 0, '106': False, '108': True, '130': True}, 'cid': 'de0e48ad74667c93', 'device': ThermostatDevice( 'bffa0dijvjaqqmqx', address=None, local_key='', dev_type='default', connection_timeout=5, version=3.4, persist=True, cid='de0e48ad74667c93', parent='bf94bb0153aa35eed0pzsf', children={} ), 'changed': ['temp_correction', 'upper_temp', 'raw_upper_temp', 'cooling_setpoint_c', 'weather_forcast'], 'changed_sensors': []}I was able to get a ping from it, I’ll try force powers tomorrow… the only thing I didn’t do was a power cycle after shutting down HA and killing smart life.
Yeah, I have an LSC bulb I’m trying to crack first.