MQTT
MQTT is a lightweight, publish-subscribe, machine to machine network protocol for message queue/message queuing service.
I was introduced to this concept when learning about Mission Control at NVIDIA.
Mosquito pub-sub https://chatgpt.com/share/6726b440-b95c-8002-b85a-7a7669edf098
brew services start mosquitto
The configuration file is here on linux:
/usr/local/etc/mosquitto/mosquitto.conf
- In the first terminal, subscribe to a topic:
-
-h localhost
: Connects to the broker on your local machine. -
-t "test/topic"
: Subscribes to the topic “test/topic”. -
In the second terminal, publish a message:
-m "Hello, MQTT!"
: The message to publish.
Mosquito on mac
need to allow anonymous listeners, to make it work not just on mac
Find the location of the config file
brew list mosquitto | grep conf
I got it here
/opt/homebrew/Cellar/mosquitto/2.0.20/etc/mosquitto/mosquitto.conf
I add these 2 lines to the config file, which allows incoming connection
I needed to get the ip address of the computer