Emoncms on vserver and node-red

Hello,

I have tow raspberry sending me data to my vps with ubuntu 16.04.

I want to send an alert if one of the values is too high.

I have found that I can do this with note red and I wanted to install it.

Everytime I tried I got the following error:

var/www/html/emoncms/Modules # npm install
/var/www/html/emoncms/Modules
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open ‘/var/www/html/emoncms/Modules/package.json’
npm WARN Modules No description
npm WARN Modules No repository field.
npm WARN Modules No README data
npm WARN Modules No license field.

Do you have an Idea?

Yours, Alex

You have to run the command from within the folder .node-red

It’s a node-red node, not emoncms.

A better solution would be to install the emoncms node by using the node-red pallette manager.

Paul

Hello,

I have tried to “jump” into the folder /var/www/html/emoncms/Modules # cd ~/.node-red
-bash: cd: /root/.node-red: No such file or directory

How can I install with the pallette manager

Do you have node-red installed?

Thank you for you answer,
I have tried
with
npm install node-red-node-emoncms
The program ‘npm’ is currently not installed. You can install it by typing:
apt install npm

Then I installed nmp

after I tried again
npm install node-red-node-emoncms
/var/www/html/emoncms/Modules
└── [email protected]

npm WARN enoent ENOENT: no such file or directory, open ‘/var/www/html/emoncms/Modules/package.json’
npm WARN Modules No description
npm WARN Modules No repository field.
npm WARN Modules No README data
npm WARN Modules No license field.

I think its not installed

Yes, but do you have node-red installed?
I’m not talking about about the node-red-node-emoncms node, I’m talking about the software package - node-red.
https://nodered.org/

Hello,
Sorry, I didn’t understand that they are two different things. :slight_smile:

I installed, but got this error
/usr/local/lib/node_modules/node-red/node_modules/bcrypt/node_modules/node-pre-gyp/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require(‘hoek’);
^^^^^
node-pre-gyp ERR! Tried to download(undefined): https://github.com/kelektiv/node.bcrypt.js/releases/download/v1.0.3/bcrypt_lib-v1.0.3-node-v11-linux-arm.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v11 ABI) (falling back to source compile with node-gyp)

/usr/local/lib/node_modules/node-gyp/node_modules/request/node_modules/hawk/node_modules/boom/lib/index.js:5
const Hoek = require(‘hoek’);
^^^^^
gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack SyntaxError: Use of const in strict mode.
gyp ERR! stack at Module._compile (module.js:439:25)
gyp ERR! stack at Object.Module._extensions…js (module.js:474:10)
gyp ERR! stack at Module.load (module.js:356:32)
gyp ERR! stack at Function.Module._load (module.js:312:12)
gyp ERR! stack at Module.require (module.js:364:17)
gyp ERR! stack at require (module.js:380:17)
gyp ERR! stack at Object. (/usr/local/lib/node_modules/node-gyp/node_modules/request/node_modules/hawk/lib/index.js:5:33)
gyp ERR! stack at Module._compile (module.js:456:26)
gyp ERR! stack at Object.Module._extensions…js (module.js:474:10)
gyp ERR! stack at Module.load (module.js:356:32)
gyp ERR! System Linux 4.9.35-v7+
gyp ERR! command “/usr/bin/nodejs” “/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js” “configure” “–fallback-to-build” “–module=/usr/local/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/bcrypt_lib.node” “–module_name=bcrypt_lib” “–module_path=/usr/local/lib/node_modules/node-red/node_modules/bcrypt/lib/binding”
gyp ERR! cwd /usr/local/lib/node_modules/node-red/node_modules/bcrypt
gyp ERR! node -v v0.10.29
gyp ERR! node-gyp -v v3.6.2
gyp ERR! This is a bug in node-gyp.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! https://github.com/nodejs/node-gyp/issues
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute ‘/usr/bin/nodejs /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/local/lib/node_modules/node-red/node_modules/bcrypt/lib/binding’ (7)
node-pre-gyp ERR! stack at ChildProcess. (/usr/local/lib/node_modules/node-red/node_modules/bcrypt/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack at ChildProcess.emit (events.js:98:17)
node-pre-gyp ERR! stack at maybeClose (child_process.js:755:16)
node-pre-gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:822:5)
node-pre-gyp ERR! System Linux 4.9.35-v7+
node-pre-gyp ERR! command “node” “/usr/local/lib/node_modules/node-red/node_modules/bcrypt/node_modules/.bin/node-pre-gyp” “install” “–fallback-to-build”
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/node-red/node_modules/bcrypt
node-pre-gyp ERR! node -v v0.10.29
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute ‘/usr/bin/nodejs /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/node-red/node_modules/bcrypt/lib/binding/bcrypt_lib.node --module_name=bcrypt_lib --module_path=/usr/local/lib/node_modules/node-red/node_modules/bcrypt/lib/binding’ (7)
npm WARN This failure might be due to the use of legacy binary “node”
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]

Ok, my node is too old. v0.10.29, I’ll try a newer one.

That’s a really old version. If you go to https://nodered.org/ and read how to update it.
Once updated, start node-red, and select ‘Manage Pallette’ from the node-red menu (hamburger top right).

Thank you so much. Now its working.

Can you help with another thing?

I have tried to work local on the raspi with node red to get the data of the emoncms and it wont work.
How can I get the data on my vps?

I send it via the api key to the server and get the data, but how can i fetch this to set my Mail alert?

You need to provide much more detail, and explain what you have already tried.
Is emoncms running on both your raspberry pi & your VPS?
Where is node-red installed & running?

Paul

Hello and thank you

I am using an Raspberry local with emonpi sd image

I send via
[[emoncmsorg]]
Type = EmonHubEmoncmsHTTPInterfacer
[[[init_settings]]]
[[[runtimesettings]]]
subchannels = ToEmonCMS,
#url = http://localhost/emoncms #uncomment to save on local pi
apikey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
senddata = 1 # Enable sending data to Emoncms.org
sendstatus = 1 # Enable sending WAN IP to Emoncms.org MyIP > Emoncms - myip list
sendinterval= 30 # Bulk send interval to Emoncms.org in seconds

to my VPS and get the values

On the VPS I have now installed emoncms and node-red

I want to use node-red to alert via Mail if one of the note values is to high

I have tried to connect in the Node red via
emoncms and the API key to get the vale of the feed with id 1

But I don’t get anything.

Is there a better way to get on my vps where I have allready the data in emoncms to get it into node-red?