Node-Red Installation



  • Hi everyone!

    Does anyone know how to install the Node-Red software?
    I would like to control an LED strip via my Omega, Node-Red and a webapp wich is created via node-red.

    Thanks a lot!!

    Gauthier



  • I could need that help too :)



  • Oh, after long research, i found this and it seems to work :D https://wiki.onion.io/Tutorials/node-red



  • @Gauthier-Michoud @MultiDJRoni, did you succeed installing Node-Red? When I do

    # opkg update
    # opkg install onion-node-red
    

    All I get is

    Unknown package 'onion-node-red'.
    Collected errors:
     * opkg_install_cmd: Cannot install package onion-node-red.
    

    My OS version is: BusyBox v1.23.2; Ω-ware: 0.1.4 b330
    The opkg package lists are fetched from
    http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/base/
    http://repo.onion.io/omega/packages/
    http://downloads.openwrt.org/chaos_calmer/15.05.1/ar71xx/generic/packages/packages/

    I am using Omega 1 hardware.



  • Edit: This story ends badly... I will tell it anyway.
    This story ends happily...

    The Onion Node-RED Tutorial recommends running
    $ opkg install onion-node-red
    The opkg download often fails because the file is quite large. I did a wget to download the 214MB file from the opkg repository manually
    $ wget http://repo.onion.io/omega2/packages/onion/onion-node-red_0.1-1_mipsel_24kc.ipk

    Then I tried to install the ipk locally.
    $ opkg install onion-node-red_0.1-1_mipsel_24kc.ipk
    That installs but Node-RED isn't really installed correctly.
    An .ipk file is basically just a .tar.gz file. So I unpacked it using the tar command:
    $ tar xvfz onion-node-red_0.1-1_mipsel_24kc.ipk
    That gave me a data.tar.gz file. Manually unpacking the data.tar.gz reveals that there are 180K files with many many nested directories that do not contain any files. In fact, the first 170K files are junk. Only the last 10140 files are real.
    $ tar xvzf data.tar.gz > corrupted.txt
    $ tail -10140 corrupted.txt > realfiles.txt
    I thought that I could repack with just the real files.
    $ cat realfiles.txt | awk '{print $6}' | xargs tar xzvf data.tar.gz
    It splits out a bunch of warnings that files are missing from the data.tar.gz
    Its really corrupted.
    I was doing this in a /tmp directory on another Linux machine, so I repacked what I was able to recover.
    $ tar czvf nodered.tar.gz usr
    I moved the nodered.tar.gz back to my Omega2 and unpacked it
    $ cd /
    $ tar xzvf nodered.tar.gz
    I then
    $ cd /usr/bin/onion-node-red/node_modules/node-red
    $ node red.js
    Behold, Node-RED started.
    root@Omega-447F:/usr/bin/onion-node-red/node_modules/node-red# node red.js
    The host is: undefined
    28 Mar 01:08:00 - [info]

    Welcome to Node-RED

    28 Mar 01:08:00 - [info] Node-RED version: v0.16.2
    28 Mar 01:08:00 - [info] Node.js version: v4.3.1
    28 Mar 01:08:00 - [info] Linux 4.4.46 mipsel LE
    28 Mar 01:08:00 - [info] Palette editor disabled : npm command not found
    28 Mar 01:08:00 - [info] Loading palette nodes

    It crashed a minute later with a JS stack trace.
    Ok... I might have enough of the bits to invoke npm to reinstall them.
    $ opkg install npm
    $ npm install .
    Opps, that crashed with a process out of memory error. I followed the
    Onion Extending RAM with a Swap File Tutorial and the convoluted technique to install swapon

    I was able to get
    $ npm install .
    to complete but starting node-red failed because it was missing lots of dependencies.

    Edit : I merged the node_modules directory from the tgz and what npm install downloaded. I solved the process out of memory by invoking node-red with additional process space.

    $ /usr/lib/node_modules/node-red# node --max_old_space_size=80 red.js



Looks like your connection to Onion Community was lost, please wait while we try to reconnect.