Open jmai444 opened 7 years ago
A workaround that worked for me is within the node-red directory where user packages are installed:
npm install https://github.com/mranney/node_pcap.git
Then copy the pcap.js and pcap.html files from this repository (node-red-contrib-pcap) into a nodes subdirectory - create the subdirectory if it does not exist
I'm having ther same issue. After installing npm install https://github.com/mranney/node_pcap.git
under the node-red folder, I get a new folder likepi:~/.node-red/node_modules/pcap $
. I'm lost after reading your last line for copying pcap.html and pcap.js files. I copied these files to the /.node-red/node_modules/pcap folder and it doesn't work.
Can I capture probe-requests with this module?
I see my instruction aren't very clear. The location for the files depends on where node is installed. In my Raspbian install I copied the files to /usr/lib/node_modules/node-red/nodes.
I think it may also work if you create a ~/.node-red/nodes directory and copy the files there.
Yes, I am using this to capture probe requests, but I had other issues to resolve before it worked.
I don't have time at the moment, but I will try to write up a gist on how I worked around these. It will help me out too, because I'll forget otherwise.
Quick hints for the above issues:
I'm having an issue where after about 7-8 days of uptime, it stops capturing packets. The rest of the flow functions, but the pcap node stops outputting anything. Haven't figured out why yet. Likely a kernel or nodejs issue, as when I was using node-red bundle from thethingbox.io on the same hardware this wasn't happening. But thethingbox.io set up had a memory leak after 2-3 weeks uptime that was causing another part of my flow to die.
Thanks for the detailed steps. Finally I managed to get it work. However, my node-red is crashing like crazy.
Also, I'm trying to capture prbe-req from nearby devices. I'm using wlan1. In this case for the filter tab, should I just use wlan addr2 and type mgt subtype probe-req
?
I got it working when I modified wlan addr2 and type mgt subtype probe-req
to wlan type mgt subtype probe-req
Got rid of the sudden crashes. I still need to test to see the reliability. Occasionally my node red instance gets restarted. Not sure if it's because of this node.
Do you know how I can also extract the following using this node?
Hi, I'm also getting the error, but Im unabe to solve it via the workarout. I installed "npm install https://github.com/mranney/node_pcap.git" but there is no pcap.html to copy into the node-red-contrib-pcap directory. @ram1505 How did you solve the issue?
Hi,
For some reason 'Watch' was turned off this repo - so I haven't received any emails about this issue.
I have just merged #2 - which adds support for pcap2. I haven't tested it yet, but there is a good chance it will solve some peoples problems.
nick.
Thanks!
Great to see this was not abandoned.
I intend to try. I will report back when I do.
Thanks again!
Ok 'pcap2' isn't looking much better for me.
I wonder if I should be going for a completely different approach.
For example, could open pipe to tshark
and stream the packets/JSON objects into Node-RED:
sudo tshark -i en0 -T json "arp"
I suspect it would be far less likely to crash.
With node_pcap installed from the github repo as per my second comment above and now using libcap-dev from Debian Jessie backports, it has been stable for me with 17 days uptime. Problem is you must install node-red-contrib-pcap manually as it won't complete the install process.
Before I upgraded libcap-dev I was having issues with the capture stopping. No crash or errors, just no messages emitted by the pcap node in the flow after 2 or 3 days up time.
I am not sure why installing 'manually' would work or behave differently. I think a lot of those warnings/errors are related to versions of node.js.
So far I am not sure using pcap2 has made things better.
The unresolved issue with node_pcap is related to socketwatcher. The workaround is to install via github which doesn't have the problems of the npm package:
npm install https://github.com/mranney/node_pcap.git
But then npm install node-red-contrib-pcap fails with a dependency issue. I'm sure this problem could be addressed in a better way, but I just grabbed pcap.html and pcap.js from your repo here and placed them in the default .node-red/nodes directory. All works then.
Haven't tried pcap2, but it sounds like a different issue. I didn't have crashes - I had problems with the installation of node_pcap and then this package as per the above.
Ah, I see.
So the issue is that node-red-contrib-pcap currently depends on a specific version of node-pcap. I could relax the requirement, so that it depends on a less specific version:
~version "Approximately equivalent to version" See semver ^version "Compatible with version" See semver
https://docs.npmjs.com/files/package.json#dependencies
All of this would be a lot easier if there was a new official release of node-pcap. pcap2 seems to just be a snapshot of https://github.com/node-pcap/node_pcap
nick.
Yes, I think that would allow installing over the version of node_pcap that installs via github, which is version 2.0.0. It has been very stable for me since updating to a more recent libcap-dev package. I was having issues with the older version available for Debian Jessie.
I agree that node_pcap seems a bit of a mess at the moment. Lots of outstanding pull requests, plus many forks including one released on npm as pcap2.
I have switched back to node_pcap and changed the version requirement to allow any 2.x.x version.
Hopefully they will release a new, more stable, version of node_pcap to npm soon.
But loosening the version restriction should allow the current GitHub version to be used, if desired.
I cannot install this node correctly, could you tell me how to do it?
I get the following when I install:
Seems like this issue is reported in node_pcap here: https://github.com/mranney/node_pcap/issues/196
The work around is to install node_pcap from github, but I can't complete the node-red install with the github version.
Thoughts?
Cheers