Wifi Data Collection

From XinCheJian
Jump to navigation Jump to search
 
Wifi Data Collection

Release status: beta [box doku]

Description Status of the space via data collection and analysis
Author(s)  Rngadam

Purpose

Use wireless connected devices activity from the router and webcam associated to the wifi XinCheJian router to find and predict information about the activity of the space.

Fullscreen capture 10312011 12405 AM.jpg

System

Schematic.png

Setup

Agent:

  • enable telnet access on router
  • copy agent source code to /opt/wifi
  • symlink file to /etc/init/listae.conf
  • service listae start

AppEngine:

  • Deploy to xinchejian.com

Discoveries

DD-WRT SNMP incomplete?

Originally, instead of telnet, we thought of using SNMP to gather list of currently connected devices on the router. But although DD-WRT advertises the following SNMP data:

OID [dottedt & text format]	MEANING	RANGE of VALUES	CONTENT (example)
.1.3.6.1.4.1.2021.255.3.54.1.3.32.1.1.1	 index of wireless client (if there are many clients each will have index 1-x)	 integer	 1
.1.3.6.1.4.1.2021.255.3.54.1.3.32.1.4.1	 Associated MAC	 text	 00:ff:as:dd:44:55
.1.3.6.1.4.1.2021.255.3.54.1.3.32.1.26.1	 SNR of this wireless client

...it doesn't seem to provide information for more than two wireless client at a time.

PandaBoard Wifi monitoring mode not working

An alternative would be to directly monitor wireless connections from the PandaBoard by sniffing traffic. However, it seems that the Linux driver for the wifi component on the PandaBoard does not support monitoring mode.

Development

  • Ask to have your public key added to the PandaBoard installation
  • Test using putty or openssh to connect using your private key
  • Ask to be added to the AppEngine dashboard on https://appengine.google.com
  • Install the AppEngine Python development kit
  • Checkout the source code from github

Testing the Agent

Fake an http server on a localhost port

$ nc -l localhost  8080

Overwrite the configuration values at the command-line

$ ./listae.py --sqlite_filename /tmp/test.dat --host 192.168.1.1 --user root --password_filename /opt/wifi/router.passwd --server localhost --port 8080

motion:

 /opt/motion/motion.py --server 192.168.1.92 --port 8182 --dir .

Sniffing MAC addresses using scapy

$ sudo apt-get install scapy
$ sudo ifconfig wlan0 down
$ sudo iwconfig wlan0 mode monitor
$ sudo iwconfig wlan0 channel 6
$ scapy
>>> def SniffMAC(p):
...   print p
...
>>> sniff(iface="wlan0", prn=SniffMAC)

TODO

  • Either embed the agent in the router directly OR sniff wifi traffic from a separate computer
  • Lock down access to /join and /left
  • Add machine-readable feed handler
  • Graph data

Links

See also