-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use this library connect mqtt websocket and send message? #2808
Comments
I have the same doubt, I see you closed this issue, is it convenient to point it out? |
你好朋友,我在这个库中也没有找到这种方式,所以我去找了另一个库来实现这个需求,然后关闭了这个问题。你可以尝试“mongoose”,它应该可以满足你的需求 |
But there is also a problem with mongoose library, which is that after EMQX is greater than version 3.0, publishing content requires adding fields, otherwise sending will fail |
Okay, thank you very much. |
What was the solution now? I don´t get it? |
i did't solve this problem. i try use the websocketpp lib, while publish/subcribe message, packet by mosquitto,send by websocketpp。 But there are a lot of things that need to be changed here, and the specific changes are all in the company's code. If the project is in the selection stage, it is recommended to choose the MQTT lib with websocket function |
You can see my code repository. it has a test demo to use MQTT lib with websocket function |
Hi, I am now using other MQTT lib to implement this feature. |
Hi, I want to use this library send messages to the mosquitto/emqx or other mqtt library websocket port
my computer system is ubuntu 20.04, mosquitto version is 2.0.15, and my another computer is using EMQX dashboard to subscribe the topic message, look at this EMQX dashboard listeners port
![image](https://private-user-images.githubusercontent.com/84886394/237568320-c991e7bd-0000-4036-b960-11f8c4d704e3.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA5MTE2ODgsIm5iZiI6MTcyMDkxMTM4OCwicGF0aCI6Ii84NDg4NjM5NC8yMzc1NjgzMjAtYzk5MWU3YmQtMDAwMC00MDM2LWI5NjAtMTFmOGM0ZDcwNGUzLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEzVDIyNTYyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTg2MmE0YmVkNjgyYjQ2OTlhNzY4ZTFhNWNkYzA2NGEyOGU4OTM1ZDk3MTM5YmY1YjkzY2MzNjI2ODE1NTQxOWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.mQczhWHzj2HkFMup9T1kc0GlqRbHpgmlhyLhhDCjIBo)
I am a c++ noob, and I have written a publisher demo using the default port of Mosquito, successfully publishing the topic message to EMQX, and EMQX also received the data
EMQX subscribe messages receivced:
![image](https://private-user-images.githubusercontent.com/84886394/237586441-28095ac7-41ee-43ab-b91b-1ce4424025e6.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjA5MTE2ODgsIm5iZiI6MTcyMDkxMTM4OCwicGF0aCI6Ii84NDg4NjM5NC8yMzc1ODY0NDEtMjgwOTVhYzctNDFlZS00M2FiLWI5MWItMWNlNDQyNDAyNWU2LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzEzVDIyNTYyOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTA2MGU2MGFhZmRiZjc0ZTIxZTI0NzIwMDkzY2M5OTZlZjBmYmQzNGE5OTNhNTExMGYwYzU5Y2MzMzdhY2JiNzImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.e3Fvdma4vxGpqt4dXIkMfr7zunrh-fgKnqcAsjBFUjY)
The text was updated successfully, but these errors were encountered: