This Python script subscribes to MQTT topics and modifies the received messages before republishing it to new topics. The purpose is to remap the topics so that it can help in integrating Polar data logger topics to FIWARE IOT agent compliant topic structure
- Subscribes to multiple MQTT topics.
- Modifies and republishes received message topic by appending "/attrs" to the topic.
- Python 3.x
- Paho MQTT library (
paho-mqtt)
POLAR_H10_API_KEY_ACC: (Optional) The MQTT topic prefix acc payloadPOLAR_H10_API_KEY_HR:(Optional) The MQTT topic prefix hr payloadPOLAR_H10_API_KEY_ECG: (Optional) The MQTT topic prefix ecg payloadMQTT_BROKER_NAME: (Optional) The hostname or IP address of the MQTT broker. Default is "mosquitto".MQTT_BROKER_PORT: (Optional) The port number of the MQTT broker. Default is 1883.
Clone the repository:
git clone https://github.com/danish123117/INCODE-MQTT_Topic_Bridge.git
cd INCODE-MQTT_Topic_Bridge
pip install -r requirements.txt
python MQTT_topic_bridge.pyAlternatively you can use the docker compose file directly and run one of the following two commands.
docker compose up --build -d
docker compose up -d- Biosignals-LD-2 -
https://github.com/danish123117/bioSignals-LD-2
This work was carried out within the framework of the project P2CODE, funded by the European Union under Grant Agreement No. 101093069.
Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or or the European Commission. Neither the European Union nor the European Commission can be held responsible for them.
This project is licensed under the MIT License. See the LICENSE file for details.
