{"id":36027542,"url":"https://github.com/David-Lor/MQTT2MongoDB","last_synced_at":"2026-01-11T20:00:41.425Z","repository":{"id":47760430,"uuid":"174614173","full_name":"David-Lor/MQTT2MongoDB","owner":"David-Lor","description":"Store all incoming 🦟MQTT messages on 🍃MongoDB","archived":true,"fork":false,"pushed_at":"2021-08-01T02:23:25.000Z","size":9,"stargazers_count":17,"open_issues_count":0,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-03-04T01:48:36.164Z","etag":null,"topics":["log","logging","mongo","mongodb","mqtt","mqtt-client","mqtt-logger","paho-mqtt","paho-mqtt-python","python","python3","python36","python37"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/David-Lor.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-03-08T21:43:26.000Z","updated_at":"2023-01-28T03:17:29.000Z","dependencies_parsed_at":"2022-09-12T21:41:08.162Z","dependency_job_id":null,"html_url":"https://github.com/David-Lor/MQTT2MongoDB","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"purl":"pkg:github/David-Lor/MQTT2MongoDB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FMQTT2MongoDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FMQTT2MongoDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FMQTT2MongoDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FMQTT2MongoDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/David-Lor","download_url":"https://codeload.github.com/David-Lor/MQTT2MongoDB/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/David-Lor%2FMQTT2MongoDB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28321263,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-11T18:42:50.174Z","status":"ssl_error","status_checked_at":"2026-01-11T18:39:13.842Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["log","logging","mongo","mongodb","mqtt","mqtt-client","mqtt-logger","paho-mqtt","paho-mqtt-python","python","python3","python36","python37"],"created_at":"2026-01-10T15:00:40.726Z","updated_at":"2026-01-11T20:00:41.399Z","avatar_url":"https://github.com/David-Lor.png","language":"Python","funding_links":[],"categories":["Interfaces"],"sub_categories":["Logging"],"readme":"# MQTT2MongoDB\n\nA simple Python project that listen to one or more MQTT topics and save all the incoming messages on a MongoDB database, as some sort of logger.\n\n## Requirements\n\n- Python 3.x (tested on 3.7)\n- Linux (not tested on other OS)\n- A working, available MQTT broker\n- A working, available MongoDB server\n- Libraries:\n    * [pymongo](http://api.mongodb.com/python/current/)\n    * [paho-mqtt](https://pypi.org/project/paho-mqtt/)\n- Docker recommended if available - you can use my [Python Autoclonable App Docker](https://hub.docker.com/r/davidlor/python-autoclonable-app/)\n\n## Settings\n\nSettings for MQTT and MongoDB can be placed on the mqtt.py and mongo.py files respectively, on a top-level UPPERCASE variables.\n\nAlternatively, environment variables with the same names as these UPPERCASE variables are fetched instead of these variables, when available. This can be useful when running the app from a Docker container.\n\n## Queue\n\n(TODO) When the MongoDB server is unavailable or the insert failed, messages are stored on a list and periodically try to be inserted on the MongoDB again.\n\n## Format of a Mongo document\n\n```json\n{\n    \"_id\": \"5c82de0799ec3656ff38d215\",\n    \"topic\": \"home/test\",\n    \"payload\": \"This is a test!\",\n    \"qos\": 2,\n    \"timestamp\": 1552080391,\n    \"datetime\": \"08/03/2019 22:26:31\"\n}\n```\n\n## TODO\n\n- Implement Queue\n- Get timestamp of received messages right when they arrive\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavid-Lor%2FMQTT2MongoDB","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDavid-Lor%2FMQTT2MongoDB","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDavid-Lor%2FMQTT2MongoDB/lists"}