Problem installing in RPi3: onoff library and later

Guys, avoid node v0.12 and before. v4.0.0+ is available for a long time.
Just remove previous node versions and follow our tutorial to install the fresh one

1 Like

Like this?

Which led to thisā€¦

Which brings us right back to the whole compatibility issue with ONOFF and thus limited Blynk usability.

If the solution is to simply not use older hardware, then please just specify such in the tutorials. Donā€™t keep pointing back to that which does not work.

Sorry, didnā€™t mean thatā€¦ It appears that they dropped support some time ago - which we were not aware of.
Iā€™ll try to find a new, working way

Thank you @vshymanskyy

I know the issue is not ā€˜directlyā€™ Blynk related, but again, thank you for continuing to look into it :+1:

if uname -m gives you armv6l, check if this works for you:

sudo su

cd /opt

wget https://nodejs.org/dist/v6.9.5/node-v6.9.5-linux-armv6l.tar.gz -O - | tar -xz
mv node-v6.9.5-linux-armv6l nodejs

apt-get purge node nodejs -y
apt-get autoremove
apt-get update
apt-get install build-essential

ln -s /opt/nodejs/bin/node /usr/bin/node
ln -s /opt/nodejs/bin/node /usr/bin/nodejs
ln -s /opt/nodejs/bin/npm /usr/bin/npm

npm install -g blynk-library onoff

exit

Now, to run Blynk:

export PATH=$PATH:/opt/nodejs/bin/
unset NODE_PATH
blynk-client your_auth_token

After sudo su, (nice trick, I will have to remember that one), the next few lines were essentualy the same as my previously mentioned alternative methods of installing NODE, just with a slightly newer version.

The rest of the commands are becoming familiar, from repetition :stuck_out_tongue:

However, in the end nothing happensā€¦ no error, no delay, nothingā€¦

PS, not worried about showing the authā€¦ it is for testing only :wink:

OK, @vshymanskyy I cleared out all remnants of node, nodejs & npm that I could find, including any in /opt and /usr/bin, so I could start from relative scratch. I did not remove any Blynk directories as I didnā€™t know which ones were related to my wiringPi install.

I then re-ran through your entire list of commands againā€¦ and the only warnings were at the very last installā€¦

root@raspberrypi:~# npm install -g blynk-library onoff
/opt/nodejs/bin/blynk-client -> /opt/nodejs/lib/node_modules/blynk-library/bin/blynk-client.js
/opt/nodejs/bin/blynk-ctrl -> /opt/nodejs/lib/node_modules/blynk-library/bin/blynk-ctrl.js

> epoll@0.1.20 install /opt/nodejs/lib/node_modules/onoff/node_modules/epoll
> node-gyp rebuild

gyp WARN EACCES user "root" does not have permission to access the dev dir "/root/.node-gyp/6.9.5"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/opt/nodejs/lib/node_modules/onoff/node_modules/epoll/.node-gyp"
make: Entering directory '/opt/nodejs/lib/node_modules/onoff/node_modules/epoll/build'
  CXX(target) Release/obj.target/epoll/src/epoll.o
  SOLINK_MODULE(target) Release/obj.target/epoll.node
  COPY Release/epoll.node
make: Leaving directory '/opt/nodejs/lib/node_modules/onoff/node_modules/epoll/build'
/opt/nodejs/lib
ā”œā”€ā”€ blynk-library@0.4.5
ā””ā”€ā”¬ onoff@1.1.1
  ā””ā”€ā”¬ epoll@0.1.20
    ā”œā”€ā”€ bindings@1.2.1
    ā””ā”€ā”€ nan@2.4.0

Unfortunately, after running the blynk-client <auth> command, I still have the same null resultā€¦ no errors or delays before jumping back to the CLI prompt.

@Gunner I did it on my Raspberry PI Model B without mounting holes from 2012 - and it works.
run these commands and show your output:

uname -m
uname -a
cat /etc/os-release
cat /etc/debian_version
cat /proc/cpuinfo
echo $PATH
echo $NODE_PATH
node --version
npm -v

P.S. I did a clean install of 2017-01-11-raspbian-jessie, expanded image, enabled VNC and SSH if that can matter

You can also try:
npm install -g npm
and then reinstall blynk and onoff
I will take looooots of timeā€¦

Which one of the symbolic links above, if any, allows us to use commands without the .js suffix i.e.

blynk-client <token>

rather than

blynk-client.js <token>

None. npm setups the links itself

1 Like
pi@raspberrypi:/ $ uname -m
armv6l

pi@raspberrypi:/ $ uname -a
Linux raspberrypi 4.4.32-aufs #1 Sat Nov 19 00:02:41 CET 2016 armv6l GNU/Linux

pi@raspberrypi:/ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

pi@raspberrypi:/ $ cat /etc/debian_version
8.0

pi@raspberrypi:/ $ cat /proc/cpuinfo
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 897.37
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 000f
Serial          : 00000000120d3228

pi@raspberrypi:/ $ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/opt/nodejs/bin/:/opt/nodejs/bin/:/opt/nodejs/bin/

pi@raspberrypi:/ $ echo $NODE_PATH
/usr/local/lib/node_modules

pi@raspberrypi:/ $ node --version
v6.9.5

pi@raspberrypi:/ $ npm -v
3.10.10

Full or Lite?

@vshymanskyy and @Gunner I started with a fresh install of Jessie Lite today. After a couple of hours I was almost up and running when the SD card gave systemd errors on bootup. The card wasnā€™t failing and I tried for a few hours to fix it but no joy.

Tried a second time but this time decided I would install the filesystem to a USB stick and all seems to be fine. Still need to check out my DS18B20 setup but basic operation is fine.

Guide for USB filesystem is at https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=44177
It looks detailed but itā€™s not really that bad. @paulv wrote it in 2013 but updated it just a couple of weeks ago.

I made a few notes during the Blynk setup but basically they are as published by @vshymanskyy a few posts back.

Iā€™m not getting a $NODE_PATH with your instructions.
The following will retain the nodejs path between reboots on a Pi

echo 'export PATH=$PATH:/opt/nodejs/bin/'  >> ~/.bashrc

Put your version checks into a script and this is what I get, third line from the bottom is the missing $NODE_PATH. Everything works fine as it is but it does mean some of my scripts need full path details before they will run. It would be nice to have a $NODE_PATH if you have a fix.

armv6l
Linux raspberrypi 4.4.38+ #938 Thu Dec 15 15:17:54 GMT 2016 armv6l GNU/Linux
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
8.0
processor       : 0
model name      : ARMv6-compatible processor rev 7 (v6l)
BogoMIPS        : 697.95
Features        : half thumb fastmult vfp edsp java tls
CPU implementer : 0x41
CPU architecture: 7
CPU variant     : 0x0
CPU part        : 0xb76
CPU revision    : 7

Hardware        : BCM2708
Revision        : 000e
Serial          : 00000000f29267b3
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/opt/nodejs/bin/

v6.9.5
4.2.0

@Gunner, $NODE_PATH is invalid in your case. Either set it to new path, or remove it completely from environment.

@vshymanskyy what is the command to set up the correct $NODE_PATH based on the /opt/ installation?

That wouldnā€™t surprise meā€¦ all the different PATH commands I have dropped inā€¦ I am just a copy/paste linux user (thank heavens CLI remembers past commands :wink: ), but I will Google yet some more and give it a tryā€¦

OK, after taking some time away from this RPi hassleā€¦ I am back where I think everything is installed, but running blynk-client <auth> results in absolutely nothing. If I donā€™t have the correct path, how come no error is thrown?

echo $PATH gets me this:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games:/opt/nodejs/bin/:/opt/nodejs/bin/

echo $NODE_PATH is blankā€¦

So what am I actually to do now?? After Googling, I think? I understand a bit about adding a path, but what is the correct path to add??

Also, @Costas did give me a mod for the blynk-node.js file, to set it up for my Local Server, but that is more a semi-permanent thingā€¦ so even if it is a pain to switch back and forth between Cloud and Local, what parameters do I use with blynk-client <auth> to get it to connect to my local server instead of Cloud?

Please check our latest guide on Node.js installation for Linux: http://help.blynk.cc/hardware-and-libraries/node-js/how-to-install-nodejs-library-on-linux

@Gunner please check the ā€œCreating a new Node.js project with Blynkā€ section