Giter Site home page Giter Site logo

balena-labs-projects / balena-node-red Goto Github PK

View Code? Open in Web Editor NEW
57.0 16.0 60.0 336 KB

a node-red application with balena-supervisor support, can be managed remotely via balena publicURL

License: Apache License 2.0

JavaScript 95.23% Shell 4.77%
nodered nodejs node remote-control docker containers flow nodes supervisor balena

balena-node-red's Introduction

balena-node-red

A Node-RED application with balena-supervisor flow support, can be managed remotely via balena publicURL

You can deploy this project to a new balenaCloud application in one click using the button below:

Or, you can create an application in your balenaCloud dashboard and balena push this code to it the traditional way.

Configure via environment variables

Variable Name Default Description
PORT 80 the port that exposes the Node-RED UI
USERNAME balena the Node-RED admin username
PASSWORD balena the Node-RED admin password
ENCRIPTION_KEY balena the encription key used to store your credentials files

You must set the USERNAME and PASSWORD environment variables to be able to save or run programs in Node-RED.
More information about using and setting environment variables can be found in the balena docs.

License

Copyright 2016 balena Ltd.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

balena-node-red's People

Contributors

balena-ci avatar bucknalla avatar chrisys avatar curcuz avatar flowzone-app[bot] avatar hedss avatar iamsolankiamit avatar imrehg avatar juanfridano avatar lucianbuzzo avatar mbrukman avatar mpous avatar nucleardreamer avatar phil-d-wilson avatar pranavpeshwe avatar sradevski avatar tristancp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

balena-node-red's Issues

Unable to login on new alpine Node-red

I've added USERNAME and PASSWORD in "DEVICE ENVIRONMENT VARIABLES", encoding my password with "node-red-admin hash-pw" since brcyptjs is not available, but I can't login ("login failed").

What can I do to debug this ?

Here are my USERNAME and encoded PASSWORD :

USERNAME : admin
PASSWORD : $2a$08$p7SNNZKTCvepTYQRxzwG0O5cVpWgoiILViIaFd7XW7FbWVcGacqMu (hash for "linc123" without quotes)

I've try to restart app and even reboot device but with no success.

I had no problem with your Node-red on debian image.

Raspberry PI 4 is not starting when using the image

I have tried to use this image in several raspberry 4 devices and it seems that is not booting as expected so I can not see my device in my relative fleet.

How to reproduce

  • Go in that page and create a new fleet by clicking in the button
  • Add a device in the newly created fleet (choose raspberry pi 4 as the device of preference)
  • Use etcher to boot the SD card with the image that I have downloaded
  • Put the image in the raspberry pi 4

Expected behavior

To see the device in my fleet after some seconds and be able to use Node Red when I enable the public URL.

Actual behavior

Once it is powered on, both green and red light of the raspberry pi stays on. I don't see the device in my fleets or I see anything when I enter the HDMI. I have tried the same process to different devices.

Notes

Looking at the code I think that the base image should be referencing the version 4 but I have not tried to change that yet, neither I am sure that this is the cause of the problem.

Error running on IOT2000 (beta)

Hi,
I am running resinOS 2.12.7 on a Siemens IOT2000.
I am facing an error after downloading the image to the IOT2000:
main /usr/src/app/start.sh: line 12: 45 Illegal instruction (core dumped) node-red --settings /usr/src/app/settings.js

Do you know why this error occurs?

node-red env variables in development mode

Hi!

How can I define USERNAME and PASSWORD env variables when developing in local mode? I tried to add them to docker file without success

ENV PASSWORD="YYYY" \
        USERNAME="XXX"

support node-red-node-pi-gpiod

Currently there are 2 different nodes to interface with the raspberry pi hardware (GPIO pins):

This issue is raised to support the 2nd node (=node-red-node-pi_gpiod) to interface with the raspberry pi hardware. This node can easily be installed via the node-red editor (via the manage palette menu) but in order to use this node the daemon pigpiod must be running.

So this issue is about how to get the daemon pigpiod running.

2 Warnings logged related to node-red-contrib-balena

I have just installed this application on my raspberry pi.
The log file showed the following 2 warnings:

03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [warn] [node-red-contrib-balena/depDevices] Error: /usr/local/lib/node_modules/node-red-contrib-balena/depDevices/depDevices.html does not exist
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [warn] [node-red-contrib-balena/depApps] Error: /usr/local/lib/node_modules/node-red-contrib-balena/depApps/depApps.html does not exist

Here below you see the complete start of the log file.

03.10.19 20:34:25 (+0200) Started service 'node-red sha256:c236a18214c7b05fb0b2074b7938a36c84f8700197c2f1e179a0e63ec9fbed10'
03.10.19 20:34:26 (+0200)  node-red  3 Oct 18:34:26 - [info] 
03.10.19 20:34:26 (+0200)  node-red  
03.10.19 20:34:26 (+0200)  node-red  Welcome to Node-RED
03.10.19 20:34:26 (+0200)  node-red  ===================
03.10.19 20:34:26 (+0200)  node-red  
03.10.19 20:34:26 (+0200)  node-red  3 Oct 18:34:26 - [info] Node-RED version: v1.0.0
03.10.19 20:34:26 (+0200)  node-red  3 Oct 18:34:26 - [info] Node.js  version: v12.7.0
03.10.19 20:34:26 (+0200)  node-red  3 Oct 18:34:26 - [info] Linux 4.14.98 arm LE
03.10.19 20:34:27 (+0200)  node-red  3 Oct 18:34:27 - [info] Loading palette nodes
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [warn] ------------------------------------------------------
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [warn] [node-red-contrib-balena/depDevices] Error: /usr/local/lib/node_modules/node-red-contrib-balena/depDevices/depDevices.html does not exist
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [warn] [node-red-contrib-balena/depApps] Error: /usr/local/lib/node_modules/node-red-contrib-balena/depApps/depApps.html does not exist
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [warn] ------------------------------------------------------
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [info] Settings file  : /usr/src/app/settings.js
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [info] Context store  : 'default' [module=memory]
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [info] User directory : /data/node-red/user/
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [info] Flows file     : /data/node-red/user/flows_803bf37.json
03.10.19 20:34:30 (+0200)  node-red  3 Oct 18:34:30 - [info] Creating new flow file

Rpi.GPIO library

Hi all,

Very new to balena but extremely familar with Node Red. Once installed on a Pi 3, the logs show that the Pi GPIO library is not installed.

Alongside this I added the modbus node to my palette but this won’t install due to a dependency on serial libraries. Is there a way a I can include this in the docker container to be rolled out automatically for future deployments?

Thanks

Node-RED readonly

When I want to change backlight of RPi display, it trhrows:
Error: EROFS: read-only file system, open '/sys/class/backlight/rpi_backlight/bl_power

Is there a way to do this on readonly FS or how do I change the FS to writable?

Thank you in advance.

Some nodes are no more working on alpine

Hi,

I've finally took time to test this new slim node-red Dockerfile, but I've met some problems :

12.07.17 18:20:34 (+0200) 12 Jul 16:20:34 - [rpi-srf] Info : Can't find Pi RPi.GPIO python library.
12.07.17 18:20:34 (+0200) 12 Jul 16:20:34 - [warn] ------------------------------------------------------
12.07.17 18:20:34 (+0200) 12 Jul 16:20:34 - [warn] [rpi-srf] Warning : Can'tfind Pi RPi.GPIO python library.

Here is my the relevant RUN where you can see I've added py-rpigpio but maybe this library is not the same as python-rpi.gpio debian package :

# Install node modules, including i2c-bus without carrying all the deps in the layers
RUN apk add --no-cache \ 
          tzdata \
          make \
	  gcc \
	  g++ \
	  python \
	  py-rpigpio \

 && JOBS=MAX npm install -g --production --silent \
                  node-red \
		  node-red-contrib-resinio \
		  node-red-node-pisrf \
				  
# Setup timezone
 && cp /usr/share/zoneinfo/Europe/Paris /etc/localtime \
 && echo "Europe/Paris" >  /etc/timezone \
 
# Remove non runtime dependencies
 && apk del \
         tzdata \
         make \
	 gcc \
	 g++ \
&& npm cache clean --force \
&& rm -rf /tmp/*

As a conclusion, maybe you should keep a second Dockerfile template for those who need packages not available on alpine.

Do not by default run the node-red service as "privileged" service and "root" user

This node-red service is set as a privileged service and node-red runs as root user.

In most cases this is not really needed.
It would be nice and secure to be able to run the node-red service as a non privileged service which is not run as root.

Note also the node-red docker image managed by the node-red community is also not running as privileged service and it executes under the user "node-red".
See https://hub.docker.com/r/nodered/node-red-docker/

RPI GPIO

Hi

When trying to use the read gpio node, it says "not available" using the node-red base container. Any help would be greatly appreciated

image

Push fails with balena.yml is not a valid contract

Hi,

I am having the following error when pushing:

C:\repos\balena-node-red
!balena push node-red --source .
- Packaging the project source...[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\.gitignore
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\CHANGELOG.md
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\LICENCE
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\README.md
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\balena.yml
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\docker-compose.yml
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\repo.yml
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\.versionbot\CHANGELOG.yml
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\node-red\Dockerfile.raspberrypi4-64
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\node-red\Dockerfile.template
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\node-red\app\settings.js
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\node-red\app\start.sh
[Info]    Converting line endings CRLF -> LF for file: C:\repos\balena-node-red\node-red\app\flows\balena.json
[Error]    The included balena.yml is not a valid contract, allowed types are sw.application,sw.block,sw.hal-module, stopping build
[Error]    Some services failed to build:
[Error]    Not deploying release.
[Error]    Upstream API server/DB error:
Remote build failed

I am pushing from Windows and the application is being deployed to a RaspberryPi3 using the 64bit OS

Project fails to build / push: Unable to locate package rpi.gpio, python-rpi.gpio

$ git clone https://github.com/balena-io-projects/balena-node-red.git
$ cd balena-node-red
$ balena push test-rpi4
...
[node-red]  E: Unable to locate package rpi.gpio
[node-red]  E: Couldn't find any package by glob 'rpi.gpio'
[node-red]  E: Couldn't find any package by regex 'rpi.gpio'
[node-red]  E: Unable to locate package python-rpi.gpio
[node-red]  E: Couldn't find any package by glob 'python-rpi.gpio'
[node-red]  E: Couldn't find any package by regex 'python-rpi.gpio'
[node-red]
[node-red]  Removing intermediate container f85e7e1cc7e2
[node-red]  The command '/bin/sh -c apt-get update && apt-get install -yq --no-install-recommends   rpi.gpio   python-dev   python-rpi.gpio   && apt-get clean && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
[Info]      Uploading images
[Success]   Successfully uploaded images
[Error]     Some services failed to build:
[Error]       Service: node-red
[Error]         Error: The command '/bin/sh -c apt-get update && apt-get install -yq --no-install-recommends   rpi.gpio   python-dev   python-rpi.gpio   && apt-get clean && rm -rf /var/lib/apt/lists/*' returned a non-zero code: 100
[Info]      Built on arm01
[Error]     Not deploying release.
Remote build failed

Getting started

Hi,

this is nice to have a resin-node-red template to startup, but I think you could made it more explicit you have to setup env vars before you can do anyting in the Node-RED console, because it's not so obvious and you can actually see the interface and do some layout before you realize u can't save or run anything.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.