TuyaAPI / cli

🔧 A CLI for Tuya devices
MIT License
261 stars 44 forks source link

Version 1.15.0 Thows Unhandled 'error' event every 2-3 times of use #105

Open exemmer opened 3 years ago

exemmer commented 3 years ago

Error thrown " throw er; // Unhandled 'error' event" Retry, ditto, Retry again.....then works as it should.

example: (issue happens with get and set)

tuya-cli get --id [myid]--key [mykey] --ip [myip] --protocol-version 3.3 -a events.js:291 throw er; // Unhandled 'error' event ^

Error: Error from socket at Socket. (/usr/lib/node_modules/@tuyapi/cli/node_modules/tuyapi/index.js:388: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) Emitted 'error' event on TuyaDevice instance at: at Socket. (/usr/lib/node_modules/@tuyapi/cli/node_modules/tuyapi/index.js:388:16) at Socket.emit (events.js:314:20) [... lines matching original stack trace ...] at processTicksAndRejections (internal/process/task_queues.js:84:21)

codetheweb commented 3 years ago

If you're experiencing intermittent errors, it's very likely something else is trying to control your device / get the status at the same time. Please double check the app is completely closed on your phone and there are no other processes attempting to connect to it.