This code connects to an MQTT broker to publish and subscribe to topics to receive messages.

pip install -r requirements.txt
This file includes:
paho-mqtt==1.6.1
python-decouple==3.8
[MQTT] Connected to server.
[MQTT] Received message from sensors/temperature topic:
Hello MQTT
[MQTT] Received message from sensors/temperature topic:
Custom Messages Working!
The client connects to the configured broker, subscribes to the topic, then publishes two messages: "Hello MQTT" and "Custom Messages Working!".
mosquitto -v: Running Broker;mosquitto mosquitto_sub -h BROKER_IP -p PORT -t TOPIC: Subscribe in topic. mosquitto_pub -h BROKER_IP -p PORT -t TOPIC -m MESSAGE: Publish "MESSAGE" in topic..env-example file and configure it;.env-example to .env;MqttClient.py.python3 MqttClient.py
