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

Connecting to Blynk-Cloud.com with Node fails #7

Closed
noelmcloughlin opened this issue Dec 29, 2018 · 4 comments
Closed

Connecting to Blynk-Cloud.com with Node fails #7

noelmcloughlin opened this issue Dec 29, 2018 · 4 comments

Comments

@noelmcloughlin
Copy link
Owner

The blynk library (nodejs on-device app) cannot connect to blynk-cloud today.

Either it's dropping ICMP and HTTP:8441 or service is down?

$ curl 139.59.206.133:8441
curl: (7) Failed to connect to 139.59.206.133 port 8441: Operation timed out

$ curl 139.59.206.133:8441
^C^C

$ ping blynk-cloud.com
PING blynk-cloud.com (139.59.206.133): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
^C
--- blynk-cloud.com ping statistics ---

@noelmcloughlin
Copy link
Owner Author

No response.

pi@rasppi2b:~/iot-edge-stepping-stones/blynk$ node rpi2b/index.js 

    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/

  Give Blynk a Github star! => https://github.com/vshymanskyy/blynk-library-js

OnOff mode
Connecting to: blynk-cloud.com 8441
Connecting to: blynk-cloud.com 8441

... etc yawn etc ....

@noelmcloughlin
Copy link
Owner Author

No luck no matter what - same issue on Pi2B+ and 3B+.

pi@rasppi2b:~/iot-edge-stepping-stones/blynk$ node --version
v8.11.1
pi@rasppi2b:~/iot-edge-stepping-stones/blynk$ nodejs --version
v8.11.1

pi@rasppi2b:~/iot-edge-stepping-stones/blynk$ cat pi/2b/index.js 
//###########################################
// Create Blynk "Virtual Pin" for a device,
//###########################################

var Blynk = require("blynk-library");
var AUTH = process.env.MY_BLYNK_TOKEN; 
//## no difference ## var AUTH = "'" + process.env.MY_BLYNK_TOKEN + "'"
//## no difference ## var AUTH = '123456789123456789123'"

var blynk = new Blynk.Blynk(AUTH);
var v1 = new blynk.VirtualPin(1);

v1.on('write', function(param) {
  console.log('V1:', param[0]);
});

@noelmcloughlin noelmcloughlin changed the title Is Blynk-Cloud.com down Connecting to Blynk-Cloud.com with Node fails Dec 29, 2018
@noelmcloughlin
Copy link
Owner Author

This works ...

pi@rasppi2b:~/iot-edge-stepping-stones/blynk$ sudo -E node pi/2b/testtcp.js 

    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/

  Give Blynk a Github star! => https://github.com/vshymanskyy/blynk-library-js

OnOff mode
Connecting to TCP: blynk-cloud.com 80
Connected
Authorized

Code:

pi@rasppi2b:~/iot-edge-stepping-stones/blynk$ cat pi/2b/testtcp.js 
var Blynk = require('blynk-library');

var blynk = new Blynk.Blynk(process.env.MY_BLYNK_TOKEN, options = {
  connector : new Blynk.TcpClient()
});

var v1 = new blynk.VirtualPin(1);

v1.on('write', function(param) {
  console.log('V1:', param[0]);
})

@noelmcloughlin
Copy link
Owner Author

Fixed by commit 402a3bf

I'll use TcpClient instead.

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