vshymanskyy / blynk-library-js Goto Github PK
View Code? Open in Web Editor NEWBlynk library for JS. Works with Browsers, Node.js, Espruino.
Home Page: https://blynk.io/
License: MIT License
Blynk library for JS. Works with Browsers, Node.js, Espruino.
Home Page: https://blynk.io/
License: MIT License
Hi, is there a way in the js library of handling a disconnect from the blynk server or checking the connection status in order to retry the connection if failed?
Thanks
Is this package discontinued? Planning an update soon?
As far as I've seen so far it seems to act as a device, being controlled by the app. But can it act as the app controlling a device?
Log:
[2018-04-25T22:06:21.440Z] Error: ECONNRESET
[2018-04-25T22:06:21.441Z] Error ECONNRESET
[2018-04-25T22:06:26.566Z] Connecting to: blynk-cloud.com 8441
[2018-04-25T22:06:26.635Z] SSL authorization...
[2018-04-25T22:06:26.863Z] Connected
[2018-04-25T22:06:26.925Z] Authorized
[2018-04-25T22:06:26.926Z] Blynk connected
[2018-04-26T00:07:38.203Z] Error: ECONNRESET
[2018-04-26T00:07:38.203Z] Error ECONNRESET
[2018-04-26T00:07:43.328Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T00:07:43.447Z] SSL authorization...
[2018-04-26T00:07:43.606Z] Connected
[2018-04-26T00:07:43.689Z] Authorized
[2018-04-26T00:07:43.689Z] Blynk connected
[2018-04-26T10:27:07.060Z] Error: ECONNRESET
[2018-04-26T10:27:07.061Z] Error ECONNRESET
[2018-04-26T10:27:10.984Z] Error: ERROR
[2018-04-26T10:27:10.984Z] Error undefined
[2018-04-26T10:27:11.199Z] Error: ERROR
[2018-04-26T10:27:11.199Z] Error undefined
[2018-04-26T10:27:12.308Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:27:12.571Z] SSL authorization...
[2018-04-26T10:27:12.707Z] Connected
[2018-04-26T10:27:12.770Z] Authorized
[2018-04-26T10:27:12.770Z] Blynk connected
[2018-04-26T10:27:15.986Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:27:16.050Z] SSL authorization...
[2018-04-26T10:27:16.181Z] Connected
[2018-04-26T10:27:16.201Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:27:16.263Z] SSL authorization...
[2018-04-26T10:27:16.396Z] Connected
[2018-04-26T10:27:16.458Z] Authorized
[2018-04-26T10:27:16.458Z] Blynk connected
[2018-04-26T10:27:25.985Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:27:26.047Z] SSL authorization...
[2018-04-26T10:27:26.177Z] Connected
[2018-04-26T10:27:35.985Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:27:36.050Z] SSL authorization...
[2018-04-26T10:27:36.184Z] Connected
[2018-04-26T10:27:45.985Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:27:46.047Z] SSL authorization...
[2018-04-26T10:27:46.177Z] Connected
[2018-04-26T10:27:56.130Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:27:56.193Z] SSL authorization...
[2018-04-26T10:27:56.324Z] Connected
[2018-04-26T10:28:06.163Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:28:06.226Z] SSL authorization...
[2018-04-26T10:28:06.357Z] Connected
[2018-04-26T10:28:16.164Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:28:16.226Z] SSL authorization...
[2018-04-26T10:28:16.369Z] Connected
[2018-04-26T10:28:26.164Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:28:26.226Z] SSL authorization...
[2018-04-26T10:28:26.356Z] Connected
[2018-04-26T10:28:36.165Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:28:36.230Z] SSL authorization...
[2018-04-26T10:28:36.362Z] Connected
[2018-04-26T10:28:46.166Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:28:46.229Z] SSL authorization...
[2018-04-26T10:28:46.359Z] Connected
[2018-04-26T10:28:56.167Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:28:56.229Z] SSL authorization...
[2018-04-26T10:28:56.363Z] Connected
[2018-04-26T10:29:06.167Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:29:06.231Z] SSL authorization...
[2018-04-26T10:29:06.364Z] Connected
[2018-04-26T10:29:16.168Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:29:16.231Z] SSL authorization...
[2018-04-26T10:29:16.365Z] Connected
[2018-04-26T10:29:26.170Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:29:26.232Z] SSL authorization...
[2018-04-26T10:29:26.363Z] Connected
[2018-04-26T10:29:36.171Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:29:36.233Z] SSL authorization...
[2018-04-26T10:29:36.364Z] Connected
[2018-04-26T10:29:46.172Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:29:46.260Z] SSL authorization...
[2018-04-26T10:29:46.391Z] Connected
[2018-04-26T10:29:56.172Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:29:56.234Z] SSL authorization...
[2018-04-26T10:29:56.365Z] Connected
[2018-04-26T10:30:06.173Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:06.260Z] SSL authorization...
[2018-04-26T10:30:06.631Z] Connected
[2018-04-26T10:30:07.253Z] Error: ECONNRESET
[2018-04-26T10:30:07.254Z] Error ECONNRESET
[2018-04-26T10:30:10.988Z] Error: ERROR
[2018-04-26T10:30:10.988Z] Error undefined
[2018-04-26T10:30:11.202Z] Error: ERROR
[2018-04-26T10:30:11.202Z] Error undefined
[2018-04-26T10:30:12.254Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:12.335Z] SSL authorization...
[2018-04-26T10:30:12.467Z] Connected
[2018-04-26T10:30:12.535Z] Authorized
[2018-04-26T10:30:12.535Z] Blynk connected
[2018-04-26T10:30:15.989Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:16.051Z] SSL authorization...
[2018-04-26T10:30:16.175Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:16.202Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:16.237Z] SSL authorization...
[2018-04-26T10:30:16.264Z] SSL authorization...
[2018-04-26T10:30:16.368Z] SSL not authorized
[2018-04-26T10:30:16.395Z] Connected
[2018-04-26T10:30:16.457Z] Authorized
[2018-04-26T10:30:16.457Z] Blynk connected
[2018-04-26T10:30:25.989Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:26.052Z] SSL authorization...
[2018-04-26T10:30:26.175Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:26.237Z] SSL authorization...
[2018-04-26T10:30:26.368Z] Connected
[2018-04-26T10:30:35.991Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:36.176Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:36.182Z] SSL authorization...
[2018-04-26T10:30:36.242Z] SSL authorization...
[2018-04-26T10:30:36.315Z] SSL not authorized
[2018-04-26T10:30:36.374Z] Connected
[2018-04-26T10:30:45.992Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:46.176Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:46.192Z] SSL authorization...
[2018-04-26T10:30:46.356Z] SSL authorization...
[2018-04-26T10:30:46.524Z] SSL not authorized
[2018-04-26T10:30:46.683Z] Connected
[2018-04-26T10:30:46.848Z] Disconnect blynk
[2018-04-26T10:30:46.849Z] Blynk disconnected
[2018-04-26T10:30:46.849Z] REARMING DISCONNECT
[2018-04-26T10:30:51.849Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:51.912Z] SSL authorization...
[2018-04-26T10:30:52.047Z] Connected
[2018-04-26T10:30:52.109Z] Authorized
[2018-04-26T10:30:52.109Z] Blynk connected
[2018-04-26T10:30:52.109Z] Got Pin write, vPin: 0 (pin index: 0), param: 0 (All pins)
[2018-04-26T10:30:52.109Z] Got Pin write, vPin: 0 (pin index: 0), param: 0 (recursed) (All pins)
[2018-04-26T10:30:52.109Z] Got Pin write, vPin: 1 (pin index: 1), param: 0
[2018-04-26T10:30:52.110Z] Got Pin write, vPin: 2 (pin index: 2), param: 0
[2018-04-26T10:30:52.110Z] Got Pin write, vPin: 3 (pin index: 3), param: 0
[2018-04-26T10:30:52.110Z] Stop timer
[2018-04-26T10:30:52.110Z] Got Elapsed write, vPin: 13, param: Stopped
[2018-04-26T10:30:52.110Z] Got Level write, vPin: 12, param: 0
[2018-04-26T10:30:52.110Z] Syncing
[2018-04-26T10:30:52.172Z] Got Timer write, vPin: 11, param: 1
[2018-04-26T10:30:52.173Z] Got Level write, vPin: 12, param: 0
[2018-04-26T10:30:52.173Z] Got Elapsed write, vPin: 13, param: Stopped
[2018-04-26T10:30:55.993Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:56.055Z] SSL authorization...
[2018-04-26T10:30:56.177Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:30:56.239Z] SSL authorization...
[2018-04-26T10:30:56.371Z] Connected
[2018-04-26T10:31:05.994Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:06.056Z] SSL authorization...
[2018-04-26T10:31:06.178Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:06.241Z] SSL authorization...
[2018-04-26T10:31:06.373Z] Connected
[2018-04-26T10:31:15.994Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:16.056Z] SSL authorization...
[2018-04-26T10:31:16.179Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:16.242Z] SSL authorization...
[2018-04-26T10:31:16.373Z] Connected
[2018-04-26T10:31:25.994Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:26.056Z] SSL authorization...
[2018-04-26T10:31:26.179Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:26.241Z] SSL authorization...
[2018-04-26T10:31:26.373Z] Connected
[2018-04-26T10:31:35.993Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:36.055Z] SSL authorization...
[2018-04-26T10:31:36.180Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:36.243Z] SSL authorization...
[2018-04-26T10:31:36.377Z] Connected
[2018-04-26T10:31:45.994Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:46.181Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:46.197Z] SSL authorization...
[2018-04-26T10:31:46.361Z] SSL authorization...
[2018-04-26T10:31:46.527Z] SSL not authorized
[2018-04-26T10:31:46.688Z] Connected
[2018-04-26T10:31:47.015Z] Error: ECONNRESET
[2018-04-26T10:31:47.015Z] Error ECONNRESET
[2018-04-26T10:31:50.990Z] Error: ERROR
[2018-04-26T10:31:50.990Z] Error undefined
[2018-04-26T10:31:51.202Z] Error: ERROR
[2018-04-26T10:31:51.203Z] Error undefined
[2018-04-26T10:31:52.015Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:52.080Z] SSL authorization...
[2018-04-26T10:31:52.211Z] Connected
[2018-04-26T10:31:52.335Z] Error: ECONNRESET
[2018-04-26T10:31:52.335Z] Error ECONNRESET
[2018-04-26T10:31:52.536Z] Error: ERROR
[2018-04-26T10:31:52.536Z] Error undefined
[2018-04-26T10:31:52.775Z] Error: ERROR
[2018-04-26T10:31:52.776Z] Error undefined
[2018-04-26T10:31:55.991Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:55.995Z] Connecting to: blynk-cloud.com 8441
[2018-04-26T10:31:56.055Z] SSL authorization...
[2018-04-26T10:31:56.057Z] SSL authorization...
[2018-04-26T10:31:56.182Z] Connecting to: blynk-cloud.com 8441
/Users/atsarev/dev/n_lighter/node_modules/blynk-library/blynk-node.js:204
if (!self.sock.authorized) {
^
TypeError: Cannot read property 'authorized' of null
at TLSSocket.<anonymous> (/Users/atsarev/dev/n_lighter/node_modules/blynk-library/blynk-node.js:204:24)
at Object.onceWrapper (events.js:313:30)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket.<anonymous> (_tls_wrap.js:1126:14)
at emitNone (events.js:106:13)
at TLSSocket.emit (events.js:208:7)
at TLSSocket._finishInit (_tls_wrap.js:639:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:469:38)
head -n 210 /Users/atsarev/dev/n_lighter/node_modules/blynk-library/blynk-node.js | tail
console.log("SSL authorization...");
opts.socket = sock;
self.sock = tls.connect(opts, function() {
if (!self.sock.authorized) {
console.log('SSL not authorized');
return;
}
console.log('Connected');
self.sock.setNoDelay(true);
self.sock.setEncoding('binary');
I think need to check sock
variable is not null
Hi,
When I want to read from blynk it's not working.
This is my code :
pin=NodeMCU.D2;
var wifi = require("Wifi");
var dht = require("DHT22").connect(pin);
var Blynk = require('http://tiny.cc/blynk-js');
var AUTH = 'ddff00000c';
var temp = null;
function onInit() {
wifi.setHostname("antoine-espruino");
wifi.connect("club", {password:"fdfd4422fd"}, function(err){
if (err) throw err;
console.log("WiFi connected.", wifi.getIP() );
blynkInit();
});
wifi.stopAP();
wifi.save();
}
function blynkInit() {
var blynk = new Blynk.Blynk(AUTH);
var v9 = new blynk.VirtualPin(9);
var v1 = new blynk.VirtualPin(1);
v1.on('write', function(param) {
console.log('V1:', param);
});
v9.on('read', function() {
v9.write(temp);
console.log('readed ',temp);
});
blynk.on('connect', function() { console.log("Blynk ready.");});
blynk.on('disconnect', function() { console.log("DISCONNECT"); });
}
save();
Under certain scenarios I get repeating connect/disconnect sequence. I get the same on Mint and on Raspberry Pi. Blynk-library downloaded by npm in last week.
Example guaranteed crash code:
`
#!/usr/bin/env nodejs
var token = 'a82b38d etc - use your own! ';
var Blynk = require("blynk-library");
var blynk = new Blynk.Blynk(token); // ssl default
// Blinking LED widget at APP screen.
var V15 = new blynk.VirtualPin(15);
var ledval = 0; // brightness
setInterval(function(){
// we put a LED widget on phone APP at V15. Let's blink it on phone.
ledval = 255-ledval;
V15.write(ledval);
}, 200); // 5/sec ie rather fast - first write is before conn is settled.
`
It seems if a virtual write is pushed out while socket connection is not stable, then the blynk process in nodejs immediately disconnects from the server. If the writes keep coming, the server is repeatedly disconnected, in a useless loop.
My solution is to change this line in blynk.js:
532 this.sendRsp(msg_type, msg_id, data.length, data);
into:
if ((typeof this.timerHb) === 'object' && this.timerHb != null) {this.sendRsp(msg_type, msg_id, data.length, data)};
Now, writes attempted during socket connection unavailability are simply dumped.
(timerHb is heartbeat/ping callback, and it seems to make a workable "flag" for indicating when conn is fully up.)
Brian
The inbuilt code to read GPIO at Raspberry Pi (using OnOff library) seems broken. The write/gpio output is OK, but read/gpio crashes. (Blynk-library version = as fetched by npm in last week.)
My fix:
in file blynk-node.js, function BoardOnOff, case "dr", alter the line reading
373 self.blynk.sendMsg(MsgType.HW, null, ['dw', values[1], value]);
to remove the parameter null, ie
self.blynk.sendMsg(MsgType.HW, ['dw', values[1], value]);
Now it works fine.
Of course, the blynk/OnOff combination has no support for internal pullup resistors, so I have now gotten used to using rpio library to service my gpio button pins (withblynk virtual pins), and leaving the inbuilt OnOff reads for plain vanilla gpio inputs.
Brian
The port of blynk-cloud.com has changed from 8441 to 9443.
I have changed the port in my local copy in blynk-node.js:
self.port = options.port || 9443;
And it seems to be working ok.
You might want to make the fix and update in npm.
Cheers. :)
Per docs.blynk.cc an event should be generated each time the Blynk App, running on mobile phone, is opened. I searched the file blynk.js for all emitted events but could not find anything resembling this functionality. I could not find an example showing this behavior either.
Does this functionality exist for the JavaScript version of Blynk library?
If so, please describe the usage.
If not, please add this as a feature request.
npm-install installs blynk-library 0.0.19", not "0.0.21", !
โ41% [:~/Play/rpi/blynk] $ docker run --rm -it --name blink --privileged blink bash
root@7c75d93ca691:/# blynk.js xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
OnOff mode
Connecting to SSL: cloud.blynk.cc 8441
Connected, authorized
Blynk ready.
/usr/local/lib/node_modules/blynk-library/blynk-node.js:303
this.blynk.sendMsg(MsgType.HW, null, ['dw', values[1], value]);
^
TypeError: Cannot read property 'blynk' of undefined
at /usr/local/lib/node_modules/blynk-library/blynk-node.js:303:17
at /node_modules/onoff/onoff.js:151:7
at FSReqWrap.wrapper [as oncomplete] (fs.js:527:17)
Dockerfile:
FROM resin/rpi-raspbian:jessie
RUN echo "deb http://apt.adafruit.com/raspbian/ jessie main" >> /etc/apt/sources.list && \
apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes node && \
apt-get clean
RUN apt-get install -y python
RUN apt-get install -y build-essential
RUN npm install epoll && \
npm install onoff
RUN npm install -g blynk-library
CMD ["blynk.js", "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
Ran with command:
docker build -t blink .
docker run --rm -it --name blink --privileged blink
The library does not appear to have any reference documentation. The best one can do is pour through the source and try and decode what it means. This issue asks for resources to be spent documenting the library so that it can be easier consumed by programmers.
This is what I keep getting sometimes:
Error: Uncaught, unspecified "error" event. (ECONNRESET) at Blynk.emit (events.js:164:17) at Blynk.error (node_modules/blynk-library/blynk.js:622:8) at exports.SslClient.<anonymous> (node_modules/blynk-library/blynk.js:585:48) at emitOne (events.js:96:13) at exports.SslClient.emit (events.js:189:7) at TLSSocket.<anonymous> (node_modules/blynk-library/blynk-node.js:223:16) at emitOne (events.js:96:13) at TLSSocket.emit (events.js:189:7) at emitErrorNT (net.js:1280:8) at _combinedTickCallback (internal/process/next_tick.js:74:11) at process._tickCallback (internal/process/next_tick.js:98:9)
I cannot connect to the blynk server using the secure connection. The SSL authorization fails with a DEPTH_ZERO_SELF_SIGNED_CERT
error. I understand that this is most likely not a problem of this project, but since I could not find anything online, I thought to raise the issue here. Well, at least your examples currently fail on two machines I tested them on.
This is what I get if I run the Usage Example from your main README file:
Connecting to: blynk-cloud.com 8441
SSL authorization...
events.js:159
throw err;
^
Error: Uncaught, unspecified "error" event. (DEPTH_ZERO_SELF_SIGNED_CERT)
at emit (events.js:157:17)
at Blynk.error (/Users/trident/git/gitlab/blynk.agent/node_modules/blynk-library/blynk.js:571:8)
at null.<anonymous> (/Users/trident/git/gitlab/blynk.agent/node_modules/blynk-library/blynk.js:534:48)
at emitOne (events.js:90:13)
at emit (events.js:182:7)
at TLSSocket.<anonymous> (/Users/trident/git/gitlab/blynk.agent/node_modules/blynk-library/blynk-node.js:197:16)
at emitOne (events.js:90:13)
at TLSSocket.emit (events.js:182:7)
at emitErrorNT (net.js:1250:8)
at _combinedTickCallback (node.js:377:13)
HI, it seems the lib throws and exception if for instance the port is wrong
12 Oct 18:26:02 - Error: socket hang up
at TLSSocket.onHangUp (_tls_wrap.js:959:21)
at TLSSocket.g (events.js:199:16)
at TLSSocket.emit (events.js:129:20)
at _stream_readable.js:908:16
at process._tickCallback (node.js:355:11)
expected behavior would be to fail gracefully with an event
cheers
seems it's not in there yet :)
As normal, I declare a Virtualpin like your example: var v1 = new blynk.VirtualPin(1);
If I have "some" virtualpin, it's fine, but in case of many pins, about 40 - 50 pin? Is there any way to more quick and easier to declare a virtual pin instead of write 40 - 50 lines ? I know this is personal question, but hope you can help me.
hey there, i am used to running blynk code in arduino environment
Now, i have an intel edison and want to use JS.
in the documentation/instructable you say use npm install -g mraa blynk,
should i ssh into edison first? or can i run this directly from terminal?
thanks
My Blynk server is hosting on VM (CoreOS).
When the host system (Windows) sleeping, the client still connects.
I am using TCP client.
let b = new blynk.Blynk(auth, {
connector: new blynk.TcpClient(options)
})
...
Hi
My code
var v2 = new blynk.VirtualPin(2); //table
var v20 = new blynk.VirtualPin(20);` //webhook
v2.on('write', function(param) {
if (param[0] == "select")
{
var rowID = param[1];
v20.write(rowID);
}
});
is it right?
I am running a local blynk server (0.11.4) on a Raspberry Pi with a self-signed SSL certificate, as instructed in the wiki.
When trying to connect through blynk-library-js (0.0.23), I get the following error:
OnOff mode
Connecting to SSL: 192.168.1.55 8443
Error DEPTH_ZERO_SELF_SIGNED_CERT
The exact code I am using to connect is:
var BlynkLib = require('/usr/local/lib/node_modules/blynk-library');
var options = {addr:"192.168.1.55",port:8443}
var AUTH = 'XXXXX';
var blynk = new BlynkLib.Blynk(AUTH, options);
Both the server key and certificate are recognised in the start-up process of the server but I am not sure where to get/put the client certificate? The server log prints this:
16:25:14.272 INFO - Plain tcp/ip hardware server port 8442.
16:25:31.156 INFO - SSL hardware port 8441.
16:25:31.289 INFO - Enabling SSL for application.
16:25:31.293 WARN - Found server certificates but no client certificate for '/home/pi/blynk-server' path. Using one way ssl.
16:25:31.651 INFO - Application server port 8443.
16:25:31.725 INFO - Administration server port 8777.
Thanks
hi
when i m using a wrong token i get into a re-connection loop stating that connection is authorized. Is there an event that we could use for when it fails and disable the loop maybe, or handle it in a more straightforward manner?
Cheers
Connecting to SSL: cloud.blynk.cc 8441
Connected, authorized
Connecting to SSL: cloud.blynk.cc 8441
Connected, authorized
Connecting to SSL: cloud.blynk.cc 8441
Connected, authorized
...
Connecting to SSL: cloud.blynk.cc 8441
Connected, authorized
Connecting to SSL: cloud.blynk.cc 8441
Connected, authorized
Connecting to SSL: cloud.blynk.cc 8441
In blynk-nodejs, SslClient()
the default options.certs_path
points to server.crt in library and therefore options.ca
maps to server.crt used for blynk-cloud.com. To enable SSL authorization via Mozilla CA, the options.ca
must be null. I've tried options.certs_path
pointing to a empty server.crt file but this returns options.ca === [ <Buffer > ]
, an empty buffer which evaluates to 'true'.
I have temporarily hard coded opts.ca = null
to prevent overriding the Let's Encrypt authorization.
Hi,
The lib's been running like a charm for 2 years but it doesn't connect anymore since yesterday...
Script running on node v12.19.1 on a raspberry Pi 3B (Raspberry Pi OS).
Any suggestion ??
Here's the error message.
Connecting to: blynk-cloud.com 443
SSL authorization...
SSL not authorized
Regards,
Damien
Need to check why Unicode notifications are not working and provide a fix/example.
JS library doesn't seem to work with Blynk 2.0. I get the INVALID_TOKEN error when trying to connect. Is this a known issue?
There has been a project on the go for a couple of months which is a port of Espruino to native ESP8266 execution and it is progressing well to the point that there are now stable drivers. This issue asks to see if there is interest in testing and collaboration on getting blynk-library-js running directly on Espruino running natively on ESP8266?
If yes, and the developers of the Espruino port to ESP8266 can assist, please contact [email protected] or respond to this issue.
I looking really looking forward to implement blynk with Espruino on an ESP32/esp8622.
Die type safety i want to implement it in Typescript. Is there any type definition or can you provide one?
Maybe there is a good entry point to generate one by: https://github.com/Microsoft/dts-gen
I get this very often (once a day at least):
Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL authorization... Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 SSL authorization... SSL authorization... Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 Connecting to: blynk-cloud.com 8441 SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL not authorized SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL authorization... SSL not authorized SSL authorization... SSL not authorized SSL authorization... SSL not authorized
until it crashes....
I can not get this library to connect at all with Blynk 2.0. I keep getting ETIMEDOUT Errors. I see this library has not been updated since 2019. Are there plans to update it in the near future? I am paying for a Blink subscription and Node.js support was an advertised feature.
Best Regards,
Mike
Hi, I know the library auto-detects GPIO read/write without having to write code, but I would like to set a GPIO pin on a raspberry pi high/low using code. Is there a way to do it? @vshymanskyy
I am getting this error with the provided sample problem
at getOptions (fs.js:50:11)
at fs.readFileSync (fs.js:465:13)
at Array.map (native)
at exports.SslClient.connect (/home/pi/motor/node_modules/blynk-library/blynk-node.js:170:42)
at doConnect (/home/pi/motor/node_modules/blynk-library/blynk.js:546:15)
at Blynk.connect (/home/pi/motor/node_modules/blynk-library/blynk.js:559:5)
at new Blynk (/home/pi/motor/node_modules/blynk-library/blynk.js:385:10)
at Object. (/home/pi/motor/blynk-motor.js:9:13)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
I looked at the code carefully and it is at this line
if (self.ca) { opts.ca = self.ca.map(fs.readFileSync); }
fs.readFileSync takes options as second parameter, so it can't be used with map.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.