Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EHOSTUNREACH with Switch #176

Open
brunolalb opened this issue Sep 9, 2024 · 0 comments
Open

EHOSTUNREACH with Switch #176

brunolalb opened this issue Sep 9, 2024 · 0 comments

Comments

@brunolalb
Copy link

Hello,
It's been a few weeks of research and I couldn't find a solution yet.

My home wifi network is a Mesh from DLink with one main device and one extender.
I have many smart devices (switches, plugs, dimmer, WLED strips, thermostats) which work just fine. Almost all of them have Fixed IPs configured on the WiFi router.

I have automatized some things using NodeRed on a RasPi-similar system running Ubuntu and connected to the main router via cable, mostly to "attach" a switch to a WLED.

One device isn't working properly, a 2Gang Switch.
I can control it via the Tuya app. I can see it when I run "tuya-cli wizard", but the node on the Node Red cannot connect to it.

When I run
DEBUG=* tuya-cli get --id '<device_id>' --key '<local_key>' --full

I get the following output:

TuyAPI Finding missing IP undefined or ID bf975e3c634d63bc0eeyyi +0ms
TuyAPI Received UDP message. +209ms
TuyAPI UDP data: +10ms
TuyAPI {
TuyAPI payload: {
TuyAPI ip: '192.168.1.73',
TuyAPI gwId: 'xxxxx',
TuyAPI active: 2,
TuyAPI ability: 0,
TuyAPI mode: 0,
TuyAPI encrypt: true,
TuyAPI productKey: 'xxxxxx',
TuyAPI version: '3.3'
TuyAPI },
TuyAPI leftover: false,
TuyAPI commandByte: 19,
TuyAPI sequenceN: 0
TuyAPI } +1ms
TuyAPI Received UDP message. +138ms
TuyAPI UDP data: +3ms
TuyAPI {
TuyAPI payload: {
TuyAPI ip: '192.168.1.72',
TuyAPI gwId: 'xxxxx',
TuyAPI active: 2,
TuyAPI ability: 0,
TuyAPI mode: 0,
TuyAPI encrypt: true,
TuyAPI productKey: 'xxxxx',
TuyAPI version: '3.3'
TuyAPI },
TuyAPI leftover: false,
TuyAPI commandByte: 19,
TuyAPI sequenceN: 0
TuyAPI } +0ms
TuyAPI Received UDP message. +1s
TuyAPI UDP data: +2ms
TuyAPI {
TuyAPI payload: {
TuyAPI ip: '192.168.1.71',
TuyAPI gwId: 'xxxxx',
TuyAPI active: 2,
TuyAPI ablilty: 0,
TuyAPI encrypt: true,
TuyAPI productKey: 'xxxxx',
TuyAPI version: '3.3'
TuyAPI },
TuyAPI leftover: false,
TuyAPI commandByte: 19,
TuyAPI sequenceN: 0
TuyAPI } +2ms
TuyAPI Received UDP message. +887ms
TuyAPI UDP data: +3ms
TuyAPI {
TuyAPI payload: {
TuyAPI ip: '192.168.1.74',
TuyAPI gwId: 'xxxxx',
TuyAPI active: 2,
TuyAPI ablilty: 0,
TuyAPI encrypt: true,
TuyAPI productKey: 'xxxxx',
TuyAPI version: '3.3'
TuyAPI },
TuyAPI leftover: false,
TuyAPI commandByte: 19,
TuyAPI sequenceN: 0
TuyAPI } +1ms
TuyAPI Received UDP message. +2s
TuyAPI UDP data: +2ms
TuyAPI {
TuyAPI payload: {
TuyAPI ip: '192.168.1.150',
TuyAPI gwId: 'xxxxx',
TuyAPI active: 2,
TuyAPI ablilty: 0,
TuyAPI encrypt: true,
TuyAPI productKey: 'xxxxx',
TuyAPI version: '3.3'
TuyAPI },
TuyAPI leftover: false,
TuyAPI commandByte: 19,
TuyAPI sequenceN: 0
TuyAPI } +1ms
TuyAPI Received UDP message. +818ms
TuyAPI UDP data: +3ms
TuyAPI {
TuyAPI payload: {
TuyAPI ip: '192.168.1.76',
TuyAPI gwId: 'xxxxx',
TuyAPI active: 2,
TuyAPI ablilty: 0,
TuyAPI encrypt: true,
TuyAPI productKey: 'xxxxx',
TuyAPI version: '3.3'
TuyAPI },
TuyAPI leftover: false,
TuyAPI commandByte: 19,
TuyAPI sequenceN: 0
TuyAPI } +1ms
TuyAPI Connecting to 192.168.1.76... +11ms
TuyAPI Error event from socket. 192.168.1.76 Error: connect EHOSTUNREACH 192.168.1.76:6668
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1607:16) {
errno: -113,
code: 'EHOSTUNREACH',
syscall: 'connect',
address: '192.168.1.76',
port: 6668
} +3s
node:events:497
throw er; // Unhandled 'error' event
^

Error: Error from socket: connect EHOSTUNREACH 192.168.1.76:6668
at Socket. (/usr/lib/node_modules/@tuyapi/cli/node_modules/tuyapi/index.js:651:26)
at Socket.emit (node:events:519:28)
at emitErrorNT (node:internal/streams/destroy:169:8)
at emitErrorCloseNT (node:internal/streams/destroy:128:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
Emitted 'error' event on TuyaDevice instance at:
at Socket. (/usr/lib/node_modules/@tuyapi/cli/node_modules/tuyapi/index.js:651:12)
at Socket.emit (node:events:519:28)
[... lines matching original stack trace ...]
at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.17.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant