$(JAVAC) $(JFLAGS) *.java
cp HomeSecurityController.config $(BIN_DIR)/HomeSecurityController
#cp HomeSecurityController.tomoyo $(BIN_DIR)/HomeSecurityController
- cd $(BIN_DIR)/HomeSecurityController; $(JAR) $(JARFLAGS) HomeSecurityController.jar ../HomeSecurityController/HomeSecurityController*.class ../HomeSecurityController/*.class ../iotcode/interfaces/SmartthingsSensor*.class ../iotcode/interfaces/SmartthingsActuator*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Alarm*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/ZoneState*.class ../iotcode/interfaces/Resolution*.class; rm -rf *.class
+ cd $(BIN_DIR)/HomeSecurityController; $(JAR) $(JARFLAGS) HomeSecurityController.jar ../HomeSecurityController/HomeSecurityController*.class ../HomeSecurityController/*.class ../iotcode/interfaces/SmartthingsSensor*.class ../iotcode/interfaces/SmartthingsActuator*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Alarm*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/ZoneState*.class ../iotcode/interfaces/Resolution*.class; mkdir tmp; mv HomeSecurityController.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
PHONY += check-homesecurity
check-homesecurity:
$(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
cp HomeSecurityController.config $(BIN_DIR)/HomeSecurityController
#cp HomeSecurityController.tomoyo $(BIN_DIR)/HomeSecurityController
- cd $(BIN_DIR)/HomeSecurityController; $(JAR) $(JARFLAGS) HomeSecurityController.jar ../HomeSecurityController/HomeSecurityController*.class ../HomeSecurityController/*.class ../iotcode/interfaces/SmartthingsSensor*.class ../iotcode/interfaces/SmartthingsActuator*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Alarm*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/ZoneState*.class ../iotcode/interfaces/Resolution*.class; rm -rf *.class
+ cd $(BIN_DIR)/HomeSecurityController; $(JAR) $(JARFLAGS) HomeSecurityController.jar ../HomeSecurityController/HomeSecurityController*.class ../HomeSecurityController/*.class ../iotcode/interfaces/SmartthingsSensor*.class ../iotcode/interfaces/SmartthingsActuator*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Alarm*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/ZoneState*.class ../iotcode/interfaces/Resolution*.class; mkdir tmp; mv HomeSecurityController.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
.PHONY: $(PHONY)
PHONY += irrigation
irrigation:
$(JAVAC) $(JFLAGS) *.java
- cd $(BIN_DIR)/IrrigationController; $(JAR) $(JARFLAGS) IrrigationController.jar ../IrrigationController/*.class ../iotcode/interfaces/*.class; rm -rf *.class
+ cd $(BIN_DIR)/IrrigationController; $(JAR) $(JARFLAGS) IrrigationController.jar ../IrrigationController/*.class ../iotcode/interfaces/*.class; mkdir tmp; mv IrrigationController.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
cp IrrigationController.config $(BIN_DIR)/IrrigationController
cp IrrigationController.tomoyo $(BIN_DIR)/IrrigationController
cp -rf ./resources ./help_files $(BIN_DIR)/IrrigationController
PHONY += check-irrigation
check-irrigation:
$(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
- cd $(BIN_DIR)/IrrigationController; $(JAR) $(JARFLAGS) IrrigationController.jar ../IrrigationController/*.class ../iotcode/interfaces/*.class; rm -rf *.class
+ cd $(BIN_DIR)/IrrigationController; $(JAR) $(JARFLAGS) IrrigationController.jar ../IrrigationController/*.class ../iotcode/interfaces/*.class; mkdir tmp; mv IrrigationController.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
cp IrrigationController.config $(BIN_DIR)/IrrigationController
cp IrrigationController.tomoyo $(BIN_DIR)/IrrigationController
cp -rf ./resources ./help_files $(BIN_DIR)/IrrigationController
lifxtest:
$(JAVAC) $(JFLAGS) *.java
cp Lifxtest.config $(BIN_DIR)/Lifxtest
- cd $(BIN_DIR)/Lifxtest; $(JAR) $(JARFLAGS) Lifxtest.jar ../Lifxtest/Lifxtest*.class ../Lifxtest/LightBulb*.class ../iotcode/LifxLightBulb/*.class ../iotcode/interfaces/LightBulb*.class; rm -rf *.class
+ cd $(BIN_DIR)/Lifxtest; $(JAR) $(JARFLAGS) Lifxtest.jar ../Lifxtest/Lifxtest*.class ../Lifxtest/LightBulb*.class ../iotcode/LifxLightBulb/*.class ../iotcode/interfaces/LightBulb*.class; mkdir tmp; mv Lifxtest.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
PHONY += check-lifxtest
check-lifxtest:
$(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
cp Lifxtest.config $(BIN_DIR)/Lifxtest
- cd $(BIN_DIR)/Lifxtest; $(JAR) $(JARFLAGS) Lifxtest.jar ../Lifxtest/Lifxtest*.class ../Lifxtest/LightBulb*.class ../iotcode/LifxLightBulb/*.class ../iotcode/interfaces/LightBulb*.class; rm -rf *.class
+ cd $(BIN_DIR)/Lifxtest; $(JAR) $(JARFLAGS) Lifxtest.jar ../Lifxtest/Lifxtest*.class ../Lifxtest/LightBulb*.class ../iotcode/LifxLightBulb/*.class ../iotcode/interfaces/LightBulb*.class; mkdir tmp; mv Lifxtest.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
.PHONY: $(PHONY)
$(JAVAC) $(JFLAGS) *.java
cp SmartLightsController.config $(BIN_DIR)/SmartLightsController
cp SmartLightsController.tomoyo $(BIN_DIR)/SmartLightsController
- cd $(BIN_DIR)/SmartLightsController; $(JAR) $(JARFLAGS) SmartLightsController.jar ../SmartLightsController/SmartLightsController*.class ../SmartLightsController/ColorTemperature*.class ../SmartLightsController/MotionDetection*.class ../SmartLightsController/*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/LightBulb*.class ../iotcode/interfaces/Resolution*.class; rm -rf *.class
+ cd $(BIN_DIR)/SmartLightsController; $(JAR) $(JARFLAGS) SmartLightsController.jar ../SmartLightsController/SmartLightsController*.class ../SmartLightsController/ColorTemperature*.class ../SmartLightsController/MotionDetection*.class ../SmartLightsController/*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/LightBulb*.class ../iotcode/interfaces/Resolution*.class; mkdir tmp; mv SmartLightsController.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
PHONY += check-smartlights
check-smartlights:
$(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
cp SmartLightsController.config $(BIN_DIR)/SmartLightsController
cp SmartLightsController.tomoyo $(BIN_DIR)/SmartLightsController
- cd $(BIN_DIR)/SmartLightsController; $(JAR) $(JARFLAGS) SmartLightsController.jar ../SmartLightsController/SmartLightsController*.class ../SmartLightsController/ColorTemperature*.class ../SmartLightsController/MotionDetection*.class ../SmartLightsController/*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/LightBulb*.class ../iotcode/interfaces/Resolution*.class; rm -rf *.class
+ cd $(BIN_DIR)/SmartLightsController; $(JAR) $(JARFLAGS) SmartLightsController.jar ../SmartLightsController/SmartLightsController*.class ../SmartLightsController/ColorTemperature*.class ../SmartLightsController/MotionDetection*.class ../SmartLightsController/*.class ../iotcode/interfaces/Camera*.class ../iotcode/interfaces/Room*.class ../iotcode/interfaces/LightBulb*.class ../iotcode/interfaces/Resolution*.class; mkdir tmp; mv SmartLightsController.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
.PHONY: $(PHONY)
PHONY += speaker
speaker:
$(JAVAC) $(JFLAGS) *.java
- cd $(BIN_DIR)/SpeakerController; $(JAR) $(JARFLAGS) SpeakerController.jar ../SpeakerController/*.class ../iotcode/interfaces/*.class; rm -rf *.class
+ cd $(BIN_DIR)/SpeakerController; $(JAR) $(JARFLAGS) SpeakerController.jar ../SpeakerController/*.class ../iotcode/interfaces/*.class; mkdir tmp; mv SpeakerController.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
cp SpeakerController.config $(BIN_DIR)/SpeakerController
cp SpeakerController.tomoyo $(BIN_DIR)/SpeakerController
zip -r SpeakerController.zip ./music
PHONY += check-speaker
check-speaker:
$(JAVAC) $(JFLAGS) $(CHECKER_OPT) $(ASTUBS) *.java
- cd $(BIN_DIR)/SpeakerController; $(JAR) $(JARFLAGS) SpeakerController.jar ../SpeakerController/*.class ../iotcode/interfaces/*.class; rm -rf *.class
+ cd $(BIN_DIR)/SpeakerController; $(JAR) $(JARFLAGS) SpeakerController.jar ../SpeakerController/*.class ../iotcode/interfaces/*.class; mkdir tmp; mv SpeakerController.class ./tmp; rm -rf *.class; mv ./tmp/* ./; rm -rf ./tmp
cp SpeakerController.config $(BIN_DIR)/SpeakerController
cp SpeakerController.tomoyo $(BIN_DIR)/SpeakerController
zip -r SpeakerController.zip ./music
$(JAVAC) -classpath .:$(RUNTIMEJARS):$(PHONEJARS):$(ZIPJARS) iotruntime/*.java iotruntime/master/*.java iotruntime/slave/*.java iotruntime/messages/*.java iotruntime/stub/*.java iotruntime/zigbee/*.java -d $(BIN_DIR)
cp ../localconfig/iotruntime/IoTMaster.config $(BIN_DIR)/iotruntime/
cp ../localconfig/iotruntime/IoTSlave.config $(BIN_DIR)/iotruntime/
- #cp ../others/sslkey/*.jks $(BIN_DIR)/iotruntime/
+ cp ../localconfig/iotruntime/*.bash $(BIN_DIR)/iotruntime/
cp -r ../localconfig/mysql $(BIN_DIR)/iotruntime/
cp -r ../localconfig/tomoyo $(BIN_DIR)/iotruntime/
[ -d $(BIN_DIR)/iotruntime/log ] || mkdir $(BIN_DIR)/iotruntime/log
MAC_ADDRESS=74:da:38:68:72:8a
IOT_CODE_PATH=./../iotcode/
CONTROLLERS_CODE_PATH=../
-RUNTIME_DIR=~/iot2/iotjava/iotruntime;
-SLAVE_DIR=~/iot2/iotjava/iotruntime/slave;
-#CLASS_PATH=-cp .:/usr/share/java/*:./../../iotjava/:./../../iotjava/iotruntime/:./../../iotjava/iotinstaller/:./../../iotjava/iotrmi/
-CLASS_PATH=-cp .:/usr/share/java/*:./../:./../iotruntime/:./../iotinstaller/:./../../iotjava/iotrmi/
+RUNTIME_DIR=~/iot2/bin/iotruntime;
+SLAVE_DIR=~/iot2/bin/iotruntime/slave;
+#CLASS_PATH=-cp .:/usr/share/java/*:./../../:./../../iotruntime/:./../../iotinstaller/:./../../iotrmi/
+CLASS_PATH=-cp .:/usr/share/java/*:./../:./../iotruntime/:./../iotinstaller/:./../../iotrmi/
#benchmarks/libs/boofcv_libs/* - we usually put these benchmark codes in /usr/share/java on compute nodes
#benchmarks/libs/georegression_libs/* - we usually put these benchmark codes in /usr/share/java on compute nodes
RMI_HOSTNAME=-Djava.rmi.server.hostname=
LOG_FILE_PATH=log/
USERNAME=iotuser@
-ROUTER_ADD=192.168.2.1
+ROUTER_ADD=192.168.1.1
#The only host that SSH is allowed from to the router
MONITORING_HOST=74:da:38:68:72:8a
HOST=localhost
DATABASE=IoTMain
USERNAME=root
-PASSWORD=root
+PASSWORD=1234
--- /dev/null
+#!/bin/bash
+# Clean the master Raspberry Pi
+echo "Cleaning master!"
+rm -rf *.jar
+rm -rf log/*
+rm -rf *.zip
+rm -rf *.policy
+rm -rf *.sh
+rm -rf *.tomoyo.pol
+rm -rf help_files/ resources/ music/
+cd slave/; rm -rf *.so; rm -rf *.zip; rm -rf *.log;
+sudo pkill -f Djava
+sudo pkill -f IoTSlave
+sudo iptables -F
+sudo tomoyo-loadpolicy -df < /home/iotuser/iot2/bin/iotruntime/clear.tomoyo
+echo "Master cleaned!"
+
+# Clean the slave(s) and router
+SLAVE1="192.168.1.101"
+ROUTER="192.168.1.1"
+RUNTIME_PATH="/home/iotuser/iot2/bin/iotruntime/"
+echo "Cleaning slave!"
+ssh iotuser@$SLAVE1 "cd $RUNTIME_PATH; rm -rf *.sh; rm -rf help_files/; rm -rf music/; rm -rf *.jar;rm -rf log/*; rm -rf *.zip; sudo pkill -f Djava; rm -rf resources/"
+ssh iotuser@$SLAVE1 "cd $RUNTIME_PATH/slave/; rm -rf *.so; rm -rf *.zip; rm -rf *.log;"
+echo "Slave benchmark files cleaned!"
+ssh iotuser@$SLAVE1 "sudo iptables -F"
+echo "Slave iptables cleaned!"
+ssh iotuser@$SLAVE1 "sudo pkill -f IoTSlave"
+echo "Slave processes killed!"
+ssh iotuser@$SLAVE1 "sudo tomoyo-loadpolicy -df < $RUNTIME_PATH/clear.tomoyo"
+echo "Slave process jailer cleaned!"
+
+ssh root@$ROUTER "cd /root/setup; ./clean; ./startup.sh"
+echo "Router cleaned!"
--- /dev/null
+#!/bin/bash
+
+#java -cp .:/usr/share/java/*:./../:./../iotcode/:./../iotcode/Lifxtest/ iotruntime.master.IoTMaster Lifxtest
+java -cp .:/usr/share/java/*:./../:./../iotcode/:./../iotcode/Lifxtest/ iotruntime.master.IoTMaster SmartLightsController
+#java -cp .:/usr/share/java/*:./../:./../iotcode/:./../iotcode/Lifxtest/ iotruntime.master.IoTMaster IrrigationController
+#java -cp .:/usr/share/java/*:./../:./../iotcode/:./../iotcode/Lifxtest/ iotruntime.master.IoTMaster SpeakerController
+#java -cp .:/usr/share/java/*:./../:./../iotcode/:./../iotcode/Lifxtest/ iotruntime.master.IoTMaster HomeSecurityController
+
+# Combination
+#java -cp .:/usr/share/java/*:./../:./../iotcode/:./../iotcode/Lifxtest/ iotruntime.master.IoTMaster HomeSecurityController SmartLightsController SpeakerController IrrigationController
-SELECT * FROM
-CameraSmart
-WHERE
-ID='CM1'
-;
+SELECT * FROM\r
+CameraSmart\r
+WHERE\r
+ID='CM1'\r
+;\r
SELECT * FROM
LightBulb
-WHERE
-ID='LB1'
;
-