Adding more devices into the experimental setup.
authorrtrimana <rtrimana@uci.edu>
Tue, 13 Nov 2018 23:38:25 +0000 (15:38 -0800)
committerrtrimana <rtrimana@uci.edu>
Tue, 13 Nov 2018 23:38:25 +0000 (15:38 -0800)
Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Main.java
Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/detection/SignatureDetector.java
python_ml/validate-detection.py

index 55e5757..9b7a417 100644 (file)
@@ -100,6 +100,14 @@ public class Main {
 //        final String outputPcapFile = path + "/2018-10/st-plug/st-plug-processed.pcap";
 //        final String triggerTimesFile = path + "/2018-10/st-plug/st-plug-oct-18-2018.timestamps";
 //        final String deviceIp = "192.168.1.246"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
+        // TODO: EXPERIMENT - November 12, 2018
+        final String inputPcapFile = path + "/experimental_result/standalone/st-plug/wlan1/st-plug.wlan1.local.pcap";
+        final String outputPcapFile = path + "/experimental_result/standalone/st-plug/wlan1/st-plug-processed.pcap";
+//        final String inputPcapFile = path + "/experimental_result/standalone/st-plug/eth1/st-plug.eth1.local.pcap";
+//        final String outputPcapFile = path + "/experimental_result/standalone/st-plug/eth1/st-plug-processed.pcap";
+        final String triggerTimesFile = path + "/experimental_result/standalone/st-plug/timestamps/st-plug-nov-12-2018.timestamps";
+//        final String deviceIp = "192.168.1.142"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
+        final String deviceIp = "192.168.1.246"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
 
         // 4) Wemo July 30 experiment
 //        final String inputPcapFile = path + "/2018-07/wemo/wemo.wlan1.local.pcap";
@@ -127,13 +135,13 @@ public class Main {
 //        final String triggerTimesFile = path + "/2018-08/kwikset-doorlock/kwikset-doorlock-8hr-data-oct-11-2018.timestamps";
 //        final String deviceIp = "192.168.1.246"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
         // TODO: EXPERIMENT - November 10, 2018
-        final String inputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/wlan1/kwikset-doorlock.wlan1.local.pcap";
-        final String outputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/wlan1/kwikset-doorlock-processed.pcap";
-//        final String inputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/eth1/kwikset-doorlock.eth1.local.pcap";
-//        final String outputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/eth1/kwikset-doorlock-processed.pcap";
-        final String triggerTimesFile = path + "/experimental_result/standalone/kwikset-doorlock/timestamps/kwikset-doorlock-nov-10-2018.timestamps";
-//        final String deviceIp = "192.168.1.183"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
-        final String deviceIp = "192.168.1.246"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
+//        final String inputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/wlan1/kwikset-doorlock.wlan1.local.pcap";
+//        final String outputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/wlan1/kwikset-doorlock-processed.pcap";
+////        final String inputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/eth1/kwikset-doorlock.eth1.local.pcap";
+////        final String outputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/eth1/kwikset-doorlock-processed.pcap";
+//        final String triggerTimesFile = path + "/experimental_result/standalone/kwikset-doorlock/timestamps/kwikset-doorlock-nov-10-2018.timestamps";
+////        final String deviceIp = "192.168.1.142"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
+//        final String deviceIp = "192.168.1.246"; // .246 == phone; .142 == SmartThings Hub (note: use eth0 capture for this!)
 
         // September 12, 2018 - includes both wlan1 and eth1 interfaces
 //        final String inputPcapFile = path + "/2018-08/kwikset-doorlock/kwikset3.wlan1.local.pcap";
index 0bc0e76..a5e823f 100644 (file)
@@ -78,7 +78,7 @@ public class SignatureDetector implements PacketListener, ClusterMatcher.Cluster
 
 //        final String inputPcapFile = path + "/UNSW/16-09-23.pcap";
 //        final String inputPcapFile = path + "/UNSW/16-09-24.pcap";
-//        final String inputPcapFile = path + "/UNSW/16-09-25.pcap";
+        final String inputPcapFile = path + "/UNSW/16-09-25.pcap";
 //        final String inputPcapFile = path + "/UNSW/16-09-26.pcap";
 //        final String inputPcapFile = path + "/UNSW/16-09-27.pcap";
 //        final String inputPcapFile = path + "/UNSW/16-09-29.pcap";
@@ -164,6 +164,15 @@ public class SignatureDetector implements PacketListener, ClusterMatcher.Cluster
 //        // TP-Link Plug PHONE signatures
 //        final String onSignatureFile = path + "/training/st-plug/signatures/st-plug-onSignature-phone-side.sig";
 //        final String offSignatureFile = path + "/training/st-plug/signatures/st-plug-offSignature-phone-side.sig";
+        // TODO: EXPERIMENT - November 12, 2018
+        // SmartThings Plug experiment
+//        final String inputPcapFile = path + "/experimental_result/standalone/st-plug/wlan1/st-plug.wlan1.local.pcap";
+//        final String inputPcapFile = path + "/experimental_result/standalone/st-plug/eth0/st-plug.eth0.local.pcap";
+//        //final String inputPcapFile = path + "/experimental_result/smarthome/st-plug/wlan1/st-plug.wlan1.detection.pcap";
+//        final String inputPcapFile = path + "/experimental_result/smarthome/st-plug/eth0/st-plug.eth0.detection.pcap";
+//        // SmartThings Plug PHONE signatures
+        final String onSignatureFile = path + "/experimental_result/standalone/st-plug/signatures/st-plug-onSignature-phone-side.sig";
+        final String offSignatureFile = path + "/experimental_result/standalone/st-plug/signatures/st-plug-offSignature-phone-side.sig";
 
 
         // LiFX Bulb experiment
@@ -236,8 +245,8 @@ public class SignatureDetector implements PacketListener, ClusterMatcher.Cluster
         // Kwikset Door lock experiment
 //        final String inputPcapFile = path + "/experimental_result/standalone/kwikset-doorlock/wlan1/kwikset-doorlock.wlan1.local.pcap";
 //        //final String inputPcapFile = path + "/experimental_result/smarthome/kwikset-doorlock/wlan1/kwikset-doorlock.wlan1.detection.pcap";
-////        final String inputPcapFile = path + "/experimental_result/smarthome/kwikset-doorlock/eth0/kwikset-doorlock.eth0.detection.pcap";
-//        // Kwikset Door lock PHONE signatures
+//        final String inputPcapFile = path + "/experimental_result/smarthome/kwikset-doorlock/eth0/kwikset-doorlock.eth0.detection.pcap";
+////        // Kwikset Door lock PHONE signatures
 //        final String onSignatureFile = path + "/experimental_result/standalone/kwikset-doorlock/signatures/kwikset-doorlock-onSignature-phone-side.sig";
 //        final String offSignatureFile = path + "/experimental_result/standalone/kwikset-doorlock/signatures/kwikset-doorlock-offSignature-phone-side.sig";
 
@@ -293,10 +302,10 @@ public class SignatureDetector implements PacketListener, ClusterMatcher.Cluster
             PcapPacket firstPkt = match.get(0).get(0);
             detectedEvents.add(new UserAction(UserAction.Type.TOGGLE_ON, firstPkt.getTimestamp()));
         });
-        offDetector.addObserver((searched, match) -> {
-            PcapPacket firstPkt = match.get(0).get(0);
-            detectedEvents.add(new UserAction(UserAction.Type.TOGGLE_OFF, firstPkt.getTimestamp()));
-        });
+//        offDetector.addObserver((searched, match) -> {
+//            PcapPacket firstPkt = match.get(0).get(0);
+//            detectedEvents.add(new UserAction(UserAction.Type.TOGGLE_OFF, firstPkt.getTimestamp()));
+//        });
 
         PcapHandle handle;
         try {
@@ -309,7 +318,7 @@ public class SignatureDetector implements PacketListener, ClusterMatcher.Cluster
 
         // TODO: need a better way of triggering detection than this...
         onDetector.mClusterMatchers.forEach(cm -> cm.performDetection());
-        offDetector.mClusterMatchers.forEach(cm -> cm.performDetection());
+//        offDetector.mClusterMatchers.forEach(cm -> cm.performDetection());
 
         // Sort the list of detected events by timestamp to make it easier to compare it line-by-line with the trigger
         // times file.
index f4a0987..4c23c90 100644 (file)
@@ -1,7 +1,7 @@
 from datetime import datetime
 
-#path = "/scratch/July-2018/experimental_result/smarthome/"
-path = "/scratch/July-2018/experimental_result/standalone/"
+path = "/scratch/July-2018/experimental_result/smarthome/"
+#path = "/scratch/July-2018/experimental_result/standalone/"
 # D-Link plug
 #device = "dlink-plug/self-test"
 #fileExperiment = "dlink-plug-nov-7-2018.timestamps"
@@ -27,18 +27,27 @@ path = "/scratch/July-2018/experimental_result/standalone/"
 #device = "dlink-siren/self-test"
 #fileExperiment = "dlink-siren-nov-9-2018.timestamps"
 #fileDetection = "phone-side-detection"
-device = "dlink-siren/timestamps"
-fileExperiment = "dlink-siren-smarthome-nov-10-2018.timestamps"
-fileDetection = "dlink-siren-smarthome-nov-10-2018.eth0.phone.detections"
+#device = "dlink-siren/timestamps"
+#fileExperiment = "dlink-siren-smarthome-nov-10-2018.timestamps"
+#fileDetection = "dlink-siren-smarthome-nov-10-2018.eth0.phone.detections"
 
 # Kwikset door lock
-device = "kwikset-doorlock/self-test"
-fileExperiment = "kwikset-doorlock-nov-10-2018.timestamps"
-fileDetection = "phone-side-detection"
+#device = "kwikset-doorlock/self-test"
+#fileExperiment = "kwikset-doorlock-nov-10-2018.timestamps"
+#fileDetection = "phone-side-detection"
 #device = "kwikset-doorlock/timestamps"
 #fileExperiment = "kwikset-doorlock-smarthome-nov-10-2018.timestamps"
 #fileDetection = "kwikset-doorlock-smarthome-nov-10-2018.eth0.phone.detections"
 
+# SmartThings plug
+#device = "st-plug/self-test"
+#fileExperiment = "st-plug-nov-13-2018.timestamps"
+#fileDetection = "phone-side-detection"
+device = "st-plug/timestamps"
+fileExperiment = "st-plug-smarthome-nov-13-2018.timestamps"
+fileDetection = "st-plug-smarthome-nov-13-2018.eth0.phone.detections"
+
+
 # Arlo camera
 #device = "arlo-camera/self-test"
 #fileExperiment = "arlo-camera-aug-10-2018.timestamps"