{"id":19310600,"url":"https://github.com/sepppenner/mqtt2awss3bridge","last_synced_at":"2025-02-24T03:26:41.908Z","repository":{"id":54744755,"uuid":"146170455","full_name":"SeppPenner/MQTT2AWSS3Bridge","owner":"SeppPenner","description":"MQTT2AWSS3Bridge is a project to connect a locally running broker to AWS S3 and upload the messages as a simple .txt file. The project was written and tested in Python 3.","archived":false,"fork":false,"pushed_at":"2023-07-03T17:48:32.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-06T02:10:50.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SeppPenner.png","metadata":{"files":{"readme":"Readme.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"License.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-08-26T10:15:53.000Z","updated_at":"2023-07-03T17:48:36.000Z","dependencies_parsed_at":"2024-11-10T00:25:38.420Z","dependency_job_id":"8ad8d907-6779-4048-b586-8ed0a570ad90","html_url":"https://github.com/SeppPenner/MQTT2AWSS3Bridge","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeppPenner%2FMQTT2AWSS3Bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeppPenner%2FMQTT2AWSS3Bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeppPenner%2FMQTT2AWSS3Bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SeppPenner%2FMQTT2AWSS3Bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SeppPenner","download_url":"https://codeload.github.com/SeppPenner/MQTT2AWSS3Bridge/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240411704,"owners_count":19797133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T00:25:07.235Z","updated_at":"2025-02-24T03:26:41.871Z","avatar_url":"https://github.com/SeppPenner.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MQTT2AWSS3Bridge\n\nMQTT2AWSS3Bridge is a project to connect a locally running broker to AWS S3 and upload the messages as a simple .txt file. The project was written and tested in Python 3.\n\n[![Build status](https://ci.appveyor.com/api/projects/status/q54cv976lrsclueu?svg=true)](https://ci.appveyor.com/project/SeppPenner/mqtt2awss3bridge)\n[![GitHub issues](https://img.shields.io/github/issues/SeppPenner/MQTT2AWSS3Bridge.svg)](https://github.com/SeppPenner/MQTT2AWSS3Bridge/issues)\n[![GitHub forks](https://img.shields.io/github/forks/SeppPenner/MQTT2AWSS3Bridge.svg)](https://github.com/SeppPenner/MQTT2AWSS3Bridge/network)\n[![GitHub stars](https://img.shields.io/github/stars/SeppPenner/MQTT2AWSS3Bridge.svg)](https://github.com/SeppPenner/MQTT2AWSS3Bridge/stargazers)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://raw.githubusercontent.com/SeppPenner/MQTT2AWSS3Bridge/master/License.txt)\n[![Known Vulnerabilities](https://snyk.io/test/github/SeppPenner/MQTT2AWSS3Bridge/badge.svg)](https://snyk.io/test/github/SeppPenner/MQTT2AWSS3Bridge) \n\n## Adjust your settings:\n\n* Adjust the broker to the address you want to use: `broker_source`\n* Add your custom filters to `filterMessage()` if you want to filter messages\n* Adjust your credentials (uncomment if anonymous): \n\n```python\nclient_source.username_pw_set(\"mqtt\", \"IoT\")\n```\n\n* Install the AWS command line: https://docs.aws.amazon.com/cli/latest/userguide/installing.html\n\n* Adjust your AWS S3 credentials and the proxy settings:\n\n```python\nos.environ['HTTPS_PROXY'] = 'http://YourProxyIfNeeded:8080'\nos.environ['AWS_ACCESS_KEY_ID'] = 'YourKeyHere'\nos.environ['AWS_SECRET_ACCESS_KEY'] = 'YourSecretHere'\nos.environ['AWS_DEFAULT_REGION'] = 'eu-central-1'\nos.environ['AWS_SESSION_TOKEN'] ='YourSessionTokenHere'\nyourAWSBucket = 'YourAWSBucketHere'\n```\n\n* Add filters to the bridging like described in the `bridgeFiltering.py` file if needed:\n\n```python\ndef filterMessage(payload, topic, qos):\n\t\"Filters the messages depending on the configuration for the attributes payload, topic and QoS. 'True' means that the message is not forwarded.\"\n\t# Examples below:\n\tif(payload == \"10 %\"):\n\t\tprint('Filtered: payload == \"10 %\"')\n\t\treturn True\n\tif(topic == \"humidity\" and qos == 0):\n\t\tprint('Filtered: topic == \"humidity\" and qos == 0')\n\t\treturn True\n\tif(topic == \"temperature\" or qos == 2):\n\t\tprint('Filtered: topic == \"temperature\" or qos == 2')\n\t\treturn True\n\t#Add your filters here\n```\n\n## Setup on the Raspberry Pi\n\n```bash\nsudo apt-get install python3\nsudo apt-get install python3-pip\nsudo pip3 install paho-mqtt\nsudo pip3 install awscli --upgrade --user\n```\n\nor\n\n```bash\nsudo apt-get install python3\nsudo apt-get install python3-pip\nsudo pip3 install -r requirements.txt\n```\n\n## Running the programms:\n\n```bash\npython3 bridge.py\npython3 bridgeFiltering.py\n```\n\n## Installing the latest version of Python (Currently 3.7.4) on the Raspberry Pi:\n\nhttps://gist.github.com/SeppPenner/6a5a30ebc8f79936fa136c524417761d\n\n## Paho MQTT client documentation\n\n* https://pypi.org/project/paho-mqtt/\n* https://www.hivemq.com/blog/mqtt-client-library-paho-python\n\n## See also\n\n* [MQTT2MQTTBridge](https://github.com/SeppPenner/MQTT2MQTTBridge)\n* [MQTT2PostgresBridge](https://github.com/SeppPenner/MQTT2PostgresBridge)\n* [MQTT2MySQLBridge](https://github.com/SeppPenner/MQTT2MySQLBridge)\n\nChange history\n--------------\n\nSee the [Changelog](https://github.com/SeppPenner/MQTT2AWSS3Bridge/blob/master/Changelog.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepppenner%2Fmqtt2awss3bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsepppenner%2Fmqtt2awss3bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsepppenner%2Fmqtt2awss3bridge/lists"}