From f0fc1c585c13f21927c9e1d43ff4bdc91090e2d8 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Wed, 21 Nov 2018 13:13:49 -0800 Subject: [PATCH] Adding new smart home devices into the experiment. --- .../main/java/edu/uci/iotproject/Main.java | 26 +++++++--- .../detection/SignatureDetector.java | 43 +++++++++++----- python_ml/validate-detection.py | 50 +++++++------------ 3 files changed, 68 insertions(+), 51 deletions(-) diff --git a/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Main.java b/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Main.java index 820ade0..df93a9f 100644 --- a/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Main.java +++ b/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/Main.java @@ -114,6 +114,12 @@ public class Main { // final String outputPcapFile = path + "/2018-07/wemo/wemo-processed.pcap"; // final String triggerTimesFile = path + "/2018-07/wemo/wemo-july-30-2018.timestamps"; // final String deviceIp = "192.168.1.145"; // .246 == phone; .145 == WeMo + // TODO: EXPERIMENT - November 20, 2018 + final String inputPcapFile = path + "/experimental_result/standalone/wemo-plug/wlan1/wemo-plug.wlan1.local.pcap"; + final String outputPcapFile = path + "/experimental_result/standalone/wemo-plug/wlan1/wemo-plug-processed.pcap"; + final String triggerTimesFile = path + "/experimental_result/standalone/wemo-plug/timestamps/wemo-plug-nov-20-2018.timestamps"; +// final String deviceIp = "192.168.1.145"; // .246 == phone; .145 == WeMo + final String deviceIp = "192.168.1.246"; // .246 == phone; .145 == WeMo // 5) Wemo Insight July 31 experiment // final String inputPcapFile = path + "/2018-07/wemoinsight/wemoinsight.wlan1.local.pcap"; @@ -127,13 +133,13 @@ public class Main { // final String triggerTimesFile = path + "/2018-08/tplink-bulb/tplink-bulb-aug-3-2018.timestamps"; // final String deviceIp = "192.168.1.246"; // .246 == phone; .140 == TP-Link bulb // TODO: EXPERIMENT - November 16, 2018 - final String inputPcapFile = path + "/experimental_result/standalone/tplink-bulb/wlan1/tplink-bulb.wlan1.local.pcap"; - final String outputPcapFile = path + "/experimental_result/standalone/tplink-bulb/wlan1/tplink-bulb-processed.pcap"; -// final String inputPcapFile = path + "/experimental_result/standalone/tplink-bulb/eth0/tplink-bulb.eth1.local.pcap"; -// final String outputPcapFile = path + "/experimental_result/standalone/tplink-bulb/eth0/tplink-bulb-processed.pcap"; - final String triggerTimesFile = path + "/experimental_result/standalone/tplink-bulb/timestamps/tplink-bulb-nov-16-2018.timestamps"; -// final String deviceIp = "192.168.1.140"; // .246 == phone; .140 == TP-Link bulb - final String deviceIp = "192.168.1.246"; // .246 == phone; .140 == TP-Link bulb +// final String inputPcapFile = path + "/experimental_result/standalone/tplink-bulb/wlan1/tplink-bulb.wlan1.local.pcap"; +// final String outputPcapFile = path + "/experimental_result/standalone/tplink-bulb/wlan1/tplink-bulb-processed.pcap"; +//// final String inputPcapFile = path + "/experimental_result/standalone/tplink-bulb/eth0/tplink-bulb.eth1.local.pcap"; +//// final String outputPcapFile = path + "/experimental_result/standalone/tplink-bulb/eth0/tplink-bulb-processed.pcap"; +// final String triggerTimesFile = path + "/experimental_result/standalone/tplink-bulb/timestamps/tplink-bulb-nov-16-2018.timestamps"; +//// final String deviceIp = "192.168.1.140"; // .246 == phone; .140 == TP-Link bulb +// final String deviceIp = "192.168.1.246"; // .246 == phone; .140 == TP-Link bulb // 7) Kwikset Doorlock August 6 experiment // final String inputPcapFile = path + "/2018-08/kwikset-doorlock/kwikset-doorlock.data.wlan1.pcap"; @@ -167,6 +173,12 @@ public class Main { // final String inputPcapFile = path + "/2018-10/hue-bulb/hue-bulb.wlan1.local.pcap"; // final String outputPcapFile = path + "/2018-10/hue-bulb/hue-bulb-processed.pcap"; // final String triggerTimesFile = path + "/2018-10/hue-bulb/hue-bulb-oct-30-2018.timestamps"; +// final String deviceIp = "192.168.1.246"; // .246 == phone; .100 == Hue hub + // TODO: EXPERIMENT - November 19, 2018 +// final String inputPcapFile = path + "/experimental_result/standalone/hue-bulb/wlan1/hue-bulb.wlan1.local.pcap"; +// final String outputPcapFile = path + "/experimental_result/standalone/hue-bulb/wlan1/hue-bulb-processed.pcap"; +// final String triggerTimesFile = path + "/experimental_result/standalone/hue-bulb/timestamps/hue-bulb-nov-19-2018.timestamps"; +// final String deviceIp = "192.168.1.100"; // .246 == phone; .100 == Hue hub // final String deviceIp = "192.168.1.246"; // .246 == phone; .100 == Hue hub // 9) Lifx Bulb August 8 experiment diff --git a/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/detection/SignatureDetector.java b/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/detection/SignatureDetector.java index bc7ef02..7ff42b1 100644 --- a/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/detection/SignatureDetector.java +++ b/Code/Projects/SmartPlugDetector/src/main/java/edu/uci/iotproject/detection/SignatureDetector.java @@ -43,6 +43,12 @@ public class SignatureDetector implements PacketListener, ClusterMatcher.Cluster // D-Link Siren PHONE signatures // final String onSignatureFile = path + "/2018-08/dlink-siren/onSignature-DLink-Siren-phone.sig"; // final String offSignatureFile = path + "/2018-08/dlink-siren/offSignature-DLink-Siren-phone.sig"; + // TODO: EXPERIMENT - November 19, 2018 + // Hue Bulb experiment +// final String inputPcapFile = path + "/2018-08/hue-bulb/hue-bulb.wlan1.local.pcap"; + // Hue Bulb PHONE signatures +// final String onSignatureFile = path + "/experimental_result/standalone/hue-bulb/signatures/hue-bulb-onSignature-phone-side.sig"; +// final String offSignatureFile = path + "/experimental_result/standalone/hue-bulb/signatures/hue-bulb-offSignature-phone-side.sig"; /* // Kwikset Doorlock Sep 12 experiment @@ -65,15 +71,15 @@ public class SignatureDetector implements PacketListener, ClusterMatcher.Cluster // final String offSignatureFile = path + "/2018-07/dlink/offSignature-DLink-Plug-phone.sig"; // TODO: The following are negative tests against the PCAP file from UNSW - /* final String inputPcapFile = path + "/UNSW/16-09-28.pcap"; TODO: Seems to be broken! */ - /* final String inputPcapFile = path + "/UNSW/16-10-02.pcap"; TODO: Seems to be broken! */ - /* final String inputPcapFile = path + "/UNSW/16-10-03.pcap"; TODO: Seems to be broken! */ - /* final String inputPcapFile = path + "/UNSW/16-10-04.pcap"; TODO: Seems to be broken! */ - /* final String inputPcapFile = path + "/UNSW/16-10-07.pcap"; TODO: Seems to be broken! */ - /* final String inputPcapFile = path + "/UNSW/16-10-08.pcap"; TODO: Seems to be broken! */ - /* final String inputPcapFile = path + "/UNSW/16-10-09.pcap"; TODO: Seems to be broken! */ - /* final String inputPcapFile = path + "/UNSW/16-10-10.pcap"; TODO: Seems to be broken! */ - /* final String inputPcapFile = path + "/UNSW/16-10-11.pcap"; TODO: Seems to be broken! */ +// final String inputPcapFile = path + "/UNSW/16-09-28.pcap"; // TODO: Seems to be broken! +// final String inputPcapFile = path + "/UNSW/16-10-02.pcap"; // TODO: Seems to be broken! +// final String inputPcapFile = path + "/UNSW/16-10-03.pcap"; // TODO: Seems to be broken! +// final String inputPcapFile = path + "/UNSW/16-10-04.pcap"; // TODO: Seems to be broken! +// final String inputPcapFile = path + "/UNSW/16-10-07.pcap"; // TODO: Seems to be broken! +// final String inputPcapFile = path + "/UNSW/16-10-08.pcap"; // TODO: Seems to be broken! +// final String inputPcapFile = path + "/UNSW/16-10-09.pcap"; // TODO: Seems to be broken! +// final String inputPcapFile = path + "/UNSW/16-10-10.pcap"; // TODO: Seems to be broken! +// final String inputPcapFile = path + "/UNSW/16-10-11.pcap"; // TODO: Seems to be broken! // final String inputPcapFile = path + "/UNSW/16-09-23.pcap"; @@ -238,13 +244,13 @@ public class SignatureDetector implements PacketListener, ClusterMatcher.Cluster // final String offSignatureFile = path + "/training/tplink-bulb/signatures/tplink-bulb-offSignature-phone-side.sig"; // TODO: EXPERIMENT - November 16, 2018 // TP-Link Bulb experiment - final String inputPcapFile = path + "/experimental_result/standalone/tplink-bulb/wlan1/tplink-bulb.wlan1.local.pcap"; +// final String inputPcapFile = path + "/experimental_result/standalone/tplink-bulb/wlan1/tplink-bulb.wlan1.local.pcap"; // final String inputPcapFile = path + "/experimental_result/standalone/tplink-bulb/eth0/tplink-bulb.eth0.local.pcap"; // final String inputPcapFile = path + "/experimental_result/smarthome/tplink-bulb/wlan1/tplink-bulb.wlan1.detection.pcap"; -// final String inputPcapFile = path + "/experimental_result/smarthome/tplink-bulb/eth0/tplink-bulb.eth0.detection.pcap"; +//// final String inputPcapFile = path + "/experimental_result/smarthome/tplink-bulb/eth0/tplink-bulb.eth0.detection.pcap"; // // TP-Link Bulb PHONE signatures - final String onSignatureFile = path + "/experimental_result/standalone/tplink-bulb/signatures/tplink-bulb-onSignature-phone-side.sig"; - final String offSignatureFile = path + "/experimental_result/standalone/tplink-bulb/signatures/tplink-bulb-offSignature-phone-side.sig"; +// final String onSignatureFile = path + "/experimental_result/standalone/tplink-bulb/signatures/tplink-bulb-onSignature-phone-side.sig"; +// final String offSignatureFile = path + "/experimental_result/standalone/tplink-bulb/signatures/tplink-bulb-offSignature-phone-side.sig"; /* // WeMo Plug experiment @@ -253,6 +259,17 @@ public class SignatureDetector implements PacketListener, ClusterMatcher.Cluster final String onSignatureFile = path + "/training/wemo-plug/signatures/wemo-plug-onSignature-device-side.sig"; final String offSignatureFile = path + "/training/wemo-plug/signatures/wemo-plug-offSignature-device-side.sig"; */ + // TODO: EXPERIMENT - November 20, 2018 + // WeMo Plug experiment +// final String inputPcapFile = path + "/experimental_result/standalone/wemo-plug/wlan1/wemo-plug.wlan1.local.pcap"; +// final String inputPcapFile = path + "/experimental_result/standalone/wemo-plug/eth0/wemo-plug.eth0.local.pcap"; + // TODO: WE HAVE 4 ADDITIONAL EVENTS (TRIGGERED MANUALLY), SO WE JUST IGNORE THEM BECAUSE THEY HAPPENED BEFORE + // TODO: THE ACTUAL TRIGGERS + final String inputPcapFile = path + "/experimental_result/smarthome/wemo-plug/wlan1/wemo-plug.wlan1.detection.pcap"; +// final String inputPcapFile = path + "/experimental_result/smarthome/wemo-plug/eth0/wemo-plug.eth0.detection.pcap"; + // WeMo Plug PHONE signatures + final String onSignatureFile = path + "/experimental_result/standalone/wemo-plug/signatures/wemo-plug-onSignature-phone-side.sig"; + final String offSignatureFile = path + "/experimental_result/standalone/wemo-plug/signatures/wemo-plug-offSignature-phone-side.sig"; /* // WeMo Insight Plug experiment diff --git a/python_ml/validate-detection.py b/python_ml/validate-detection.py index 0160359..8154de7 100644 --- a/python_ml/validate-detection.py +++ b/python_ml/validate-detection.py @@ -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" @@ -59,42 +59,30 @@ path = "/scratch/July-2018/experimental_result/standalone/" #device = "nest-thermostat/self-test" #fileExperiment = "nest-thermostat-nov-15-2018.timestamps" #fileDetection = "phone-side-detection" -device = "nest-thermostat/timestamps" -fileExperiment = "nest-thermostat-smarthome-nov-16-2018.timestamps" -fileDetection = "nest-thermostat-smarthome-nov-16-2018.phone.eth0.detections" +#device = "nest-thermostat/timestamps" +#fileExperiment = "nest-thermostat-smarthome-nov-16-2018.timestamps" +#fileDetection = "nest-thermostat-smarthome-nov-16-2018.phone.eth0.detections" # TP-Link Bulb -device = "tplink-bulb/self-test" -fileExperiment = "tplink-bulb-nov-16-2018.timestamps" -fileDetection = "phone-side-detection" +#device = "tplink-bulb/self-test" +#fileExperiment = "tplink-bulb-nov-16-2018.timestamps" +#fileDetection = "phone-side-detection" #device = "tplink-bulb/timestamps" -#fileExperiment = "tplink-bulb-smarthome-nov-16-2018.timestamps" -#fileDetection = "tplink-bulb-smarthome-nov-16-2018.phone.eth0.detections" +#fileExperiment = "tplink-bulb-smarthome-nov-19-2018.timestamps" +#fileDetection = "tplink-bulb-smarthome-nov-19-2018.phone.wlan1.detections" -# Arlo camera -#device = "arlo-camera/self-test" -#fileExperiment = "arlo-camera-aug-10-2018.timestamps" -#fileDetection = "detection-on-training-phone-side" -# Blossom sprinkler -#device = "blossom-sprinkler/self-test" -#fileExperiment = "blossom-sprinkler-aug-13-2018.timestamps" -#fileDetection = "detection-on-training-device-side" -# Nest thermostat -#device = "nest-thermostat/self-test" -#fileExperiment = "nest-aug-15-2018.timestamps" -#fileDetection = "detection-on-training-phone-side" # Hue bulb #device = "hue-bulb/self-test" #fileExperiment = "hue-bulb-aug-7-2018.timestamps" -#fileDetection = "detection-on-training-phone-side" -# TPLink bulb -#device = "tplink-bulb/self-test" -#fileExperiment = "tplink-bulb-aug-3-2018.timestamps" -#fileDetection = "detection-on-training-phone-side" -# WeMo Insight Plug -#device = "wemo-insight-plug/self-test" -#fileExperiment = "wemo-insight-july-31-2018.timestamps" -#fileDetection = "detection-on-training-device-side" +#fileDetection = "phone-side-detection" + +# WeMo plug +#device = "wemo-plug/self-test" +#fileExperiment = "wemo-plug-nov-20-2018.timestamps" +#fileDetection = "phone-side-detection" +device = "wemo-plug/timestamps" +fileExperiment = "wemo-plug-smarthome-nov-21-2018.timestamps" +fileDetection = "wemo-plug-smarthome-nov-21-2018.phone.wlan1.detections" TIME_WINDOW = 15 # detection/signature window of 15 seconds #NEG_TIME_WINDOW = -15 # detection/signature window of 15 seconds -- 2.34.1