diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000000000000000000000000000000000000..94a25f7f4cb416c083d265558da75d457237d671 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/README.md b/README.md index 1c85eec66111737e65a7a59f83e9440153d92b93..66a8ce4b163b07e829e04880744da3af06dc0896 100644 --- a/README.md +++ b/README.md @@ -1 +1,31 @@ -# Setup REST and MQTT \ No newline at end of file +# Setup REST and MQTT + + + +* You can import the project directly from a **V**ersion **C**ontrol **S**ystem, by providing the following URL: +https://ewserver.di.unimi.it/gitlab/riccardopresotto/setup\_test_sdp.git + + + + +* Otherwise, take care to import the project as a Gradle Project + +## REST + +* Run StartServer.java located in: *REST\_MQTT_example/src/main/java/REST/* +* Use a REST Client application (i.e., Advanced REST Client) to test if the server works correctly +* For example you can run the following request: + + + + +## MQTT +* Dowload and install the Mosquitto broker from here: *https://mosquitto.org/download/* +* Run the Mosquitto broker: + * **MacOS** + - brew services start mosquitto + - mosquitto_sub -h localhost -v -t ‘#’ *(Instead ‘#’ specify the topics of interest)* + * **Windows** + - Run the file mosquitto.exe + +* Run SubExample.java and PubExample.java located in *REST\_MQTT_example/src/main/java/MQTT/* diff --git a/assets/img_1.png b/assets/img_1.png new file mode 100644 index 0000000000000000000000000000000000000000..16e037f7465055058b4180c00502de6d8a1fb4b1 Binary files /dev/null and b/assets/img_1.png differ diff --git a/assets/img_2.jpeg b/assets/img_2.jpeg new file mode 100644 index 0000000000000000000000000000000000000000..3d3cf89590e51a66dd8ac91f0260fe35fc8bcfd3 Binary files /dev/null and b/assets/img_2.jpeg differ diff --git a/build.gradle b/build.gradle index 54ef977ae52f49e90a169b01b086ebbc559a60dd..282cd8e17d4e9421b1efd32de607828eebe80a1b 100644 --- a/build.gradle +++ b/build.gradle @@ -15,7 +15,8 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter-api:5.6.0' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' - //start GRPC + // GRPC Dependencies + /* // https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java compile group: 'com.google.protobuf', name: 'protobuf-java', version: '3.10.0' @@ -48,17 +49,18 @@ dependencies { compile group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1' // https://mvnrepository.com/artifact/com.sun.jersey/jersey-server compile group: 'com.sun.jersey', name: 'jersey-server', version: '1.2' - //end REST + */ - //start MQTT + + // MQTT Dependencies // https://mvnrepository.com/artifact/org.eclipse.paho/org.eclipse.paho.client.mqttv3 compile group: 'org.eclipse.paho', name: 'org.eclipse.paho.client.mqttv3', version: '1.2.5' //end MQTT } -//start GRPC +/* GRPC stuff sourceSets { main { java { @@ -86,7 +88,7 @@ protobuf { } } -//end GRPC +*/ test {