stephenkeep / node-red-contrib-amazondash

Node-RED node that listens for an Amazon dash button press
13 stars 9 forks source link

Pcap need elevated privileges #2

Open fabiodellafiorentina opened 7 years ago

fabiodellafiorentina commented 7 years ago

I receive the error below from node red:

Error: socket: Operation not permitted at new PcapSession (/home/pi/.node-red/node_modules/pcap/pcap.js:49:39) at Object.exports.createSession (/home/pi/.node-red/node_modules/pcap/pcap.js:123:12) at create_session (/home/pi/.node-red/node_modules/node-red-contrib-amazondash/node_modules/node-dash-button/index. js:12:28) at register (/home/pi/.node-red/node_modules/node-red-contrib-amazondash/node_modules/node-dash-button/index.js:29: 24) at new node (/home/pi/.node-red/node_modules/node-red-contrib-amazondash/button-pressed.js:14:20) at createNode (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:302:18) at Flow.start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/Flow.js:87:35) at start (/usr/lib/node_modules/node-red/red/runtime/nodes/flows/index.js:277:29) at tryCatchReject (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:845:30) at runContinuation1 (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:804:4) at Fulfilled.when (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:592:4) at Pending.run (/usr/lib/node_modules/node-red/node_modules/when/lib/makePromise.js:483:13) at Scheduler._drain (/usr/lib/node_modules/node-red/node_modules/when/lib/Scheduler.js:62:19) at Scheduler.drain (/usr/lib/node_modules/node-red/node_modules/when/lib/Scheduler.js:27:9) at _combinedTickCallback (internal/process/next_tick.js:67:7) at process._tickCallback (internal/process/next_tick.js:98:9) Failed to create pcap session: couldn't find devices to listen on. Try running with elevated privileges via 'sudo' 6 Jan 23:03:35 - [error] [ButtonPressed:79260a05.2b2d34] Error: Error: No devices to listen

I understand I need to run Pcap with higher privileges. Do you have any ideas?

pucbaldwin commented 7 years ago

I have the same issue. Tried doing "sudo node-red-start" but same problem.

mesche commented 7 years ago

@pucbaldwin have you tried to set the filesystem capabilities for 'node' ?

sudo setcap 'cap_net_raw,cap_net_admin+eip' $(readlink -f $(which node))

you can find more infos here (german).