knolleary

knolleary

OSS Developer - IoT Tinkerer - Creator of @node-red - CTO @FlowForge

Member Since 12 years ago

FlowForge Inc.,

Experience Points
899
follower
Lessons Completed
30
follow
Lessons Completed
42
stars
Best Reply Awards
82
repos

1389 contributions in the last year

Pinned
⚡ Low-code programming for event-driven applications
⚡ A client library for the Arduino Ethernet Shield that provides support for MQTT.
⚡ This workshop takes you through how to setup a Node-RED environment suitable for creating cloud-native applications. It was first delivered as a part of NodeConfEU 2019
⚡ A Todo-Backend implementation using Node-RED and CouchDB. A sample application for https://github.com/knolleary/node-red-in-production-workshop
Activity
Oct
23
19 hours ago
Activity icon
issue

knolleary issue comment node-red/node-red

knolleary
knolleary

Dynamyc MQTT subscription not returning JSON object

Current Behavior

MQTT IN node is returning string while configured for returning parsed JSON object. This is only happening using the new functionality of Dynamic subscription. Same node configured for single topic returns a json object for the same topic subscription

Attached there's a demonstration flow.

image

Expected Behavior

Send output as json

Steps To Reproduce

No response

Example flow

[{"id":"19980b40dbba5f60","type":"tab","label":"Flow 3","disabled":false,"info":"","env":[]},{"id":"9c2d482981552296","type":"inject","z":"19980b40dbba5f60","name":"json","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"{\"Time\":\"2021-10-22T21:59:27\",\"Uptime\":\"22T03:28:49\",\"UptimeSec\":1913329,\"Heap\":26,\"SleepMode\":\"Dynamic\",\"Sleep\":50,\"LoadAvg\":19,\"MqttCount\":836,\"POWER1\":\"OFF\",\"POWER2\":\"OFF\",\"Wifi\":{\"AP\":1,\"SSId\":\"AL_IOT\",\"BSSId\":\"EC:08:6B:61:2D:92\",\"Channel\":5,\"RSSI\":88,\"Signal\":-56,\"LinkCount\":10,\"Downtime\":\"0T00:03:10\"}}","payloadType":"json","x":240,"y":180,"wires":[["bce0843ba8fe3ab7"]]},{"id":"bce0843ba8fe3ab7","type":"mqtt out","z":"19980b40dbba5f60","name":"test/mqtt","topic":"test/mqtt","qos":"","retain":"","respTopic":"","contentType":"","userProps":"","correl":"","expiry":"","broker":"a1214186.1acad","x":355,"y":180,"wires":[],"l":false},{"id":"e781f12745609710","type":"mqtt in","z":"19980b40dbba5f60","name":"single topic ","topic":"test/mqtt","qos":"2","datatype":"json","broker":"a1214186.1acad","nl":false,"rap":true,"rh":0,"inputs":0,"x":220,"y":240,"wires":[["c32fcdc06e609ae2"]]},{"id":"c32fcdc06e609ae2","type":"debug","z":"19980b40dbba5f60","name":"single topic","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":335,"y":240,"wires":[],"l":false},{"id":"de27b93e52196937","type":"inject","z":"19980b40dbba5f60","name":"subscription","props":[{"p":"payload"},{"p":"topic","vt":"str"},{"p":"action","v":"subscribe","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"test/mqtt","payloadType":"date","x":250,"y":120,"wires":[["ba19c00ea3a72413"]]},{"id":"ba19c00ea3a72413","type":"mqtt in","z":"19980b40dbba5f60","name":"dynamyc","topic":"","qos":"2","datatype":"json","broker":"a1214186.1acad","nl":false,"rap":true,"rh":0,"inputs":1,"x":385,"y":120,"wires":[["90b0c92a3cf92465"]],"l":false},{"id":"90b0c92a3cf92465","type":"debug","z":"19980b40dbba5f60","name":"dynamyc","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":445,"y":120,"wires":[],"l":false},{"id":"a1214186.1acad","type":"mqtt-broker","name":"domoserver","broker":"192.168.2.46","port":"1883","clientid":"nodeRed","autoConnect":true,"usetls":false,"compatmode":false,"protocolVersion":4,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]

Environment

  • Node-RED version: 2.1.1
  • Node.js version:
  • npm version:
  • Platform/OS:
  • Browser: Using last docker image
knolleary
knolleary

I felt it was more useful on balance to be able to set the return type at the top level - a default behaviour to apply to all subs.

But I forgot to follow through whilst sorting everything else out.

I don't recall seeing what msg property would be used to specify the return type... but it want something I went looking for.

I suggest:

  • leave the UI as is.
  • ensure the selected choice is applied properly, unless the msg sets a different choice.

I don't think it's necessary to have a "set by msg" option - I think it's far more useful to be able to set the default that can be overridden per subscription if it's really needed. And a user isn't likely to accidentally override it, so the usual concerns about msg overriding node don't apply in the usual way.

Oct
22
1 day ago
Activity icon
issue

knolleary issue comment node-red/node-red-dev-cli

knolleary
knolleary

Dependency on npm-remote-ls

This package is over 5 years old and also has a dependency on the deprecated request package. Need to review if we can remove it and just make the API requests directly to npm using axios.

knolleary
knolleary

This repo uses axios rather than got as it's http request library. But it also uses npm-remote-ls which uses request under the covers. Hence this issue to investigate removing the dependency on npm-remote-ls.

Activity icon
issue

knolleary issue node-red/node-red

knolleary
knolleary

trigger node generates java script error: "Cannot read properties of undefined (reading 'length')"

Current Behavior

On a "trigger node" I get an javascript error when trying to chose the "Send -> nothing" option. This is on a "clean" instance, nothing added. Fresh install so to speak.

node-red-trigger-error

vendor.js:4 JQMIGRATE: Migrate is installed, version 3.3.0
DevTools failed to load source map: Could not load content for http://127.0.0.1:1880/vendor/purify.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
red.min.js:formatted:1073 Node-RED: 2.1.0
red.min.js:formatted:1074 Versions
red.min.js:formatted:797 Projects disabled
red.min.js:formatted:8596 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at c (red.min.js:formatted:8596)
    at t.<computed>.<computed>.type (red.min.js:formatted:8936)
    at t.<computed>.<computed>.type (vendor.js:10)
    at red.min.js:formatted:8885
    at HTMLAnchorElement.<anonymous> (red.min.js:formatted:8786)
    at HTMLAnchorElement.dispatch (vendor.js:2)
    at HTMLAnchorElement.v.handle (vendor.js:2)
c @ red.min.js:formatted:8596
type @ red.min.js:formatted:8936
(anonymous) @ vendor.js:10
(anonymous) @ red.min.js:formatted:8885
(anonymous) @ red.min.js:formatted:8786
dispatch @ vendor.js:2
v.handle @ vendor.js:2

Expected Behavior

The selected option to be chosen without any javascript errors.

Steps To Reproduce

Install node-red via "npm -g install node-red".

System info: MacBook Pro macOS Big Sur 11.6

Nodejs v14.18.1 npm v6.14.15

Node-RED version: v2.1.0

Example flow

[
    {
        "id": "add559aa3b6bd9ad",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "aaedc512757f79d8",
        "type": "trigger",
        "z": "add559aa3b6bd9ad",
        "name": "",
        "op1": "1",
        "op2": "0",
        "op1type": "val",
        "op2type": "val",
        "duration": "250",
        "extend": "false",
        "overrideDelay": "false",
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 210,
        "y": 180,
        "wires": [
            []
        ]
    }
]

Environment

  • Node-RED version: 2.1.0
  • Node.js version: 14.18.1
  • npm version: 6.14.15
  • Platform/OS: macOS Big Sur 11.6
  • Browser: Google Chrome 94.0.4606.81 (Official Build) (x86_64)
Activity icon
issue

knolleary issue comment node-red/node-red

knolleary
knolleary

trigger node generates java script error: "Cannot read properties of undefined (reading 'length')"

Current Behavior

On a "trigger node" I get an javascript error when trying to chose the "Send -> nothing" option. This is on a "clean" instance, nothing added. Fresh install so to speak.

node-red-trigger-error

vendor.js:4 JQMIGRATE: Migrate is installed, version 3.3.0
DevTools failed to load source map: Could not load content for http://127.0.0.1:1880/vendor/purify.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
red.min.js:formatted:1073 Node-RED: 2.1.0
red.min.js:formatted:1074 Versions
red.min.js:formatted:797 Projects disabled
red.min.js:formatted:8596 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at c (red.min.js:formatted:8596)
    at t.<computed>.<computed>.type (red.min.js:formatted:8936)
    at t.<computed>.<computed>.type (vendor.js:10)
    at red.min.js:formatted:8885
    at HTMLAnchorElement.<anonymous> (red.min.js:formatted:8786)
    at HTMLAnchorElement.dispatch (vendor.js:2)
    at HTMLAnchorElement.v.handle (vendor.js:2)
c @ red.min.js:formatted:8596
type @ red.min.js:formatted:8936
(anonymous) @ vendor.js:10
(anonymous) @ red.min.js:formatted:8885
(anonymous) @ red.min.js:formatted:8786
dispatch @ vendor.js:2
v.handle @ vendor.js:2

Expected Behavior

The selected option to be chosen without any javascript errors.

Steps To Reproduce

Install node-red via "npm -g install node-red".

System info: MacBook Pro macOS Big Sur 11.6

Nodejs v14.18.1 npm v6.14.15

Node-RED version: v2.1.0

Example flow

[
    {
        "id": "add559aa3b6bd9ad",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "aaedc512757f79d8",
        "type": "trigger",
        "z": "add559aa3b6bd9ad",
        "name": "",
        "op1": "1",
        "op2": "0",
        "op1type": "val",
        "op2type": "val",
        "duration": "250",
        "extend": "false",
        "overrideDelay": "false",
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 210,
        "y": 180,
        "wires": [
            []
        ]
    }
]

Environment

  • Node-RED version: 2.1.0
  • Node.js version: 14.18.1
  • npm version: 6.14.15
  • Platform/OS: macOS Big Sur 11.6
  • Browser: Google Chrome 94.0.4606.81 (Official Build) (x86_64)
knolleary
knolleary

2.1.1 has been published

Activity icon
published release 2.1.1: Maintenance Release

knolleary in node-red/node-red-docker create published release 2.1.1: Maintenance Release

createdAt 1 day ago
Activity icon
created tag
createdAt 1 day ago
push

knolleary push node-red/node-red-docker

knolleary
knolleary

Merge pull request #282 from node-red/create-pull-request/patch

🚀 Update to Node-RED 2.1.1 release

commit sha: 147231c7122b954c1e3a71bc239915014bc46d39

push time in 1 day ago
pull request

knolleary pull request node-red/node-red-docker

knolleary
knolleary

🚀 Update to Node-RED 2.1.1 release

Updates the Node-RED Docker repo for the 2.1.1 release.

Once this is merged, you will need to create a new release with the tag v2.1.1.

This PR was auto-generated by a GitHub Action. Any questions, speak to @knolleary

push

knolleary push node-red/node-red.github.io

knolleary
knolleary

Add comment about specifying Node-RED Supported version

knolleary
knolleary

Merge pull request #245 from hardillb/node-red-version

Add comment about specifying Node-RED Supported version

commit sha: 634d15b666b491eab52f8545b92fb0696220356d

push time in 1 day ago
pull request

knolleary pull request node-red/node-red.github.io

knolleary
knolleary

Add comment about specifying Node-RED Supported version

Update Creating Nodes doc

push

knolleary push node-red/node-red.github.io

knolleary
knolleary

Merge pull request #246 from node-red/create-pull-request/patch

🚀 Update to Node-RED 2.1.1 release

commit sha: 262225a57ae5c5d2288a9c4c18db3c29bd4fa1fb

push time in 1 day ago
pull request

knolleary pull request node-red/node-red.github.io

knolleary
knolleary

🚀 Update to Node-RED 2.1.1 release

Updates the Node-RED Website repo for the 2.1.1 release.

This PR was auto-generated by a GitHub Action. Any questions, speak to @knolleary

Activity icon
created tag
createdAt 1 day ago
Activity icon
published release 2.1.1: Maintenance Release

knolleary in node-red/node-red create published release 2.1.1: Maintenance Release

createdAt 1 day ago
Activity icon
delete

knolleary in node-red/node-red delete branch fix-tour-guide-width

deleted time in 1 day ago
push

knolleary push node-red/node-red

knolleary
knolleary

Ensure tourGuide popover doesn't fall offscreen

Only handles the left hand edge - will need expanding to cover the other edges as needed

knolleary
knolleary

Merge pull request #3212 from node-red/fix-tour-guide-width

Ensure tourGuide popover doesn't fall offscreen

commit sha: 42a9da006e037df4712cbbb396b9e0706a0ea18d

push time in 1 day ago
pull request

knolleary pull request node-red/node-red

knolleary
knolleary

Ensure tourGuide popover doesn't fall offscreen

  • [ x] Bugfix (non-breaking change which fixes an issue)

The Welcome Tour popover can get pushed offscreen if the browser window is narrower than we expect. This pushes it back into view.

Only handles the left hand edge - will need expanding to cover the other edges as needed

pull request

knolleary pull request node-red/node-red

knolleary
knolleary

Ensure tourGuide popover doesn't fall offscreen

  • [ x] Bugfix (non-breaking change which fixes an issue)

The Welcome Tour popover can get pushed offscreen if the browser window is narrower than we expect. This pushes it back into view.

Only handles the left hand edge - will need expanding to cover the other edges as needed

Activity icon
created branch

knolleary in node-red/node-red create branch fix-tour-guide-width

createdAt 1 day ago
push

knolleary push node-red/node-red

knolleary
knolleary

Fix issue with old inject nodes that migrated topic to 'string' type

knolleary
knolleary

Merge pull request #3210 from node-red/fix-old-inject-migration

Fix issue with old inject nodes that migrated topic to 'string' type

commit sha: 6a49b5c106e98479c8ea5af046a7a9ec2f1ab745

push time in 1 day ago
pull request

knolleary pull request node-red/node-red

knolleary
knolleary

Fix issue with old inject nodes that migrated topic to 'string' type

  • Bugfix (non-breaking change which fixes an issue)

When the Inject node was updated to support a list of properties code was added to migrate the Payload/Topic properties of the node into the node's props array.

However the topic property was migrated with a type of string, not str. This meant the typedInput wasn't being initialised with a valid type.

Pre 2.1 that didn't cause a problem, but due to other changes, the TI was unhappy setting the value on an input with an invalid type.

This PR does the following:

  • fixes the Inject node to migrate to str not string
  • fixes any properties it finds with the bad value
  • fixes the TypedInput to handle setting its value whilst it has an invalid/missing type.
push

knolleary push node-red/node-red

knolleary
knolleary

Add cache-busting query params to index.mst

knolleary
knolleary

Merge pull request #3211 from node-red/cache-bust

Add cache-busting query params to index.mst

commit sha: 23e14d1b720d96ad66778c497acc93a2d0b7d948

push time in 1 day ago
pull request

knolleary pull request node-red/node-red

knolleary
knolleary

Add cache-busting query params to index.mst

  • Bugfix (non-breaking change which fixes an issue)

Adds ?v=<node-red-version> query params to index.mst. This will help ensure the browser doesn't cache old copies when loading a new version of Node-RED.

pull request

knolleary pull request node-red/node-red

knolleary
knolleary

Add cache-busting query params to index.mst

  • Bugfix (non-breaking change which fixes an issue)

Adds ?v=<node-red-version> query params to index.mst. This will help ensure the browser doesn't cache old copies when loading a new version of Node-RED.

Activity icon
created branch

knolleary in node-red/node-red create branch cache-bust

createdAt 1 day ago
pull request

knolleary pull request node-red/node-red

knolleary
knolleary

Fix issue with old inject nodes that migrated topic to 'string' type

  • Bugfix (non-breaking change which fixes an issue)

When the Inject node was updated to support a list of properties code was added to migrate the Payload/Topic properties of the node into the node's props array.

However the topic property was migrated with a type of string, not str. This meant the typedInput wasn't being initialised with a valid type.

Pre 2.1 that didn't cause a problem, but due to other changes, the TI was unhappy setting the value on an input with an invalid type.

This PR does the following:

  • fixes the Inject node to migrate to str not string
  • fixes any properties it finds with the bad value
  • fixes the TypedInput to handle setting its value whilst it has an invalid/missing type.
Activity icon
created branch

knolleary in node-red/node-red create branch fix-old-inject-migration

createdAt 1 day ago
Activity icon
issue

knolleary issue comment node-red/node-red

knolleary
knolleary

trigger node generates java script error: "Cannot read properties of undefined (reading 'length')"

Current Behavior

On a "trigger node" I get an javascript error when trying to chose the "Send -> nothing" option. This is on a "clean" instance, nothing added. Fresh install so to speak.

node-red-trigger-error

vendor.js:4 JQMIGRATE: Migrate is installed, version 3.3.0
DevTools failed to load source map: Could not load content for http://127.0.0.1:1880/vendor/purify.min.js.map: HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE
red.min.js:formatted:1073 Node-RED: 2.1.0
red.min.js:formatted:1074 Versions
red.min.js:formatted:797 Projects disabled
red.min.js:formatted:8596 Uncaught TypeError: Cannot read properties of undefined (reading 'length')
    at c (red.min.js:formatted:8596)
    at t.<computed>.<computed>.type (red.min.js:formatted:8936)
    at t.<computed>.<computed>.type (vendor.js:10)
    at red.min.js:formatted:8885
    at HTMLAnchorElement.<anonymous> (red.min.js:formatted:8786)
    at HTMLAnchorElement.dispatch (vendor.js:2)
    at HTMLAnchorElement.v.handle (vendor.js:2)
c @ red.min.js:formatted:8596
type @ red.min.js:formatted:8936
(anonymous) @ vendor.js:10
(anonymous) @ red.min.js:formatted:8885
(anonymous) @ red.min.js:formatted:8786
dispatch @ vendor.js:2
v.handle @ vendor.js:2

Expected Behavior

The selected option to be chosen without any javascript errors.

Steps To Reproduce

Install node-red via "npm -g install node-red".

System info: MacBook Pro macOS Big Sur 11.6

Nodejs v14.18.1 npm v6.14.15

Node-RED version: v2.1.0

Example flow

[
    {
        "id": "add559aa3b6bd9ad",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "aaedc512757f79d8",
        "type": "trigger",
        "z": "add559aa3b6bd9ad",
        "name": "",
        "op1": "1",
        "op2": "0",
        "op1type": "val",
        "op2type": "val",
        "duration": "250",
        "extend": "false",
        "overrideDelay": "false",
        "units": "ms",
        "reset": "",
        "bytopic": "all",
        "topic": "topic",
        "outputs": 1,
        "x": 210,
        "y": 180,
        "wires": [
            []
        ]
    }
]

Environment

  • Node-RED version: 2.1.0
  • Node.js version: 14.18.1
  • npm version: 6.14.15
  • Platform/OS: macOS Big Sur 11.6
  • Browser: Google Chrome 94.0.4606.81 (Official Build) (x86_64)
knolleary
knolleary

Already fixed by #3207

2.1.1 will be published this morning.

Previous