Hi, I am trying to get @halfdanj 's ofxSniffer working on OSX. I want to use it to detect arp requests- I think it is the right library for the job.
I managed to get everything compiling but with a few difficulties. I had to change this line
newRawPacketEvent.notifyAsync(this, packet);
to
newRawPacketEvent.notify(this, packet);
I am using 64 bit libs from ofxLibTins as I could not get the apothecary script to run. I managed to get the libs linking properly but only by making a new project. I gave the library the correct permissions and my wifi goes into monitor mode as expected.
However as soon as I get a packet the program crashes- I have attached a screen shot of xcode of the crash.
I found this issue - https://github.com/openframeworks/openFrameworks/issues/4192 where the notifyAsync has been replaced by using ofThreadChannel, but the ofxSniffer code has both methods in place still. Does anyone have a functioning version of ofxSniffer? Or maybe a clue as to how to get this (or at least libtins) running?
OK, I think I may have found the error, when I stop trying to read the SSID the program runs fine- it was nothing to do with the events or threads. I am not at my own place so I cannot mess with the router but my guess is that the SSID has a dash “-” in the name and this is causing the problem. I’ll try again with my own hardware later to see if that was really the problem, otherwise it seems to be working fine.
The code compiles, but I dont get any response when an arp request is present on the network. I checked with wirecast and I do see an arp request when I connect a new device to the network. As far as I could tell this line:
Ok, of course I was not paying enough attention, the first error was due to the fact that I could not insert the SSID it needed to be converted to a string (this does not make so much sense to me as the type was a string but it did solve the problem.
The arp request was also a simple solve, to get arp requests the sniffer should not put the wifi into monitor mode, as it was set in the examples.