This repository contains a Python script for interacting with the MaQiaTTo online broker. Follow the instructions below to set up and use the script.
- Create MaQiaTTo account at maqiatto.com.
- Create the necessary topics. For example, you can create a topic named "door" (the provided example assumes this topic exists).
git clone https://github.com/harounabidi/mqtt.git
or download here
Install the required Python packages by running the following command:
pip install -r requirements.txt
- Copy the contents of
.env.example
file. - Create a new file named
.env
. - Paste the copied contents into the
.env
file. - Replace the placeholders with your actual MaQiaTTo credentials. Replace
username
with your MaQiaTTo username andpassword
with your MaQiaTTo password.
Example .env file:
BROKER_USERNAME=your_username
BROKER_PASSWORD=your_password
To publish messages to a topic using an arduino RFID, run the following command:
python mqtt_publish.py
To subscribe to a topic and receive messages, run the following command:
python mqtt_subscriber.py
This will execute the mqtt_subscriber.py
script and listen for incoming messages on the subscribed topic.
Feel free to reach out if you have any further questions or issues.