Skip to content

Commit

Permalink
Version 1.0.8
Browse files Browse the repository at this point in the history
  • Loading branch information
gablau committed Jan 9, 2023
1 parent 9fad1ca commit e114299
Show file tree
Hide file tree
Showing 31 changed files with 2,653 additions and 780 deletions.
16 changes: 15 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

## [1.0.8] - 2023-01-09

### Changed

- Increased minimum Node-red version to 2.0.0
- Increased minimum Node version to 12.22.12
- Updated dependencies for security reasons
- Remove info of public server: blynk-cloud.com
- Returns warning if trying to connect to old cloud server
- Converting the examples to local server
- Updated docs link to new address [https://gablau.dev/blynk-legacy-docs/](https://gablau.dev/blynk-legacy-docs/)


## [1.0.7] - 2022-02-01

### Changed
Expand Down Expand Up @@ -290,7 +303,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Heartbeat once 10 seconds
- Max virtual pin allowed 128

[unreleased]: https://github.com/gablau/node-red-contrib-blynk-ws/compare/1.0.7...HEAD
[unreleased]: https://github.com/gablau/node-red-contrib-blynk-ws/compare/1.0.8...HEAD
[1.0.8]: https://github.com/gablau/node-red-contrib-blynk-ws/compare/1.0.7...1.0.8
[1.0.7]: https://github.com/gablau/node-red-contrib-blynk-ws/compare/1.0.6...1.0.7
[1.0.6]: https://github.com/gablau/node-red-contrib-blynk-ws/compare/1.0.5...1.0.6
[1.0.5]: https://github.com/gablau/node-red-contrib-blynk-ws/compare/1.0.4...1.0.5
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ __________
## Warning: this library is for old Blynk [or Blynk 1.0 or Legacy] for the new Blynk Iot Platform go to the new library repository: [node-red-contrib-blynk-iot](https://github.com/gablau/node-red-contrib-blynk-iot)
---
## Node-RED blynk Websockets version
This library supports both SSL (wss://) and non secure (ws://) connection to local server and Blynk cloud server.
This library supports both SSL (wss://) and non secure (ws://) connection to local server ~~and Blynk cloud server~~.
For local server, wss:// works only if you ve got a certificate installed.
For Blynk cloud server, you can use **ws://blynk-cloud.com/websockets** or with SSL **wss://blynk-cloud.com/websockets** as the server url.
~~For Blynk cloud server, you can use **ws://blynk-cloud.com/websockets** or with SSL **wss://blynk-cloud.com/websockets** as the server url.~~

If you installed Node Red globally use this command to install
```npm install --global node-red-contrib-blynk-ws```
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| Version | Supported |
| ------- | ------------------ |
| 1.0.6 | Yes |
| <= 1.0.4 | No |
| 1.0.8 | Yes |
| <= 1.0.7 | No |

## Reporting a Vulnerability

Expand Down
4 changes: 2 additions & 2 deletions examples/01 - App Read Write events.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@
{
"id": "8c06e199.b82b28",
"type": "blynk-ws-client",
"name": "Blynk Cloud 1",
"path": "ws://blynk-cloud.com/websockets",
"name": "Blynk Local Server 1",
"path": "ws://your-local-server.ip/websockets",
"key": "your-auth-token-here",
"dbg_all": true,
"dbg_read": false,
Expand Down
4 changes: 2 additions & 2 deletions examples/02 - Write and Set Property.json
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@
{
"id": "8c06e199.b82b28",
"type": "blynk-ws-client",
"name": "Blynk Cloud 1",
"path": "ws://blynk-cloud.com/websockets",
"name": "Blynk Local Server 1",
"path": "ws://your-local-server.ip/websockets",
"key": "your-auth-token-here",
"dbg_all": true,
"dbg_read": false,
Expand Down
4 changes: 2 additions & 2 deletions examples/03 - Sync and Bridge.json
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,8 @@
{
"id": "8c06e199.b82b28",
"type": "blynk-ws-client",
"name": "Blynk Cloud 1",
"path": "ws://blynk-cloud.com/websockets",
"name": "Blynk Local Server 1",
"path": "ws://your-local-server.ip/websockets",
"key": "your-auth-token-here",
"dbg_all": true,
"dbg_read": false,
Expand Down
4 changes: 2 additions & 2 deletions examples/04 - Notify and Email widgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,8 @@
{
"id": "8c06e199.b82b28",
"type": "blynk-ws-client",
"name": "Blynk Cloud 1",
"path": "ws://blynk-cloud.com/websockets",
"name": "Blynk Local Server 1",
"path": "ws://your-local-server.ip/websockets",
"key": "your-auth-token-here",
"dbg_all": true,
"dbg_read": false,
Expand Down
4 changes: 2 additions & 2 deletions examples/05 - Table and LCD widgets.json
Original file line number Diff line number Diff line change
Expand Up @@ -403,8 +403,8 @@
{
"id": "8c06e199.b82b28",
"type": "blynk-ws-client",
"name": "Blynk Cloud 1",
"path": "ws://blynk-cloud.com/websockets",
"name": "Blynk Local Server 1",
"path": "ws://your-local-server.ip/websockets",
"key": "your-auth-token-here",
"dbg_all": true,
"dbg_read": false,
Expand Down
4 changes: 2 additions & 2 deletions examples/06 - Zergba and Styled Button.json
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,8 @@
{
"id": "8c06e199.b82b28",
"type": "blynk-ws-client",
"name": "Blynk Cloud 1",
"path": "ws://blynk-cloud.comme/websockets",
"name": "Blynk Local Server 1",
"path": "ws://your-local-server.ip/websockets",
"key": "your-auth-token-here",
"dbg_all": true,
"dbg_read": false,
Expand Down
4 changes: 2 additions & 2 deletions examples/07 - Image Gallery widget.json
Original file line number Diff line number Diff line change
Expand Up @@ -848,8 +848,8 @@
{
"id": "8c06e199.b82b28",
"type": "blynk-ws-client",
"name": "Blynk Cloud 1",
"path": "ws://blynk-cloud.com/websockets",
"name": "Blynk Local Server 1",
"path": "ws://your-local-server.ip/websockets",
"key": "your-auth-token-here",
"dbg_all": true,
"dbg_read": false,
Expand Down
12 changes: 6 additions & 6 deletions libs/blynk-lib.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// blynk enum
const srs = require('secure-random-string');
const utf8 = require('utf8');
const blynkEnum = require('./blynk-enum.js');
const blynkEnum = require('./blynk-enum');

const MsgStatus = blynkEnum.MsgStatus;
const MsgType = blynkEnum.MsgType;

// blynk util
const blynkUtil = require('./blynk-util.js');
const blynkUtil = require('./blynk-util');

const messageToDebugString = blynkUtil.messageToDebugString;
const commandToDebugString = blynkUtil.commandToDebugString;
Expand Down Expand Up @@ -324,7 +324,7 @@ const syncAll = function syncAll(msgkey) {
}
const msg = this.blynkCmd(MsgType.HW_SYNC);
if (this.multi_cmd && msgkey !== undefined) {
this.msgList[msgkey] = this.msgList[msgkey] + msg;
this.msgList[msgkey] = this.msgList[msgkey] + msg; // eslint-disable-line operator-assignment
} else this.sendMsg(msg);
};

Expand All @@ -335,7 +335,7 @@ const syncVirtual = function syncVirtual(vpin, msgkey) {
}
const msg = this.blynkCmd(MsgType.HW_SYNC, ['vr', vpin]);
if (this.multi_cmd && msgkey !== undefined) {
this.msgList[msgkey] = this.msgList[msgkey] + msg;
this.msgList[msgkey] = this.msgList[msgkey] + msg; // eslint-disable-line operator-assignment
} else this.sendMsg(msg);
};

Expand All @@ -346,7 +346,7 @@ const virtualWrite = function virtualWrite(vpin, val, msgkey) {
}
const msg = this.blynkCmd(MsgType.HW, ['vw', vpin].concat(val));
if (this.multi_cmd && msgkey !== undefined) {
this.msgList[msgkey] = this.msgList[msgkey] + msg;
this.msgList[msgkey] = this.msgList[msgkey] + msg; // eslint-disable-line operator-assignment
} else this.sendMsg(msg);
};

Expand All @@ -357,7 +357,7 @@ const setProperty = function setProperty(vpin, prop, val, msgkey) {
}
const msg = this.blynkCmd(MsgType.PROPERTY, [vpin, prop].concat(val));
if (this.multi_cmd && msgkey !== undefined) {
this.msgList[msgkey] = this.msgList[msgkey] + msg;
this.msgList[msgkey] = this.msgList[msgkey] + msg; // eslint-disable-line operator-assignment
} else this.sendMsg(msg);
};

Expand Down
2 changes: 1 addition & 1 deletion libs/blynk-util.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* blynk helper function */
const utf8 = require('utf8');
const blynkEnum = require('./blynk-enum.js');
const blynkEnum = require('./blynk-enum');

const { MsgStatus } = blynkEnum;
const { MsgType } = blynkEnum;
Expand Down
21 changes: 7 additions & 14 deletions nodes/blynk-ws-client.html
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
<div id="blynk-ws-client-tab-connection" style="display:none">
<div class="form-row">
<label for="node-config-input-path"><i class="fa fa-bookmark"></i> Url</label>
<input type="text" id="node-config-input-path" placeholder="ex. ws://blynk-cloud.com/websockets">
<input type="text" id="node-config-input-path" placeholder="ex. wss://&lt;your-local-ip&gt;:9443/websockets">
</div>
<div class="form-row">
<label for="node-config-input-key"><i class="fa fa-key"></i> Auth Token</label>
Expand All @@ -148,12 +148,8 @@
</div>
</div>
<div class="form-tips">
<p>The url of Blynk Cloud Server is:<br>
<b>ws://blynk-cloud.com/websockets</b><br>
<s>or with secure SSL:<br>
<b>wss://blynk-cloud.com/websockets</b></s><br>
<span style="color:#ff0000;font-weight:bold">
* Attention: from 2021-03-16, use only the non-SSL connection, the certificate on the server has expired
* Warning: as of January 1, 2023 it is no longer possible to use the Blynk Cloud Server (blynk-cloud.com)
</span><br>
</div>
<div class="form-tips">
Expand Down Expand Up @@ -194,7 +190,7 @@
</div>
<div class="form-row">
<label for="node-config-input-multi_cmd"><i class="fa fa-cog"></i> <span>Protocol</span></label>
<input type="checkbox" id="node-config-input-multi_cmd" value="all" style="width: auto; vertical-align: top;"> Use multiple command <span style="font-size: 80%;">(blynk cloud or local server >= 0.34.0)</span></input>
<input type="checkbox" id="node-config-input-multi_cmd" value="all" style="width: auto; vertical-align: top;"> Use multiple command <span style="font-size: 80%;">(local server >= 0.34.0)</span></input>
</div>
</div>
</div>
Expand All @@ -203,12 +199,9 @@
<script type="text/x-red" data-help-name="blynk-ws-client">
<p>This configuration node connects to a Blynk Server via WebSocket on the specified URL.
<br /><br />
To connect to Blynk Cloud Server use this url:<br>
Websocket: <b>ws://blynk-cloud.com/websockets</b><br>
<s>Websocket SSL: <b>wss://blynk-cloud.com/websockets</b></s><br>
<span style="color:#ff0000;font-weight:bold">
* Attention: from 2021-03-16, use only the non-SSL connection, the certificate on the server has expired
</span><br><br>
<span style="color:#ff0000;font-weight:bold">
* Warning: as of January 1, 2023 it is no longer possible to use the Blynk Cloud Server (blynk-cloud.com)
</span><br><br>
To connect to Local Server use this url:<br>
Websocket: <b>ws://&lt;your-local-ip&gt;:8080/websockets</b><br>
Websocket SSL: <b>wss://&lt;your-local-ip&gt;:9443/websockets</b><br><br>
Expand All @@ -218,7 +211,7 @@

<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#getting-started-getting-started-with-the-blynk-app-4-auth-token">Auth Token</a>
<a href="https://gablau.dev/blynk-legacy-docs/#getting-started-getting-started-with-the-blynk-app-4-auth-token">Auth Token</a>
<p>
</script>

11 changes: 7 additions & 4 deletions nodes/blynk-ws-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ const compVer = require('compare-versions');


// blynk util
const blynkUtil = require('../libs/blynk-util.js');
const blynkUtil = require('../libs/blynk-util');

// blynk lib
const blynkLib = require('../libs/blynk-lib.js');
const blynkLib = require('../libs/blynk-lib');

module.exports = (RED) => {
const LIBRARY_VERSION = '1.0.6'; // node-red lib version
const LIBRARY_DATE = '2021-09-06'; // node-red lib date
const LIBRARY_VERSION = '1.0.8'; // node-red lib version
const LIBRARY_DATE = '2023-01-09'; // node-red lib date

const RECONNECT_TIMEOUT_SECONDS = 5; // number of seconds for reconnection when disconnected or socket error

Expand Down Expand Up @@ -118,6 +118,9 @@ module.exports = (RED) => {
node.logged = false;
let wsArgs = {};
let wsLogSecure = '';
if (node.path.indexOf('blynk-cloud.com')!== -1) {
node.warn(`Warning: You are trying to connect to the Blynk Cloud Server (blynk-cloud.com) which has not been shut down permanently as of year end 2022`);
}
if (node.path.startsWith('wss://')) {
wsArgs = {
rejectUnauthorized: false,
Expand Down
2 changes: 1 addition & 1 deletion nodes/blynk-ws-image-gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
<!--
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#blynk-main-operations-change-widget-properties">Change widget properties</a>
<a href="https://gablau.dev/blynk-legacy-docs/#blynk-main-operations-change-widget-properties">Change widget properties</a>
<p>
-->

Expand Down
2 changes: 1 addition & 1 deletion nodes/blynk-ws-image-gallery.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const blynkUtil = require('../libs/blynk-util.js');
const blynkUtil = require('../libs/blynk-util');

module.exports = (RED) => {
function BlynkImageGalleryNode(n) {
Expand Down
2 changes: 1 addition & 1 deletion nodes/blynk-ws-in-read.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@
<p><code>msg.payload</code> will contain the virtual pin number that triggered the read event.</p>
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#blynk-main-operations-get-data-from-hardware-perform-requests-by-widget">Read</a>
<a href="https://gablau.dev/blynk-legacy-docs/#blynk-main-operations-get-data-from-hardware-perform-requests-by-widget">Read</a>
<p>
</script>
2 changes: 1 addition & 1 deletion nodes/blynk-ws-in-write.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ <h3>Details</h3>

<h3>References</h3>
<ul>
<li>Official documentation - <a href="http://docs.blynk.cc/#blynk-main-operations-send-data-from-app-to-hardware">Write</a></li>
<li>Official documentation - <a href="https://gablau.dev/blynk-legacy-docs/#blynk-main-operations-send-data-from-app-to-hardware">Write</a></li>
<li><a href="https://github.com/gablau/node-red-contrib-blynk-ws">GitHub</a> - the nodes github repository</li>
<li><a href="https://www.npmjs.com/package/node-red-contrib-blynk-ws">NPM</a> - the nodes on package manager</li>
</ul>
Expand Down
2 changes: 1 addition & 1 deletion nodes/blynk-ws-out-bridge.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,6 @@
&nbsp;&nbsp; Digital, sends a digitalWrite command to the specified pin</p>
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#widgets-other-bridge">Bridge</a>
<a href="https://gablau.dev/blynk-legacy-docs/#widgets-other-bridge">Bridge</a>
<p>
</script>
2 changes: 1 addition & 1 deletion nodes/blynk-ws-out-email.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@
</p>
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#widgets-notifications-email">Email</a>
<a href="https://gablau.dev/blynk-legacy-docs/#widgets-notifications-email">Email</a>
<p>
</script>
2 changes: 1 addition & 1 deletion nodes/blynk-ws-out-lcd.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,6 @@
</p>
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#widgets-displays-lcd">LCD</a>
<a href="https://gablau.dev/blynk-legacy-docs/#widgets-displays-lcd">LCD</a>
<p>
</script>
2 changes: 1 addition & 1 deletion nodes/blynk-ws-out-notify.html
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,6 @@
<p>You can also use <code>{DEVICE_NAME}</code> placeholder for device name, that will be replaced by your device name on the server side.</p>
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#widgets-notifications-push-notifications">Push Notifications</a>
<a href="https://gablau.dev/blynk-legacy-docs/#widgets-notifications-push-notifications">Push Notifications</a>
<p>
</script>
2 changes: 1 addition & 1 deletion nodes/blynk-ws-out-set-property.html
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,6 @@ <h2>ALL WIDGETS</h2>
<br>
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#blynk-main-operations-change-widget-properties">Change widget properties</a>
<a href="https://gablau.dev/blynk-legacy-docs/#blynk-main-operations-change-widget-properties">Change widget properties</a>
<p>
</script>
6 changes: 3 additions & 3 deletions nodes/blynk-ws-out-sync.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@
&nbsp;&nbsp; syncAll, request the sync of all pins</p>
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#blynk-main-operations-state-syncing-for-hardware">State syncing</a>
<a href="http://docs.blynk.cc/#blynk-firmware-virtual-pins-control-blynksyncall">Blynk.syncAll()</a>
<a href="http://docs.blynk.cc/#blynk-firmware-virtual-pins-control-blynksyncvirtualvpin">Blynk.syncVirtual()</a>
<a href="https://gablau.dev/blynk-legacy-docs/#blynk-main-operations-state-syncing-for-hardware">State syncing</a>
<a href="https://gablau.dev/blynk-legacy-docs/#blynk-firmware-blynktimer-blynksyncall">Blynk.syncAll()</a>
<a href="https://gablau.dev/blynk-legacy-docs/#blynk-firmware-blynktimer-blynksyncvirtualvpin">Blynk.syncVirtual()</a>
<p>
</script>
2 changes: 1 addition & 1 deletion nodes/blynk-ws-out-table.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
</p>
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#widgets-time-input-table">Table</a>
<a href="https://gablau.dev/blynk-legacy-docs/#widgets-interface-table">Table</a>
<p>

</script>
2 changes: 1 addition & 1 deletion nodes/blynk-ws-out-write.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,6 @@
&nbsp;&nbsp; Dynamic, the pin number is passed through <code> msg.pin</code> property</p>
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#blynk-main-operations-get-data-from-hardware-pushing-data-from-hardware">Push data</a>
<a href="https://gablau.dev/blynk-legacy-docs/#blynk-main-operations-get-data-from-hardware-pushing-data-from-hardware">Push data</a>
<p>
</script>
2 changes: 1 addition & 1 deletion nodes/blynk-ws-style-btn.html
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ <h2>Styled Button Property</h2>
<!--
<p class="form-tips">
Official documentation:
<a href="http://docs.blynk.cc/#blynk-main-operations-change-widget-properties">Change widget properties</a>
<a href="https://gablau.dev/blynk-legacy-docs/#blynk-main-operations-change-widget-properties">Change widget properties</a>
<p>
-->
</script>
Loading

0 comments on commit e114299

Please sign in to comment.