Skip to content

JasonkayZK/cpp-learn

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QT-MQTT

A branch to show how to embed qtmqtt into a Qt project.

References

Requirements

Dependencies:

  • Qt 6
  • Vcpkg
    • qtmqtt

Server:

How to use

First, import and build the project.


Start MQTT Broker:

https://github.com/JasonkayZK/docker-repo/blob/master/eclipse-mosquitto.sh

docker run -itd --restart=always -p 1883:1883 -p 9001:9001 --name my-eclipse-mosquitto eclipse-mosquitto

###### In Container ######
## Create user & passwd
## https://mosquitto.org/documentation/authentication-methods/
docker exec -it my-eclipse-mosquitto /bin/sh
cd /mosquitto
mosquitto_passwd -c password_file <username>
## Input passwd ...

## Change config
vi /mosquitto/config/mosquitto.conf
### listener 1883
### password_file /mosquitto/password_file

# Restart containner
docker restart my-eclipse-mosquitto

Start two application, and push 开始连接服务器

image-20240307221828029

一端设置监听 Topic:

image-20240307221918304

另一端在对应主题发送内容:

image-20240307222007448

About

A repo to learn c++

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors