gablau / node-red-contrib-blynk-ws

Old/Legacy Blynk library implementation for Node-RED using WebSockets
MIT License
31 stars 10 forks source link

Always get responseCode: CONNECT_REDIRECT #5

Closed vossilius closed 6 years ago

vossilius commented 6 years ago

Hi,

No matter what I do, the nodes do not connect. Log says:

0|node-red | 8 Mar 21:02:48 - [info] [blynk-ws-client:baa3d4b4.f6afb8] login -> 6de884c15e17405589a484b7b064xxxx
0|node-red | 8 Mar 21:02:48 - [info] [blynk-ws-client:baa3d4b4.f6afb8] SEND -> Cmd: LOGIN Id: 1 Data: "\u0002\u0000\u0001\u0000 6de884c15e17405589a484b7b064xxxx"
0|node-red | 8 Mar 21:02:48 - [info] [blynk-ws-client:baa3d4b4.f6afb8] RECV <- Cmd: CONNECT_REDIRECT, Id: 1, responseCode: SERVER_EXCEPTION
0|node-red | 8 Mar 21:03:03 - [info] [blynk-ws-client:baa3d4b4.f6afb8] Connection closed: ws://blynk-cloud.com:8080/websockets

Port 8080 is forwarded and I can ping blynk-cloud.com.

Also tried to renew the Token but the problem persists.

Any ideas?

Thanks!! Thomas

gablau commented 6 years ago

Hi Thomas, the cloud server port has changed recently try this: ws://blynk-cloud.com/websockets or SSL wss://blynk-cloud.com/websockets or maybe a network problem see this.

You can try your token here http://blynk-cloud.com/<replace with you token>/project if return a json your token is OK.

I would be interested to know what version of the library you have, also I would need the versions of nodered and nodejs. Could you post the nodered boot log ?? This is mine:

8 Mar 21:27:08 - [info] Node-RED version: v0.17.5 8 Mar 21:27:08 - [info] Node.js version: v6.10.2 8 Mar 21:27:08 - [info] Linux 4.9.35-v7+ arm LE 8 Mar 21:27:10 - [info] Loading palette nodes

it would also be interesting to know where node-red is working, a home server? a raspberry? an Amazon AWS online service?

Gabriele

vossilius commented 6 years ago

Hi Gabriele, Thanks for your quick response!

Here is mine:

8 Mar 22:10:55 - [info] Node-RED version: v0.18.4 8 Mar 22:10:55 - [info] Node.js version: v4.8.4 8 Mar 22:10:55 - [info] Linux 3.10.102 x64 LE 8 Mar 22:10:55 - [info] Loading palette nodes

Yes, I am using ws://blynk-cloud.com/websockets and read the link you provided.

Trying the second link with my token does not return anything.

I am using node-red-contrib-blynk-ws v0.3.0

I have installed wscat (https://github.com/websockets/wscat) on my server to test websocket from command line. It works. I can also successfully connect to ws://blynk-cloud.com/websockets with this tool. The client connects and then disconnects after a few seconds.

The flow I am using was working fine until I shut-down the server mid-January for some reason. Now, I reuse the same flow. Just moved the entire server to a new location. Only the router is different.

Best, Thomas

gablau commented 6 years ago

Would you be able to apply this fix "Fix error log" to the library? Apply the fix, restart node-red, try to reconnect and send me the log.

let me know Gabriele

gablau commented 6 years ago

Handle CONNECT_REDIRECT in release 0.4.0

vossilius commented 6 years ago

Hi Gabriele, ...looking good! Got my pins connected. Thanks a lot! Cheers, Thomas