Skip to content

danish123117/INCODE-MQTT_Topic_Bridge

Repository files navigation

MQTT Topic bridge

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

1 Features

  • Subscribes to multiple MQTT topics.
  • Modifies and republishes received message topic by appending "/attrs" to the topic.

2 Prerequisites

  • Python 3.x
  • Paho MQTT library (paho-mqtt)

3 Environment Variables

  • POLAR_H10_API_KEY_ACC: (Optional) The MQTT topic prefix acc payload
  • POLAR_H10_API_KEY_HR :(Optional) The MQTT topic prefix hr payload
  • POLAR_H10_API_KEY_ECG: (Optional) The MQTT topic prefix ecg payload
  • MQTT_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.

4 Run locally

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.py

Alternatively 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

5. Related Repositories

  • Biosignals-LD-2 -
    https://github.com/danish123117/bioSignals-LD-2

6. Acknowledgement

This work was carried out within the framework of the project P2CODE, funded by the European Union under Grant Agreement No. 101093069.

Funded by European Union

7. Disclaimer

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.

8. MIT License

This project is licensed under the MIT License. See the LICENSE file for details.

About

topic bridge for Polar sensors adds /attrs to the topic

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors