Hi Guys,
I am using a Local Blynk Server on a raspberry pi and also using the same pi to run my node index.js.
I tested the index.js with the Cloud Server, Connected and controlled a led from my app. Woot Woot!!!
However, I am running into problem when trying to configure the index.js to work with the Local Server.
I am getting this error:
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ \/ '_/
/____/_/\_, /_//_/_/\_\
/___/
Give Blynk a Github star! => https://github.com/vshymanskyy/blynk-library-js
OnOff mode
Connecting to: 127.0.0.1 8080
SSL authorization...
(node:3625) [DEP0123] DeprecationWarning: Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.
events.js:301
throw err; // Unhandled 'error' event
^
Error [ERR_UNHANDLED_ERROR]: Unhandled error. ('ECONNRESET')
at Blynk.emit (events.js:299:17)
at Blynk.error (/home/pi/UVCRig/node_modules/blynk-library/blynk.js:649:8)
at exports.SslClient.<anonymous> (/home/pi/UVCRig/node_modules/blynk-library/blynk.js:612:48)
at exports.SslClient.emit (events.js:310:20)
at TLSSocket.<anonymous> (/home/pi/UVCRig/node_modules/blynk-library/blynk-node.js:223:16)
at TLSSocket.emit (events.js:310:20)
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
code: 'ERR_UNHANDLED_ERROR',
context: 'ECONNRESET'
}
pi@raspberrypi:~/UVCRig $
Any Ideas?
My Code:
var Blynk = require('blynk-library');
var AUTH = 'Deleted on purpose for post';
var blynk = new Blynk.Blynk(AUTH, options= {addr:'127.0.0.1', port:8080});
//8440
//var blynk = new Blynk.Blynk(AUTH);
var v1 = new blynk.VirtualPin(1);
var v9 = new blynk.VirtualPin(9);
v1.on('write', function(param) {
console.log('V1:', param[0]);
});
v9.on('read', function() {
v9.write(new Date().getSeconds());
});
``