{"id":15637946,"url":"https://github.com/256dpi/esp-mqtt","last_synced_at":"2026-03-13T06:32:06.704Z","repository":{"id":41443338,"uuid":"91011271","full_name":"256dpi/esp-mqtt","owner":"256dpi","description":"MQTT component for esp-idf projects based on the lwmqtt library","archived":false,"fork":false,"pushed_at":"2024-07-06T13:44:57.000Z","size":211,"stargazers_count":103,"open_issues_count":5,"forks_count":31,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-10-27T09:39:34.083Z","etag":null,"topics":["esp-idf","esp32","espressif","iot","mqtt"],"latest_commit_sha":null,"homepage":"","language":"C","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/256dpi.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-05-11T18:29:11.000Z","updated_at":"2025-09-04T09:41:38.000Z","dependencies_parsed_at":"2024-07-06T14:47:53.009Z","dependency_job_id":"294a4c6c-42d1-4827-9aee-5ba9719be49c","html_url":"https://github.com/256dpi/esp-mqtt","commit_stats":null,"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"purl":"pkg:github/256dpi/esp-mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/256dpi%2Fesp-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/256dpi%2Fesp-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/256dpi%2Fesp-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/256dpi%2Fesp-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/256dpi","download_url":"https://codeload.github.com/256dpi/esp-mqtt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/256dpi%2Fesp-mqtt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30460603,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-13T03:55:51.346Z","status":"ssl_error","status_checked_at":"2026-03-13T03:55:33.055Z","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":["esp-idf","esp32","espressif","iot","mqtt"],"created_at":"2024-10-03T11:15:59.824Z","updated_at":"2026-03-13T06:32:06.653Z","avatar_url":"https://github.com/256dpi.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# esp-mqtt\n\n[![Test](https://github.com/256dpi/esp-mqtt/actions/workflows/test.yml/badge.svg)](https://github.com/256dpi/esp-mqtt/actions/workflows/test.yml)\n[![Release](https://img.shields.io/github/release/256dpi/esp-mqtt.svg)](https://github.com/256dpi/esp-mqtt/releases)\n\n**MQTT component for esp-idf projects based on the [lwmqtt](https://github.com/256dpi/lwmqtt) library**\n\nThis component bundles the lwmqtt client and adds a simple async API similar to other esp networking components. Secure connections are supported via the `mbedTLS` library.\n\n## Installation\n\nYou can install the component by adding it as a git submodule:\n\n```bash\ngit submodule add https://github.com/256dpi/esp-mqtt.git components/esp-mqtt\ngit submodule update --init --recursive\n```\n\nThe component will automatically enable the LWIP receive buffers.\n\n### PlatformIO\n\nYou need to set `CONFIG_LWIP_SO_RCVBUF=y` manually in `sdkconfig`.\n\n## Example\n\nAn example can be found here: https://github.com/256dpi/esp-mqtt/blob/master/test/main/main.c.\n\n## Notes\n\nIf you are sending large messages, setting `CONFIG_USE_ONLY_LWIP_SELECT=y` might prevent [some issues](https://github.com/espressif/esp-mqtt/issues/48).\n\n## API\n\nInitialize the component once by passing the necessary callbacks:\n\n```c++\nvoid esp_mqtt_init(esp_mqtt_status_callback_t scb, esp_mqtt_message_callback_t mcb,\n                   size_t buffer_size, int command_timeout);\n```\n\nEnable secure connection using TLS:\n\n```c++\nbool esp_mqtt_tls(bool enabled, bool verify, const uint8_t * ca_buf, size_t ca_len);\n```\n\nOptionally, configure a Last Will and Testament:\n\n```c++\nvoid esp_mqtt_lwt(const char *topic, const char *payload, int qos, bool retained);\n```\n\nWhen the WiFi connection has been established, start the process:\n\n```c++\nbool esp_mqtt_start(const char *host, const char *port, const char *client_id,\n                    const char *username, const char *password);\n```\n\nWhen the client has connected, interact with the broker:\n\n```c++\nbool esp_mqtt_subscribe(const char *topic, int qos);\nbool esp_mqtt_unsubscribe(const char *topic);\nbool esp_mqtt_publish(const char *topic, uint8_t *payload, size_t len, int qos, bool retained);\n```\n\nIf the WiFi connection has been lost, stop the process:\n\n```c++\nvoid esp_mqtt_stop();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F256dpi%2Fesp-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F256dpi%2Fesp-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F256dpi%2Fesp-mqtt/lists"}