drumfreak / homebridge-tuya-powerstrip

homebridge-tuya-powerstrip
MIT License
3 stars 0 forks source link

I got ECONNREFUSED problem #3

Closed tomo719 closed 5 years ago

tomo719 commented 6 years ago

One of power outlets works with TuyaOutlet plugin, but they doesn’t work with tuya-powerstrip. I’ve gotten the device ID, IP address and local key. Could you tell me what is wrong?

I got this error log.

[2018-6-10 16:47:30] [Tuya Powerstrip - ライト2] connect ECONNREFUSED 219.102.113.66:6668 [2018-6-10 16:47:30] [Tuya Powerstrip - ライト1] connect ECONNREFUSED 219.102.113.66:6668 [2018-6-10 16:47:30] [Tuya Powerstrip - ライト6] connect ECONNREFUSED 219.102.113.66:6668 [2018-6-10 16:47:30] [Tuya Powerstrip - ライト5] connect ECONNREFUSED 219.102.113.66:6668 [2018-6-10 16:47:30] [Tuya Powerstrip - ライト4] connect ECONNREFUSED 219.102.113.66:6668 [2018-6-10 16:47:30] [Tuya Powerstrip - ライト3] connect ECONNREFUSED 219.102.113.66:6668

here is my config.json

"accessories": [

{
  "accessory": "TuyaOutlet",
  "name": "Tuya Outlet221",
  "devId": "01205862dc4a341ac124",
  "localKey": "a0f0c285dc88041b"
},

{
    "accessory": "TuyaPowerStrip",
    "name": "ライト1",
    "description" : "Tuya Power Strip Outlet 1",
    "ip": "219.102.113.66",
    "devId": "01205862dc4a341ac124",
    "localKey": "a0f0c285dc88041b",
    "dps" : 1,
    "apiMinTimeout" : 100,
    "apiMaxTimeout" : 1000,
    "apiRetries": 1,
    "apiDebug" : false,
    "refreshInterval" : 120,
    "debugPrefix" : "~~~!~~~ ",
    "debug" : false,
    "deviceEnabled" : true    },

{
    "accessory": "TuyaPowerStrip",
    "name": "ライト2",
    "description" : "Tuya Power Strip Outlet 2",
    "ip": "219.102.113.66",
    "devId": "01205862dc4a341ac124",
    "localKey": "a0f0c285dc88041b",
    "dps" : 2,
    "apiMinTimeout" : 100,
    "apiMaxTimeout" : 1000,
    "apiRetries": 1,
    "apiDebug" : false,
    "refreshInterval" : 120,
    "debugPrefix" : "~~~!~~~ ",
    "debug" : false,
    "deviceEnabled" : true
},

{
    "accessory": "TuyaPowerStrip",
    "name": "ライト3",
    "description" : "Tuya Power Strip Outlet 3",
    "ip": "219.102.113.66",
    "devId": "01205862dc4a341ac124",
    "localKey": "a0f0c285dc88041b",
    "dps" : 3,
    "apiMinTimeout" : 100,
    "apiMaxTimeout" : 1000,
    "apiRetries": 1,
    "apiDebug" : false,
    "refreshInterval" : 120,
    "debugPrefix" : "~~~!~~~ ",
    "debug" : false,
    "deviceEnabled" : true
},

{
    "accessory": "TuyaPowerStrip",
    "name": "ライト4",
    "description" : "Tuya Power Strip Outlet 4",
    "ip": "219.102.113.66",
    "devId": "01205862dc4a341ac124",
    "localKey": "a0f0c285dc88041b",
    "dps" : 4,
    "apiMinTimeout" : 100,
    "apiMaxTimeout" : 1000,
    "apiRetries": 1,
    "apiDebug" : false,
    "refreshInterval" : 120,
    "debugPrefix" : "~~~!~~~ ",
    "debug" : false,
    "deviceEnabled" : true
},

{
    "accessory": "TuyaPowerStrip",
    "name": "ライト5",
    "description" : "Tuya Power Strip Outlet 3",
    "ip": "219.102.113.66",
    "devId": "01205862dc4a341ac124",
    "localKey": "a0f0c285dc88041b",
    "dps" : 5,
    "apiMinTimeout" : 100,
    "apiMaxTimeout" : 1000,
    "apiRetries": 1,
    "apiDebug" : false,
    "refreshInterval" : 120,
    "debugPrefix" : "~~~!~~~ ",
    "debug" : false,
    "deviceEnabled" : true
},

{
    "accessory": "TuyaPowerStrip",
    "name": "ライト6",
    "description" : "Tuya Power Strip Outlet 3",
    "ip": "219.102.113.66",
    "devId": "01205862dc4a341ac124",
    "localKey": "a0f0c285dc88041b",
    "dps" : 6,
    "apiMinTimeout" : 100,
    "apiMaxTimeout" : 1000,
    "apiRetries": 1,
    "apiDebug" : false,
    "refreshInterval" : 120,
    "debugPrefix" : "~~~!~~~ ",
    "debug" : false,
    "deviceEnabled" : true
}]

}

drumfreak commented 6 years ago

Is 219.102.113.66 your LAN IP for the tuya device? Also, are you certain no apps are running in the background on any device that controls these devices? It only allows 1 connection from the lan to the device.

tomo719 commented 6 years ago

Thank you for your comment.

Yes, 219.102.113.66 is my LAN IP for the tuya device.
 I bought this wifi power strip and use it via Jinvoo Smart. Wifi Power Strip: Geekbes / Jinvoo https://www.ebay.com/p/WiFi-Smart-Power-Strip-Compatible-With-Alexa-Geekbes-Multi-plug-Timer-Outlets-4/7011116648 iPhone App: Jinoo Smart https://itunes.apple.com/us/app/jinvoo-smart/id1182632835?mt=8

This app shows device’s IP address and I also check it on terminal.

tomoMac:~ tomo719$ ping 219.102.113.66 PING 219.102.113.66 (219.102.113.66): 56 data bytes 64 bytes from 219.102.113.66: icmp_seq=0 ttl=255 time=0.403 ms 64 bytes from 219.102.113.66: icmp_seq=1 ttl=255 time=0.329 ms 64 bytes from 219.102.113.66: icmp_seq=2 ttl=255 time=0.333 ms 64 bytes from 219.102.113.66: icmp_seq=3 ttl=255 time=0.351 ms

As your advice, I turn off the app but it doesn’t works. I also reset the pairing of my device then I got this messages.

[2018-6-11 08:15:36] [Tuya Powerstrip - ライト2] connect ECONNREFUSED 219.102.113.66:6668 [2018-6-11 08:15:36] [Tuya Powerstrip - ライト6] connect ECONNREFUSED 219.102.113.66:6668 (node:8139) UnhandledPromiseRejectionWarning: Error: resolveIds() timed out. Is the device ID correct and is the device powered on? at timeout (/Users/tomo719/.nodebrew/node/v10.3.0/lib/node_modules/homebridge-tuya-outlet/node_modules/tuyapi/index.js:121:11) at Timeout.setTimeout (/Users/tomo719/.nodebrew/node/v10.3.0/lib/node_modules/homebridge-tuya-outlet/node_modules/p-timeout/index.js:19:13) at ontimeout (timers.js:427:11) at tryOnTimeout (timers.js:289:5) at listOnTimeout (timers.js:252:5) at Timer.processTimers (timers.js:212:10)

(node:8139) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:8139) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

tomo719 commented 6 years ago

Can I use homebridge-tuya-powerstrip plugin without LAN IP for the tuya device? With TuyaOutlet plugin, I checked my device working without LAN IP, but it allows only single outlet.

tomo719 commented 6 years ago

I'm so sorry, my device IP was wrong and after I correct that it was completely resolved! Thank you so much :D