mqtt communication - Page 1
Forum section: electronics / general

author: BlogRahul
author_rank: Regular Contributor
timestamp: May 31, 2022, 09:53:34 am
content: I am trying to understand mqtt communication. I have installed mosquitto mqtt and it's running on widows 10 PC. I have also installed paho mqtt on my window PC. PythonI understand MQTT broker is a server. It provides socket connections and services. There are MQTT clients. These can publish topics or subscribe to topics or both.https://mosquitto.org/documentation/How to test mqtt communication on window PC using terminal ?

author: Codemonkey
author_rank: Regular Contributor
timestamp: May 31, 2022, 10:04:17 am
content: Not sure how you can test it using a terminal, but you could download and run mqtt-spy which is a java application that allows you to connect to a broker and send messages, subscribe to topics, see messages posted by other clients to a topic etc.

author: BlogRahul
author_rank: Regular Contributor
timestamp: May 31, 2022, 04:38:06 pm
content: Quote from: Codemonkey on May 31, 2022, 10:04:17 amCan mqtt communication be checked by making same device as broker and client?I have only windows 10 pc, can i check mqtt communication by making it broker and client without using any other device?

author: agehall
author_rank: Frequent Contributor
timestamp: May 31, 2022, 04:56:59 pm
content: Sure it can. Just set up a broker and use clients to connect to it. One computer is more than enough.

author: Fredderic
author_rank: Regular Contributor
timestamp: May 31, 2022, 04:59:30 pm
content: I find this works pretty effectively:Code:mosquitto_sub -t '#' -vQuite often have that just running in a window so I can see the traffic flying past.

author: tellurium
author_rank: Frequent Contributor
timestamp: May 31, 2022, 06:07:02 pm
content: There is another possibility:A web-based clients exists too, e.g.http://www.hivemq.com/demos/websocket-client/They use PAHO library, and wrap MQTT messages into Websocket frames.In order to use such clients, a server should also support MQTT-over-Websockets.Mosquitto can do that,http://www.steves-internet-guide.com/mqtt-websockets/Wrapping MQTT into Websocket gives an ability to talk to your MQTT server from a web page / web application.

author: BlogRahul
author_rank: Regular Contributor
timestamp: June 01, 2022, 04:52:25 am
content: Quote from: agehall on May 31, 2022, 04:56:59 pmQuote from: Fredderic on May 31, 2022, 04:59:30 pmI ran following command on terminalCode:net start mosquittoIt show requested service has already startedI get error when run this commandCode:mosquitto_sub -t '#' -vmosquitto_sub is not recognize as internal or external commandHow do you check on windows terminal?

author: BlogRahul
author_rank: Regular Contributor
timestamp: June 03, 2022, 03:00:27 pm
content: Quote from: Fredderic on May 31, 2022, 04:59:30 pmHave you tried this command on your window PC? It doesn't work for me

author: Fredderic
author_rank: Regular Contributor
timestamp: June 03, 2022, 07:09:36 pm
content: On Windoze? Good question. Nope. No idea. Never even considered MQTT on Windoze…I'd have thought it'd still have the basic tools with it, though… Maybe they're just not in the path?Failing that, you could probably install it under WSL, for a more normal install… Or just go with the web tools as mentioned already…I just find being able to have a simple stream of everything in a console window is easy and very useful. Though, it quickly becomes hard to tell anything at all once it gets busy — which is when you narrow it down to specific topics. I've tried some of those web tools, and I keep going back to that simple command on the Linux system I run servery type stuff on.

author: tepalia02
author_rank: Regular Contributor
timestamp: June 25, 2022, 10:43:02 am
content: If you want to understand MQTT, here is a good write-up for you. It explains well What MQTT is. So, in order to understand MQTT Protocol, we need to know some terms. This tutorial covers all of them.https://www.theengineeringprojects.com/2021/11/esp32-mqtt.html

author: voltsandjolts
author_rank: Unknown
timestamp: June 25, 2022, 11:18:37 am
content: Quote from: tepalia02 on June 25, 2022, 10:43:02 am404 for me

author: tellurium
author_rank: Frequent Contributor
timestamp: June 25, 2022, 12:11:50 pm
content: Quote from: voltsandjolts on June 25, 2022, 11:18:37 amTryhttps://www.hivemq.com/mqtt-essentials/- their docs are quite good.They also run a public free MQTT service.And they have a web based clienthttp://www.hivemq.com/demos/websocket-client/Everything you need to learn MQTT without having to install a single bit.

author: tepalia02
author_rank: Regular Contributor
timestamp: June 27, 2022, 09:52:53 am
content: Quote from: tellurium on June 25, 2022, 12:11:50 pmOh. I think the site was under maintenance when you tried. I can access now.