[support] Spants - NodeRed, MQTT, Dashing, couchDB


Recommended Posts

On 3/12/2018 at 2:35 PM, Stupifier said:

Does anyone here know how to update node.js version in the Node-Red Docker Container?

 

docker exec -it NodeRed-OfficialDocker /bin/bash

node -V


The command above shows I'm on v6.13.0 of node.js.......but I need at least v8 to use a specific module I want

Update: Wow...was that easy. I just added "v8" as a tag to the Repository field on the Template......and hit apply. Super easy. So now my repository reads "nodered/node-red-docker:v8"

 

Was coming to ask this specific question.  I'm running into issues with the Home Assistant flows not working because they require v8 but the latest docker is using Node V6.  I went into the docker itself and ran the command to download the older Home Assistant flows, but I don't feel comfortable leaving it that way.  I'll be giving this a try later though.  Thanks for the information!

Link to comment
6 minutes ago, mlounsbury said:

 

Was coming to ask this specific question.  I'm running into issues with the Home Assistant flows not working because they require v8 but the latest docker is using Node V6.  I went into the docker itself and ran the command to download the older Home Assistant flows, but I don't feel comfortable leaving it that way.  I'll be giving this a try later though.  Thanks for the information!

 

Ya....just go into the Node-Red Docker template and change the repository as I said above and hit apply.......That's all I had to do. Love it

  • Like 2
Link to comment
  • 1 month later...

Hi,

 

I was able to get the Node-Red docker running with my Home Assistant docker.

 

But I am unsure about securing Node Red with HTTPS. Are there certificates included? If I just uncommend "fs" and the "https" options I am getting an certificate error and node red is not starting.

 

Br,

Johannes

Link to comment
24 minutes ago, ebnerjoh said:

Hi,

 

I was able to get the Node-Red docker running with my Home Assistant docker.

 

But I am unsure about securing Node Red with HTTPS. Are there certificates included? If I just uncommend "fs" and the "https" options I am getting an certificate error and node red is not starting.

 

Br,

Johannes

take a look here: https://www.hardill.me.uk/wordpress/2015/05/11/securing-node-red/

Link to comment
22 hours ago, spants said:

 

I created the pem and cert-file in the /data directory (which is in my case /mnt/user/apdata/nodered).

 

But I am getting this error, after enabling "fs" and "https".

 

> [email protected] start /usr/src/node-red
> node $NODE_OPTIONS node_modules/node-red/red.js -v $FLOWS "--userDir" "/data"

Error loading settings file: /data/settings.js

{ Error: ENOENT: no such file or directory, open 'privkey.pem'

at Object.fs.openSync (fs.js:646:18)
at Object.fs.readFileSync (fs.js:551:33)
at Object.<anonymous> (/data/settings.js:141:17)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)
at Module.require (module.js:596:17)
at require (internal/module.js:11:18)
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'privkey.pem' }

The filename is correct...

 

Br,

Johannes

Link to comment
21 hours ago, ebnerjoh said:

I tried now to create the keys within the docker, still the same result.

 

Do I need a special program that Node Red is able to read the certificate? I need to uncoment this "fs" setting, maybe it is this?

 

Br,

Johannes

 

The docker is the official standard one so it should work. I don't use https as it just on an internal home network .

Wondering if your paths are correct for the certs and/or permissions?

 

I will try and have a look over the weekend ....

Link to comment
  • 2 weeks later...

Hi guys,

 

I would love to be able to use this - https://flows.nodered.org/node/node-red-contrib-homekit-bridged so I can make my stuff availavlle to apple home.

 

Docker installs ok but then home app on apple never finds it I am running the docker with :V8 at the end to get latest node js

 

I wonder if the docker needs these added to it?

 

 

Prerequisites

These nodes are based on the extremely awesome HAP-NodeJS -Project which uses an implementation of mdns to provide Bonjour / Avahi capability. Please refer to the HAP-NodeJS Wiki and to mdns for install instructions, if you get stuck on the following.

Install

For Debian / Ubuntu you need to install the following in order to support Bonjour / Avahi

    sudo apt-get install libavahi-compat-libdnssd-dev

Then run the following command in your Node-RED user directory - typically ~/.node-red

    npm install node-red-contrib-homekit-bridged

 

Thanks for any advice

 

Stuart

Link to comment
1 hour ago, schford said:

Hi guys,

 

I would love to be able to use this - https://flows.nodered.org/node/node-red-contrib-homekit-bridged so I can make my stuff availavlle to apple home.

 

Docker installs ok but then home app on apple never finds it I am running the docker with :V8 at the end to get latest node js

 

I wonder if the docker needs these added to it?

 

 

Prerequisites

These nodes are based on the extremely awesome HAP-NodeJS -Project which uses an implementation of mdns to provide Bonjour / Avahi capability. Please refer to the HAP-NodeJS Wiki and to mdns for install instructions, if you get stuck on the following.

Install

For Debian / Ubuntu you need to install the following in order to support Bonjour / Avahi


    sudo apt-get install libavahi-compat-libdnssd-dev

Then run the following command in your Node-RED user directory - typically ~/.node-red


    npm install node-red-contrib-homekit-bridged

 

Thanks for any advice

 

Stuart

Is nodered bridged? Try host network mode

Link to comment

This may be a super simple one but I just started playing with Node-Red and when utilizing the node-red-node-ping node, I can't seem to actually have it ping anything.  No matter what I try (www.google.com, an ip on the network, etc), I receive a 'false' output.  

 

I read somewhere that ping may be a root only command.  

 

Any ideas?

Link to comment
3 hours ago, irandumi said:

This may be a super simple one but I just started playing with Node-Red and when utilizing the node-red-node-ping node, I can't seem to actually have it ping anything.  No matter what I try (www.google.com, an ip on the network, etc), I receive a 'false' output.  

 

I read somewhere that ping may be a root only command.  

 

Any ideas?

 

I used the "manage pallete" option in node red to install node-red-node-ping. Works well.

Edited by spants
Link to comment
1 hour ago, spants said:

 

Ok, have you tried the Console command on the nodered icon to install Bonjour and then node red "manage pallete" option to install homekit?

IF I try from command console I get

 

$ apt-get install libavahi-compat-libdnssd-dev
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?
$ ^C
$

 

I have installed the via manage pallet no problems but homekit doesn't find anything and when I try a bonjour browser on pc as well it also sees nothing ?

 

Thanks for suggestions.

 

Edited by schford
Link to comment
14 hours ago, spants said:

 

I used the "manage pallete" option in node red to install node-red-node-ping. Works well.

 

That's what I'm using.  I then have a a ping node with target set to an internal IP (192.168.0.XXX), Ping = 5, Name = PING.  I then have a msg.payload debug module attached to it and deployed.  When reviewing the debug tab, it always says false every time it pings (every 5 seconds).   How strange.  It seems so straightforward....

Link to comment
  • 2 months later...
On 6/13/2018 at 5:21 AM, ebnerjoh said:

I tried now to create the keys within the docker, still the same result.

 

Do I need a special program that Node Red is able to read the certificate? I need to uncoment this "fs" setting, maybe it is this?

 

Br,

Johannes

I just struggled through this myself earlier today.  I used the guide here: http://www.steves-internet-guide.com/securing-node-red-ssl/

 

I created the certs in the same directory as the settings.js file and used the paths listed below in the config.

 

    key: fs.readFileSync('/data/node-key.pem'),
    cert: fs.readFileSync('/data/node-cert.pem')

 

I would recommend un-commenting  the "requireHttps: true" line in the settings file and make sure you add a comma after it.

 

Also don't forget to un-comment the var fs = require("fs"); line near the top of the config.

 

Best of luck!

HC

 

 

Link to comment

I installed MQTT docker container on my unRAID server but it's failed to start successfully. I noticed Docker image was pulled successfully and the container was created.  I didn't change any default settings for the template. I made sure no other docker containers using these ports (1883, 9001)

 

How do I resolve this error?

 

Command:
root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='MQTT' --net='bridge' -e TZ="America/Los_Angeles" -e HOST_OS="unRAID" -p '1883:1883/tcp' -p '9001:9001/tcp' -v '/mnt/user/appdata/MQTT':'/config':'rw' 'spants/mqtt' 
fc6bddb7beff82df28c84b2444d6a406164a3de3005b512401e4371950de4c5d
/usr/bin/docker: Error response from daemon: driver failed programming external connectivity on endpoint MQTT (07b5d4fff7293d9cc2de96ec8c1bf4d9f3f9cc26ddc822b523ebc6ceaad25288): Error starting userland proxy: listen tcp 0.0.0.0:1883: bind: address already in use.

The command failed.

 

 

TIA

Screen Shot 2018-09-14 at 10.51.37 PM.png

Edited by stlrox
Addl Info
Link to comment
On 9/15/2018 at 4:57 AM, stlrox said:

I installed MQTT docker container on my unRAID server but it's failed to start successfully. I noticed Docker image was pulled successfully and the container was created.  I didn't change any default settings for the template. I made sure no other docker containers using these ports (1883, 9001)

 

How do I resolve this error?

 


Command:
root@localhost:# /usr/local/emhttp/plugins/dynamix.docker.manager/scripts/docker run -d --name='MQTT' --net='bridge' -e TZ="America/Los_Angeles" -e HOST_OS="unRAID" -p '1883:1883/tcp' -p '9001:9001/tcp' -v '/mnt/user/appdata/MQTT':'/config':'rw' 'spants/mqtt' 
fc6bddb7beff82df28c84b2444d6a406164a3de3005b512401e4371950de4c5d
/usr/bin/docker: Error response from daemon: driver failed programming external connectivity on endpoint MQTT (07b5d4fff7293d9cc2de96ec8c1bf4d9f3f9cc26ddc822b523ebc6ceaad25288): Error starting userland proxy: listen tcp 0.0.0.0:1883: bind: address already in use.

The command failed.

 

 

TIA

Screen Shot 2018-09-14 at 10.51.37 PM.png

 

 

Do you have anything else using port 1883?

Link to comment


@spants Finally, MQTT container worked but Home Assistant couldn't able to subscribe/publish for all topics. I am not sure if there are any 'write' settings needed to be changed for MQTT container. I can manually publish a topic from Home Assistant and that shows up in MQTT.

 

I can connect using MQTTFx client tool and from there I can subscribe and publish topics. But I couldn't figure out why Home Assistant couldn't publish topics. There were no error messages in Home Assistant log file.

 

EDIT: Please ignore the following. I did this inside docker container which will be rewritten when I restart the container. I used your instructions (passwords.README) to create user and password and passwords.mqtt file was written.

 

I created a password for MQTT user.

 

/etc/mosquitto # mosquitto_passwd -c /etc/mosquitto/pwfile hauser
Password:
Reenter password:
/etc/mosquitto #

 

Here are the contents mosquitto.conf (/etc/mosquitto) which I used in my previous configuration on Raspberry Pi.

# Place your local configuration in /etc/mosquitto/conf.d/
#
# A full description of the configuration file is at
# /usr/share/doc/mosquitto/examples/mosquitto.conf.example

pid_file /var/run/mosquitto.pid

persistence true
persistence_location /var/lib/mosquitto/

log_dest file /var/log/mosquitto/mosquitto.log

allow_anonymous false
password_file /etc/mosquitto/pwfile
listener 1883


MQTT log file contents:  (192.168.86.226 on port 1883 -> Home Assistant) I expect lot of topics but very few were shown.

 

1537387495: mosquitto version 1.4.10 (build date 2017-04-06 15:52:09+0000) starting

1537387495: Config loaded from /config/mosquitto.conf.
1537387495: Opening ipv4 listen socket on port 1883.
1537387495: Opening ipv6 listen socket on port 1883.
1537387495: Opening websockets listen socket on port 9001.
1537387657: New connection from 192.168.86.226 on port 1883.
1537387657: New client connected from 192.168.86.226 as home-assistant-1 (c1, k60, u'hauser').
1537387657: Sending CONNACK to home-assistant-1 (0, 0)
1537387660: Received SUBSCRIBE from home-assistant-1
1537387660: home/garage-camera/motion (QoS 0)
1537387660: home-assistant-1 0 home/garage-camera/motion
1537387660: Sending SUBACK to home-assistant-1
1537387660: Received SUBSCRIBE from home-assistant-1
1537387660: /usps/packages (QoS 0)
1537387660: home-assistant-1 0 /usps/packages
1537387660: Sending SUBACK to home-assistant-1
1537387660: Received SUBSCRIBE from home-assistant-1
1537387660: home/garage-camera/brightness (QoS 0)
1537387660: home-assistant-1 0 home/garage-camera/brightness
1537387660: Sending SUBACK to home-assistant-1
1537387660: Received SUBSCRIBE from home-assistant-1
1537387660: home/garage-camera (QoS 0)
1537387660: home-assistant-1 0 home/garage-camera
1537387660: Sending SUBACK to home-assistant-1
1537387660: Received SUBSCRIBE from home-assistant-1

Edited by stlrox
Addl info
Link to comment

Somehow, I'm not sure exactly how......my NodeRed container got hit with a Crypto Miner today. Anyone else experience this? Just wonder if it is specific to ME or is it actually the DockerHub/CA update that got contaminated. Surprisingly, they actually added a bunch of Flows like this into my Node-Red. Found more about this specific miner from this digitalocean thread.

 

repository "nodered/node-red-docker:v8"

https://www.digitalocean.com/community/questions/what-is-this-sustes-in-my-process-in-my-cpu-stats


WHVyVYc.png


 

 

Edited by Stupifier
Link to comment
On 9/23/2018 at 2:06 AM, Stupifier said:

Somehow, I'm not sure exactly how......my NodeRed container got hit with a Crypto Miner today. Anyone else experience this? Just wonder if it is specific to ME or is it actually the DockerHub/CA update that got contaminated. Surprisingly, they actually added a bunch of Flows like this into my Node-Red. Found more about this specific miner from this digitalocean thread.

 

repository "nodered/node-red-docker:v8"

https://www.digitalocean.com/community/questions/what-is-this-sustes-in-my-process-in-my-cpu-stats


WHVyVYc.png


 

 

 

I use the same repo without issues... Is your nodeRed port open to the world?. 

 

edit: Add more info from the entry on the NodeRed mailing list that Stupifier created:

https://discourse.nodered.org/t/crypto-miner-abuse-malware/3397/3

.... I think that he had left the port 1880 open on his firewall: Be careful out there!

Edited by spants
updated info
  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.