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


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





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


  • Deploy to xinchejian.com


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)
.	 index of wireless client (if there are many clients each will have index 1-x)	 integer	 1
.	 Associated MAC	 text	 00:ff:as:dd:44:55
.	 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.


  • 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 --user root --password_filename /opt/wifi/router.passwd --server localhost --port 8080


 /opt/motion/motion.py --server --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)


  • 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


See also