Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
setup_REST_MQTT
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Riccardo Presotto
setup_REST_MQTT
Commits
0b4295d8
Commit
0b4295d8
authored
Apr 02, 2021
by
Luca Arrotta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
README added
parent
08bdae2c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
44 additions
and
6 deletions
+44
-6
vcs.xml
.idea/vcs.xml
+6
-0
README.md
README.md
+31
-1
img_1.png
assets/img_1.png
+0
-0
img_2.jpeg
assets/img_2.jpeg
+0
-0
build.gradle
build.gradle
+7
-5
No files found.
.idea/vcs.xml
0 → 100644
View file @
0b4295d8
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</project>
\ No newline at end of file
README.md
View file @
0b4295d8
# 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
<img
src =
'./assets/img_1.png'
>
*
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:
<img
src =
'./assets/img_2.jpeg'
>
## 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/*
assets/img_1.png
0 → 100644
View file @
0b4295d8
6.54 KB
assets/img_2.jpeg
0 → 100644
View file @
0b4295d8
13.5 KB
build.gradle
View file @
0b4295d8
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment