Comments (8)
I am also having this issue. I have 8 Tuya smart lights (3 different types). If any of them are turned off Node-Red crashes. And it constantly crashes every hour or so even if they are all turned on. The same error is given. I have a catch node in the flows. I'm running V4.0.2 on NR v1.3.4.
9 May 13:22:56 - [red] Uncaught Exception:
9 May 13:22:56 - Error: connection timed out
at Socket.<anonymous> (C:\Users\wkc41\.node-red\node_modules\tuyapi\index.js:442:18)
at Object.onceWrapper (node:events:471:28)
at Socket.emit (node:events:365:28)
at Socket._onTimeout (node:net:475:8)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7)
Edit:
I have moved my Node-Red to the version you listed above and it has not crashed since.
from node-red-contrib-tuya-smart-device.
I am unable to replicate the error in my setup with node-red version 1.2.3
Can you please share the steps to create this error. In my case if the device is powered off, then the following message is logged
18 Apr 19:31:51 - [error] [tuya-smart-device:Monitor Plug] find() timed out. Is the device powered on and the ID or IP correct?
18 Apr 19:31:51 - [info] [tuya-smart-device:Monitor Plug] Cannot find the device, re-trying...
How to create the socket error ?
from node-red-contrib-tuya-smart-device.
In my case disconnecting the device from the power supply ends with an uncaught exception every time:
kwi 21 09:46:23 DietPi node-red[10502]: 21 Apr 09:46:23 - [info] [tuya-smart-device:xxx] initiating the find command
kwi 21 09:46:27 DietPi node-red[10502]: 21 Apr 09:46:27 - [info] [tuya-smart-device:xxx] Connected to device! 4780123456f520f448b4
kwi 21 09:46:29 DietPi node-red[10502]: 21 Apr 09:46:29 - [info] [tuya-smart-device:xxx] Data from device: {"devId":"4780123456f520f448b4","dps":{"4":23,"5":57},"t":1618991188}
kwi 21 09:46:34 DietPi node-red[10502]: 21 Apr 09:46:34 - [info] [tuya-smart-device:xxx] Data from device: {"devId":"4780123456f520f448b4","dps":{"6":2379},"t":1618991193}
kwi 21 09:46:39 DietPi node-red[10502]: 21 Apr 09:46:39 - [info] [tuya-smart-device:xxx] Data from device: {"devId":"4780123456f520f448b4","dps":{"6":2376},"t":1618991198}
~~ I PULLED THE PLUG FROM THE SOCKET ~~
kwi 21 09:49:09 DietPi node-red[10502]: 21 Apr 09:49:09 - [info] [tuya-smart-device:xxx] Disconnected from tuyaDevice.
kwi 21 09:49:15 DietPi node-red[10502]: 21 Apr 09:49:15 - [red] Uncaught Exception:
kwi 21 09:49:15 DietPi node-red[10502]: 21 Apr 09:49:15 - Error: connection timed out
kwi 21 09:49:15 DietPi node-red[10502]: at Socket.<anonymous> (/mnt/dietpi_userdata/node-red/node_modules/tuyapi/index.js:442:18)
kwi 21 09:49:15 DietPi node-red[10502]: at Object.onceWrapper (node:events:435:28)
kwi 21 09:49:15 DietPi node-red[10502]: at Socket.emit (node:events:329:20)
kwi 21 09:49:15 DietPi systemd[1]: node-red.service: Main process exited, code=exited, status=1/FAILURE
kwi 21 09:49:15 DietPi systemd[1]: node-red.service: Unit entered failed state.
kwi 21 09:49:15 DietPi systemd[1]: node-red.service: Failed with result 'exit-code'.
The problem also occurs when the device has access to power but there is a connection problem for some reason.
from node-red-contrib-tuya-smart-device.
Request you to try the following scenario as well.
1 .Add a catch node to the same flow.
2. Unplug the device .
Is it still crashing node red
from node-red-contrib-tuya-smart-device.
1 .Add a catch node to the same flow.
2. Unplug the device .
Is it still crashing node red
Actually I had this node all the time. It doesn't matter whether I have catch node in this flow or not - after unplug device from the socket, Node-Red crashes literally every time.
But I have noticed, that when I start Node-Red service before plugging the device into the socket, the messages appear, thant you mentioned before:
- message in the debug section of the application
"context": {
"message": "Error: find() timed out. So is the device powered on and the ID or IP correct?",
(...)
"error": {
"message": "find() timed out. Is the device powered on and the ID or IP correct?",
(...)
- and message in system logs
kwi 24 22:59:17 DietPi node-red[23057]: 24 Apr 22:59:17 - [info] [tuya-smart-device:xxx] Cannot find the device, re-trying...
kwi 24 22:59:17 DietPi node-red[23057]: 24 Apr 22:59:17 - [info] [debug:eaa19fd6.6522d]
kwi 24 22:59:17 DietPi node-red[23057]: {
kwi 24 22:59:17 DietPi node-red[23057]: context: {
kwi 24 22:59:17 DietPi node-red[23057]: message: Error: find() timed out. Is the device powered on and the ID or IP correct?
kwi 24 22:59:17 DietPi node-red[23057]: at /mnt/dietpi_userdata/node-red/node_modules/tuyapi/index.js:801:13
kwi 24 22:59:17 DietPi node-red[23057]: at Timeout._onTimeout (/mnt/dietpi_userdata/node-red/node_modules/p-timeout/index.js:25:13)
kwi 24 22:59:17 DietPi node-red[23057]: at listOnTimeout (node:internal/timers:556:17)
kwi 24 22:59:17 DietPi node-red[23057]: at processTimers (node:internal/timers:499:7),
kwi 24 22:59:17 DietPi node-red[23057]: deviceVirtualId: '4780123456f520f448b4',
kwi 24 22:59:17 DietPi node-red[23057]: deviceIp: '',
kwi 24 22:59:17 DietPi node-red[23057]: deviceKey: 'xxxxxxxxxxxxxxxx'
kwi 24 22:59:17 DietPi node-red[23057]: },
kwi 24 22:59:17 DietPi node-red[23057]: error: {
kwi 24 22:59:17 DietPi node-red[23057]: message: 'find() timed out. Is the device powered on and the ID or IP correct?',
kwi 24 22:59:17 DietPi node-red[23057]: source: {
kwi 24 22:59:17 DietPi node-red[23057]: id: '5948abe7.720de4',
kwi 24 22:59:17 DietPi node-red[23057]: type: 'tuya-smart-device',
kwi 24 22:59:17 DietPi node-red[23057]: name: 'xxx',
kwi 24 22:59:17 DietPi node-red[23057]: count: 1
kwi 24 22:59:17 DietPi node-red[23057]: }
kwi 24 22:59:17 DietPi node-red[23057]: },
kwi 24 22:59:17 DietPi node-red[23057]: _msgid: 'c3b9823f.680a7'
kwi 24 22:59:17 DietPi node-red[23057]: }
kwi 24 22:59:18 DietPi node-red[23057]: 24 Apr 22:59:18 - [info] [tuya-smart-device:xxx] initiating the find command
I will also mention, that I have three the same devices (SP111) in different rooms, so I have three tuya-smart-device nodes in one flow. Of course every device have different virtual ID, IP address and key.
All this time, I performed tests on the 1st device, which I marked as xxx in the logs, so in order to eliminate the defectiveness of the device itself, I decided to check whether the 2nd device (let's call it yyy) would have the same problems. Immediately after unplug the yyy device, Node-Red crashed.
from node-red-contrib-tuya-smart-device.
Same problem here.
I have one device that is connected via a wifi-repeater. This connection is sometimes not stable.
NR 2.3.0. in ioBroker 5.1.4 on an Rpi4
[email protected]
/opt/iobroker/log/iobroker.2021-06-04.log :
2021-06-04 00:00:35.857 - ^[[31merror^[[39m: node-red.0 (1756) 4 Jun 00:00:35 - [error] [tuya-smart-device:WP] Error: Error from socket: connect EHOSTUNREACH 192.168.10.191:6668
at Socket.<anonymous> (/opt/iobroker/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)
2021-06-04 00:00:35.860 - ^[[31merror^[[39m: node-red.0 (24670) Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, o$
2021-06-04 00:00:35.865 - ^[[31merror^[[39m: node-red.0 (24670) unhandled promise rejection: connect EHOSTUNREACH 192.168.10.191:6668
2021-06-04 00:00:35.867 - ^[[31merror^[[39m: node-red.0 (24670) Error: connect EHOSTUNREACH 192.168.10.191:6668
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1144:16)
2021-06-04 00:00:35.868 - ^[[31merror^[[39m: node-red.0 (24670) Exception-Code: EHOSTUNREACH: connect EHOSTUNREACH 192.168.10.191:6668
2021-06-04 00:00:36.395 - ^[[33mwarn^[[39m: node-red.0 (24670) Terminated (UNCAUGHT_EXCEPTION): Without reason
I have no clue about node.js. But maybe this helps:
A search for
emitErrorNT (internal/streams/destroy.js:92:8)
yielded https://stackoverflow.com/questions/62416274/econnreset-error-crashing-nodejs-application
Other idea was promise and crashes:
https://stackoverflow.com/questions/21800010/how-do-i-handle-errors-with-promises
from node-red-contrib-tuya-smart-device.
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.
from node-red-contrib-tuya-smart-device.
Auto closing the issue
from node-red-contrib-tuya-smart-device.
Related Issues (20)
- Weird key format? HOT 3
- Tuya protocol 3.4, 3.5 support missed HOT 1
- An unusual response - 2 HOT 1
- Node does not work in conjunction with Http in node HOT 1
- how to connect to sub-devices that are managed by a tuya gateway? HOT 2
- Bi-Meter disconnects from node red HOT 4
- GET response the same for schema and DPS ID HOT 3
- unreadable 'data' output from node HOT 2
- Device not connected. Can't send the SET commmand HOT 1
- where do i set the api credentials HOT 1
- [announce] nr_Tuya_OpenAPI_2.0, a node_red flow to access Tuya Cloud HOT 1
- Manage all Tuya devices with node-red HOT 1
- Cluttered log file HOT 5
- Problem with Error code "Payload must be a number in range 0-100" HOT 1
- Error in tuyapi
- More finner log info control
- Data refresh very Slow HOT 1
- Node not works if some characters in the key HOT 8
- unreadable 'data' output from node HOT 1
- tuya ir remote control with virtual device id
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-red-contrib-tuya-smart-device.