Closed fah closed 2 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still existing in latest version.
Can you please set the find time out to 10 seconds and retry to 1 sec and try ?
I haven't seen before that you added the two fields. Very nice!
With values for retry: 10800... (the default value) and find: 1 sec. I could not connect after deployment.
With 10 & 1 sec. it works. I'll give it a try.
But I have to wait some time to see if it is stable or not.
Edit: Kept just relevant lines.
But I have to wait some time to see if it is stable or not.
How long ?
Until now I only got one message about 30 minutes after changing the values:
28 Jun 18:16:12 - [error] [tuya-smart-device:WP11] Error: Error from socket: read ECONNRESET
at Socket.<anonymous> (/opt/iobroker/iobroker-data/node-red/node_modules/node-red-contrib-tuya-smart-device/node_modules/tuyapi/index.js:492:30)
at Socket.emit (events.js:314:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
This looks pretty good so far.
Edit: Maybe one day?
It is very stable now. Thank you!
For the record: I only use the IP address and have the tuya device on site with a very stable WiFi. (Two repeaters within reach.)
My log if full of messages like this:
I tried to setup the device node with ip address and Device Virtual ID in all combinations. I all cases the connection gets lost when leaving the node-red editor for a while.
Sometimes the reconnect works - most times it does not.
The network is monitored and ping is stable working to the device. (Tested over many hours.)
In the log below I changed the name of the node from WP1 to WP11. After deploy the device reconnected.
I've found reconnect statements in tuya-smart-device.js at some places where the timeout is hard coded to 1000ms. This could be a reason. (line 185, 404, ...)
I also don't understand the long wait time of 6 Minutes (21600000ms) for a reconnect. If I have scheduled commands they will, on a regular base, fail.
Strange is that the reconnect on deploy works most times but fails in normal operation.
Thank you for your good work!