HomeBridge eWeLink WebSocketClient:错误'0'(错误:意外的服务器响应(200))

时间:2018-06-01 14:57:14

标签: api github websocket

我希望你能帮助我。我将简要解释一下情况,我在我的覆盆子上安装了Github上的应用程序Homebridge:https://github.com/nfarina/homebridge

安装成功,所以,到目前为止一切顺利。但后来我为Homebridge应用程序安装了插件eWeLink:https://github.com/gbro115/homebridge-ewelink安装也很顺利,但在启动时似乎WebSocketClient出现了问题,当我启动应用程序时,我得到以下输出: / p>

[2018-6-1 14:43:27] [eWeLink] A total of [0] accessories were loaded from the local cache
[2018-6-1 14:43:27] [eWeLink] Requesting a list of devices from eWeLink HTTPS API at [https://eu-ota.coolkit.cc:8080]
[2018-6-1 14:43:27] Homebridge is running on port 51826.
[2018-6-1 14:43:28] [eWeLink] eWeLink HTTPS API reports that there are a total of [108] devices registered
[2018-6-1 14:43:28] [eWeLink] Evaluating if devices need to be removed...
[2018-6-1 14:43:28] [eWeLink] Evaluating if new devices need to be added...
[2018-6-1 14:43:28] [eWeLink] Device [undefined], ID : [undefined] will be added
[2018-6-1 14:43:28] [eWeLink] A device with an unknown type was returned. It will be skipped. undefined
[2018-6-1 14:43:28] [eWeLink] API key retrieved from web service is [undefined]
[2018-6-1 14:43:28] [eWeLink] Connecting to the WebSocket API at [wss://eu-api.coolkit.cc:8080/api/ws]
WebSocketClient: error { '0': Error: unexpected server response (200)
    at ClientRequest._req.on (/usr/lib/node_modules/homebridge-ewelink/node_modules/ws/lib/WebSocket.js:653:21)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:543:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:112:17)
    at TLSSocket.socketOnData (_http_client.js:440:20)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11) }
WebSocketClient: retry in 5000ms 1006
[2018-6-1 14:43:28] [eWeLink] WebSocket was closed. Reason [1006]
WebSocketClient: reconnecting...
WebSocketClient: error { '0': Error: unexpected server response (200)
    at ClientRequest._req.on (/usr/lib/node_modules/homebridge-ewelink/node_modules/ws/lib/WebSocket.js:653:21)
    at emitOne (events.js:116:13)
    at ClientRequest.emit (events.js:211:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:543:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:112:17)
    at TLSSocket.socketOnData (_http_client.js:440:20)
    at emitOne (events.js:116:13)
    at TLSSocket.emit (events.js:211:7)
    at addChunk (_stream_readable.js:263:12)
    at readableAddChunk (_stream_readable.js:250:11) }
WebSocketClient: retry in 5000ms 1006
[2018-6-1 14:43:34] [eWeLink] WebSocket was closed. Reason [1006]

有谁知道如何解决这个问题?提前谢谢。

1 个答案:

答案 0 :(得分:0)

当我在网上寻找解决我遇到的另一个问题时,

只是试图自己设置 - 我不知道现在是否有帮助但是我在GitHub上的插件问题页面上读到了eWeLink系统现在使用的一个不同的网络套接字api。

下面是我的覆盆子pi上来自config.json的工作片段,websocketAPI字段就是你想要的(如果适用,请调整eu给我们。)

"平台" :" eWeLink", "名称" :" eWeLink", " authenticationToken" :" 8b470fda3382935147ca865c44b79dfa8055f143" " apiHost" :" eu-api.coolkit.cc:8080", " webSocketApi" :" eu-pconnect3.coolkit.cc"