Ancient Pi

674 views
Skip to first unread message

Peter Scargill

unread,
Jan 10, 2016, 6:04:40 PM1/10/16
to Node-RED
I wonder if anyone can enlighten me... I've installed node-red on jessie now without a hitch on Pi2.

Today I tried on an old Pi (large SD). Install went perfectly. Everything else worked.. but node-red... no.

Here's what happens - anyone have any ideas (other than throw it away - the plan is to transfer this to a Pi Zero)..

Pete.




pi@pizero1:~ $ node-red-start


Once Node-RED has started, point a browser at http://192.168.0.122:1880
On Pi Node-RED works better with the Iceweasel browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes - go to http://flows.nodered.org
You may also need to install and upgrade npm
      sudo apt-get install npm
      sudo npm i -g npm@2.x

Starting Node-RED graphical event wiring tool....
Started Node-RED graphical event wiring tool..
Failed at step CHDIR spawning /usr/bin/node: No such file or directory
nodered.service: main process exited, code=exited, status=200/CHDIR
Unit nodered.service entered failed state.
nodered.service holdoff time over, scheduling restart.
Stopping Node-RED graphical event wiring tool....
Starting Node-RED graphical event wiring tool....
Started Node-RED graphical event wiring tool..
Failed at step CHDIR spawning /usr/bin/node: No such file or directory
nodered.service: main process exited, code=exited, status=200/CHDIR
Unit nodered.service entered failed state.
nodered.service holdoff time over, scheduling restart.
Stopping Node-RED graphical event wiring tool....
Starting Node-RED graphical event wiring tool....
nodered.service start request repeated too quickly, refusing to start.
Failed to start Node-RED graphical event wiring tool..
Unit nodered.service entered failed state.
^Cpi@pizero1:~ $

Dave C-J

unread,
Jan 10, 2016, 6:12:00 PM1/10/16
to node...@googlegroups.com
Was this a) moved from a Pi2 ? and b) had it been upgraded from preinstall ?
If yes to both then yes - you are likely to be stuffed.
Pi and Pi2 use different processors. They have managed to maintain moving from 1 to 2 OK - but once you start installing things on a 2 box then that will install the Pi2 specific architecture versions of stuff - which then won't run back on a Pi1...
The pre-install is configured on a Pi1 - so will work on a zero, 1 or 2.
You "may" be able to get away with a sudo apt-get purge nodered and then a sudo apt-get install nodered...
but I haven't tried it... so... def no warranty on that one.

Peter Scargill

unread,
Jan 10, 2016, 6:15:44 PM1/10/16
to node...@googlegroups.com

Hi

 

This was not moved, it was an install from scratch as I did on my blog for Pi2….. clean SD, installed the Jessie image – ran my script – all worked well…. PHP etc all works…

--
http://nodered.org
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/EzKVpYx0lAs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dave C-J

unread,
Jan 10, 2016, 6:22:45 PM1/10/16
to node...@googlegroups.com
Which version of node.js did you install... ?
Did you use the correct version for Pi1 ? 
IE a different version of your script ?

Peter Scargill

unread,
Jan 10, 2016, 7:44:37 PM1/10/16
to node...@googlegroups.com

Erm… I didn’t realise there was a difference…

 

So I’m using this

 

curl -sL https://deb.nodesource.com/setup_4.x | sudo bash -

sudo apt-get install -y build-essential python-dev python-rpi.gpio nodejs

 

 

and It looks like I should be using this..

 

wget http://node-arm.herokuapp.com/node_archive_armhf.deb
sudo dpkg -i node_archive_armhf.deb
sudo apt-get install build-essential python-dev python-rpi.gpio

 

Right – start again in the morning – I tried uninstalling the first lot then procedding to the second… exactly the same response…  I’ll report back if attempt 2 works. J

 

 

From: node...@googlegroups.com [mailto:node...@googlegroups.com] On Behalf Of Dave C-J
Sent: 10 January 2016 23:23
To: node...@googlegroups.com
Subject: Re: [node-red] Ancient Pi

 

Which version of node.js did you install... ?

--

Peter Scargill

unread,
Jan 12, 2016, 12:44:08 AM1/12/16
to node...@googlegroups.com

Dave (or other) can you help please.

 

My script is here for now..

https://bitbucket.org/snippets/scargill/eyAG7

 

I noted your comments Dave below – and at line 101 you will see this is set up for Pi2 with commented out lines below that for Pi1.

 

I’ve just done a clean install on a Pi1 (very original). Everything works – but the node-red-start fails, griping about invalid directory /usr/bin/node

 

I noted that there is no /usr/bin/node on my Pi1 test…. But there is a /usr/local/bin/node so I altered the start up script in Webmin to handle this and it STILL failed.

 

Actually running Node-Red at the command line works perfectly but the startup script fails as above. Can you suggest what might be wrong here.

 

For clarity we’re talking about starting with the latest Jessie image from RPI and the script (and it’s supporting script) works without issue on Pi2…. and Node-Red at the command line works on Pi1 with the lines at 101 commented out and the lines after that uncommented – but the startup script fails.

 

Help.

 

Pete.

 

From: node...@googlegroups.com [mailto:node...@googlegroups.com] On Behalf Of Dave C-J
Sent: 10 January 2016 23:23
To: node...@googlegroups.com
Subject: Re: [node-red] Ancient Pi

 

Which version of node.js did you install... ?

--

Peter Scargill

unread,
Jan 12, 2016, 2:28:06 AM1/12/16
to Node-RED, pe...@scargill.org
And to clarify - the systemd script it makes refers to /usr/bin/node -- by changing (in Webmin)  that location to /usr/local/bin/node  it works - but I can't figure out why the wrong info is being set up in the first place when the Pi2 does not need that modification

Nicholas O'Leary

unread,
Jan 12, 2016, 4:43:53 AM1/12/16
to Node-RED Mailing List
Peter, my guess is the Pi1 package of node (provided by node-arm.herokuapp.com) installs the command in /usr/bin/local and the P2 package of node (provided by nodesource) installs the command in /usr/bin ... 


--
http://nodered.org
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.

Peter Scargill

unread,
Jan 12, 2016, 5:54:54 AM1/12/16
to node...@googlegroups.com

I think that is likely right – but I’m not sure how to change the script to reflect this..

 

The only reference to systemctl I have is around line114 and for the life of me I can’t figure out what it is doing.

Nicholas O'Leary

unread,
Jan 12, 2016, 5:59:49 AM1/12/16
to Node-RED Mailing List
Peter,

line 112 of your script is where it downloads the systemctl service file for node-red.


This file contains a hardcoded path to /usr/bin/node

Quick solution... add the following command around line 109

ln -fs /usr/bin/local/node /usr/bin/node

This creates a symbolic link between the node executable in /usr/bin/local/node to where the servicectl script expects it to be.

Peter Scargill

unread,
Jan 12, 2016, 6:20:08 AM1/12/16
to node...@googlegroups.com

That is JUST the kind of help I was after – thanks Nick. So now I have a script for Pi and one for Pi2 – excellent… both sitting here working a treat.

Peter Scargill

unread,
Jan 12, 2016, 2:22:49 PM1/12/16
to Node-RED
Hi Nick

That didn't work.. (remember this is RPI not RPI2)

This is a strange one - if I run "node-red-start" it complains about no /usr/bin/node -  so I use Webmin to change that to /usr/local/bin/node  - in the startup script for node-red - and it STILL complains - this time about the new address.

But that new address IS there.

pi@pizero1:~ $ node-red-start

Start Node-RED

Once Node-RED has started, point a browser at http://192.168.0.122:1880
On Pi Node-RED works better with the Iceweasel browser

Use   node-red-stop                          to stop Node-RED
Use   node-red-start                         to start Node-RED again
Use   sudo systemctl enable nodered.service  to autostart Node-RED at every boot
Use   sudo systemctl disable nodered.service to disable autostart on boot

To find more nodes and example flows - go to http://flows.nodered.org
You may also need to install and upgrade npm
      sudo apt-get install npm
      sudo npm i -g npm@2.x

Starting Node-RED graphical event wiring tool....
Started Node-RED graphical event wiring tool..
Failed at step CHDIR spawning /usr/local/bin/node: No such file or directory
nodered.service: main process exited, code=exited, status=200/CHDIR
Unit nodered.service entered failed state.


YET - - /usr/local/node-red starts!!!!!!


pi@pizero1:~ $ /usr/local/bin/node-red


Welcome to Node-RED
===================

12 Jan 19:19:54 - [info] Node-RED version: v0.12.5
12 Jan 19:19:54 - [info] Node.js  version: v0.12.6
12 Jan 19:19:54 - [info] Loading palette nodes
12 Jan 19:20:33 - [info] Dashboard up and running
12 Jan 19:20:56 - [info] UI started at /ui
12 Jan 19:21:20 - [info] Settings file  : /home/pi/.node-red/settings.js
12 Jan 19:21:20 - [info] User directory : /home/pi/.node-red
12 Jan 19:21:20 - [info] Flows file : /home/pi/.node-red/flows_pizero1.json
12 Jan 19:21:20 - [info] Server now running at http://127.0.0.1:1880/
12 Jan 19:21:20 - [info] Creating new flow file
12 Jan 19:21:20 - [info] Starting flows
12 Jan 19:21:20 - [info] Started flows



Nicholas O'Leary

unread,
Jan 12, 2016, 2:26:14 PM1/12/16
to Node-RED

What does:

ls -la /usr/local/bin/node

return?


Peter Scargill

unread,
Jan 12, 2016, 2:31:46 PM1/12/16
to node...@googlegroups.com

-rwxr-xr-x 1 root staff 10260772 Jul  6  2015 /usr/local/bin/node

 

From: node...@googlegroups.com [mailto:node...@googlegroups.com] On Behalf Of Nicholas O'Leary
Sent: 12 January 2016 19:26
To: Node-RED <node...@googlegroups.com>
Subject: Re: [node-red] Ancient Pi

 

What does:

--
http://nodered.org
---
You received this message because you are subscribed to a topic in the Google Groups "Node-RED" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/node-red/EzKVpYx0lAs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to node-red+u...@googlegroups.com.

Peter Scargill

unread,
Jan 12, 2016, 2:35:05 PM1/12/16
to Node-RED
Just for reference

sudo ln -fs /usr/local/bin/node /usr/bin/node
sudo chmod +x /usr/bin/node-red-st*
sudo systemctl daemon-reload

I added the ln before the permissions and systemctl lines..
Reply all
Reply to author
Forward
0 new messages