{"id":17964780,"url":"https://github.com/kopera/erlang-mqtt","last_synced_at":"2025-03-25T06:30:59.648Z","repository":{"id":62429938,"uuid":"84531455","full_name":"kopera/erlang-mqtt","owner":"kopera","description":"Erlang/Elixir low level MQTT protocol implementation","archived":false,"fork":false,"pushed_at":"2020-06-10T10:02:31.000Z","size":73,"stargazers_count":16,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-19T09:40:44.416Z","etag":null,"topics":["elixir","erlang","mqtt","mqtt-protocol"],"latest_commit_sha":null,"homepage":null,"language":"Erlang","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kopera.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":"2017-03-10T07:21:33.000Z","updated_at":"2024-09-10T14:58:56.000Z","dependencies_parsed_at":"2022-11-01T20:04:25.892Z","dependency_job_id":null,"html_url":"https://github.com/kopera/erlang-mqtt","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopera%2Ferlang-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopera%2Ferlang-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopera%2Ferlang-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kopera%2Ferlang-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kopera","download_url":"https://codeload.github.com/kopera/erlang-mqtt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245413566,"owners_count":20611350,"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":["elixir","erlang","mqtt","mqtt-protocol"],"created_at":"2024-10-29T12:08:35.341Z","updated_at":"2025-03-25T06:30:59.343Z","avatar_url":"https://github.com/kopera.png","language":"Erlang","funding_links":[],"categories":[],"sub_categories":[],"readme":"# erlang-mqtt [![Build Status](https://travis-ci.org/kopera/erlang-mqtt.svg?branch=master)](https://travis-ci.org/kopera/erlang-mqtt)\n\nMQTT Protocol library for Erlang/Elixir. This library provides the low level building blocks for MQTT.\n\n## Protocol\n\n`mqtt_packet` exposes an `encode` function and a `decode` function to convert binaries to MQTT packets as defined in\n`mqtt/include/mqtt_packet.hrl`\n\n## Client\n\n`mqtt_client` provides a simple client for MQTT. Currently this client only supports QoS 0 messages.\n\n### Example Erlang client usage\n\n```erlang\nok = application:ensure_all_started(mqtt),\n\n{ok, Connection, false} = mqtt_client:connect(#{\n    transport =\u003e {tcp, #{host =\u003e \"localhost\"}}\n}),\n\nTopic = \u003c\u003c\"/test\"\u003e\u003e,\n{ok, [{Topic, 0}]} = mqtt_client:subscribe(Connection, [{topic, 0}]),\n\nok = mqtt_client:publish(Connection, Topic, \u003c\u003c\"Hello\"\u003e\u003e),\nreceive\n    {mqtt_client, Connection, {publish, Topic, Message, _}} -\u003e\n        io:format(\"Got ~s published on ~s~n\", [Message, Topic]\nend.\n```\n\n### Example Elixir client usage\n\n```elixir\n{:ok, connection, false} = MQTT.Client.connect(%{\n    transport: {:tcp, %{host: \"localhost\"}}\n})\n\ntopic = \"/test\"\n{:ok, [{^topic, 0}]} = MQTT.Client.subscribe(connection, [{topic, 0}])\n\n:ok = MQTT.Client.publish(connection, topic, \"Hello\")\nreceive do\n    {:mqtt_client, ^connection, {:publish, ^topic, message, _}} -\u003e\n        IO.puts \"Got #{message} published on #{topic}\"\nend\n```\n\n## Server\n\n`mqtt_server` provides a server behaviour for MQTT. A server would implement the `mqtt_server` behaviour, and would then\nbe able to accept MQTT connections from clients. Currently this server only supports QoS 0 messages.\n\n## TODO\n\n### Add support for QoS 1 and 2\n\nWe need to add support for QoS 1 and 2 messages, this would require implementing a storage module in order to persist\nmessages until they get acknowledged by the broker.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopera%2Ferlang-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkopera%2Ferlang-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkopera%2Ferlang-mqtt/lists"}