Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
monticore
EmbeddedMontiArc
generators
EMAM2MQTT
Commits
3ea4ad99
Commit
3ea4ad99
authored
Jun 03, 2019
by
Georg Vinogradov
Browse files
Update README.md
parent
7756cd89
Pipeline
#146517
passed with stage
in 42 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
3ea4ad99
...
...
@@ -46,4 +46,45 @@ Install mosquitto and mosquitto-clients
Restart your computer
Mosquitto is now available and can be accessed via command line using
`mosquitto -h`
\ No newline at end of file
Mosquitto is now available and can be accessed via command line using
`mosquitto -h`
### Installing MQTT libraries (locally on Ubuntu)
Open terminal and run
`sudo apt-get install build-essential gcc make cmake cmake-gui cmake-curses-gui`
#### Installing PahoMQTT C library
run
```
bash
git clone https://github.com/eclipse/paho.mqtt.c.git
cd
paho.mqtt.c
git checkout v1.2.1
cmake
-Bbuild
-H
.
-DPAHO_WITH_SSL
=
ON
sudo
cmake
--build
build/
--target
install
sudo
ldconfig
```
#### Installing PahoMQTT C++ library
**after**
installation of C library run
```
bash
git clone https://github.com/eclipse/paho.mqtt.cpp
cd
paho.mqtt.cpp
cmake
-Bbuild
-H
.
sudo
cmake
--build
build/
--target
install
```
### Installing MQTT Publisher/Subscriber demo
open terminal, go to
**mqtt_demo**
directroy inside the project and run
`cmake .`
compile the project by running
`make`
run the project afterwards with
`./mqtt_demo`
---
additionaly, you can also use
`mosquitto_pub`
and
`mosquitto_sub`
commands from mosquitto broker to subscribe/publish messages
for example:
subscribe to topic
**/hello**
with
`mosquitto_sub -t /hello`
and publish a message to this topic with
`mosquitto_pub -t /hello -m "hi, how are you?"`
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