Can't enable newly installed node (node-red-contrib-noble)

794 views
Skip to first unread message

Scott Chapman

unread,
Jun 6, 2017, 10:56:33 AM6/6/17
to Node-RED
So I have a new Rasp-Pi installation (all up to date, though I haven't run the "update-nodejs-and-nodered" command yet).

I've installed the node-red-contrib-noble (since I want to do bluetooth scanning). And I can see that the node is there installed, but I am not able to enable it...

Any ideas?

Nick O'Leary

unread,
Jun 6, 2017, 11:10:43 AM6/6/17
to Node-RED Mailing List
Any errors in the node-red log when it starts up?

Nick

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
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+unsubscribe@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/b99242f9-a75b-4572-9a55-fa396f738444%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Scott Chapman

unread,
Jun 6, 2017, 12:17:28 PM6/6/17
to Node-RED
I do see that I get:
[noble] Error: Cannot find module 'bluetooth-hci-socket'

Going to blow away the node_modules folder in /root/.node-red and trying to re-install the contrib.

I know I need to run this as root, so I assume that is the right action?


On Tuesday, June 6, 2017 at 11:10:43 AM UTC-4, Nick O'Leary wrote:
Any errors in the node-red log when it starts up?

Nick
On 6 June 2017 at 15:56, Scott Chapman <scotted...@gmail.com> wrote:
So I have a new Rasp-Pi installation (all up to date, though I haven't run the "update-nodejs-and-nodered" command yet).

I've installed the node-red-contrib-noble (since I want to do bluetooth scanning). And I can see that the node is there installed, but I am not able to enable it...

Any ideas?

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
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.

Colin Law

unread,
Jun 6, 2017, 12:22:01 PM6/6/17
to node...@googlegroups.com

Scott Chapman

unread,
Jun 6, 2017, 12:30:06 PM6/6/17
to Node-RED
Fresh install and just updated

Scott Chapman

unread,
Jun 6, 2017, 12:45:39 PM6/6/17
to Node-RED
Well... OK... appears to be hung here:
[              ....] \ extract:noble: verb gentlyRm don't care about contents; nuking /root/.node-red/node_modules/.staging/noble-292694d5/node_modules
I checked and that folder doesn't exist...

On Tuesday, June 6, 2017 at 12:30:06 PM UTC-4, Scott Chapman wrote:
Fresh install and just updated

Scott Chapman

unread,
Jun 6, 2017, 12:56:02 PM6/6/17
to Node-RED
OK, got further (eventually). Got some error about not having permissions in /root/.node-gyp. Not sure how that happened, but blew it away, and running again.

Scott Chapman

unread,
Jun 6, 2017, 12:59:58 PM6/6/17
to Node-RED
gak. so OK. getting:
root@pizero:~/.node-red# npm install node-red-contrib-noble
> u...@1.2.0 install /root/.node-red/node_modules/usb
> node-pre-gyp install --fallback-to-build
sh: 1: node-pre-gyp: Permission denied

Now I am stuck again... any ideas? 

Dave C-J

unread,
Jun 6, 2017, 3:50:20 PM6/6/17
to node...@googlegroups.com
you may need the --unsafe-perm flag on the command
    npm i --unsafe-perm node-red-contrib-noble
as when it calls out to node-gyp it drops it's privs to nobody thaht then may not have access to what it needs...

Julian Knight

unread,
Jun 7, 2017, 5:03:06 AM6/7/17
to Node-RED
Why are you doing this as root? I did previously note I think - when I was playing with noble - that the instructions say you can only use it as root, but that is not true as all you need to do is correct the default permissions on your bluetooth dev files.

Scott Chapman

unread,
Jun 7, 2017, 9:00:24 AM6/7/17
to Node-RED
I think when I first tried to set it up I was getting access errors with noble. I assumed that it was a protected device (not sure why I assumed that) and that I needed to be root.

What's the process for fixing that exactly? 

Julian Knight

unread,
Jun 8, 2017, 3:42:42 PM6/8/17
to Node-RED
Instructions are in the readme for noble:

Running without root/sudo

Run the following command:

sudo setcap cap_net_raw+eip $(eval readlink -f `which node`)

This grants the node binary cap_net_raw privileges, so it can start/stop BLE advertising.

Note: The above command requires setcap to be installed, it can be installed using the following:

  • apt: sudo apt-get install libcap2-bin
  • yum: su -c \'yum install libcap2-bin\'
Reply all
Reply to author
Forward
0 new messages