{"id":37179748,"url":"https://github.com/blchinezu/cec-client-mqtt-bridge","last_synced_at":"2026-01-14T20:54:49.390Z","repository":{"id":92871855,"uuid":"198195030","full_name":"blchinezu/cec-client-mqtt-bridge","owner":"blchinezu","description":"HDMI CEC-MQTT Bridge using the cec-client binary","archived":false,"fork":false,"pushed_at":"2019-07-22T12:28:11.000Z","size":28,"stargazers_count":4,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-25T02:26:29.415Z","etag":null,"topics":["alpine","bridge","cec","cec-client","docker","go","golang","iot","mqtt","mqtt-broker","pipes","smarthome"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/blchinezu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2019-07-22T09:51:48.000Z","updated_at":"2023-10-20T18:54:17.000Z","dependencies_parsed_at":"2023-04-30T18:12:55.508Z","dependency_job_id":null,"html_url":"https://github.com/blchinezu/cec-client-mqtt-bridge","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/blchinezu/cec-client-mqtt-bridge","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blchinezu%2Fcec-client-mqtt-bridge","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blchinezu%2Fcec-client-mqtt-bridge/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blchinezu%2Fcec-client-mqtt-bridge/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blchinezu%2Fcec-client-mqtt-bridge/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blchinezu","download_url":"https://codeload.github.com/blchinezu/cec-client-mqtt-bridge/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blchinezu%2Fcec-client-mqtt-bridge/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28434500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T18:57:19.464Z","status":"ssl_error","status_checked_at":"2026-01-14T18:52:48.501Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["alpine","bridge","cec","cec-client","docker","go","golang","iot","mqtt","mqtt-broker","pipes","smarthome"],"created_at":"2026-01-14T20:54:48.767Z","updated_at":"2026-01-14T20:54:49.383Z","avatar_url":"https://github.com/blchinezu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cec-client-mqtt-bridge\nHDMI CEC-MQTT Bridge using the **cec-client** binary\n\n--------------------------------------------------------------------------------\n\n### Description\n\nThis lets you send commands and receive answers from the `cec-client` binary\nthrough MQTT.\n\n - To send commands to `cec-client` you publish into `cec/client/tx`\n - To listen for `cec-client` output you subscribe to `cec/client/rx/TRAFFIC`\n\n--------------------------------------------------------------------------------\n\n### Why this exists\n\nAll the existing implementations try to connect directly to CEC and interpret\nthe messages although this is already done in `cec-client` and it's the most\nreliable implementation. Everyone checks the CEC functionality and/or their\nimplementation with `cec-client` anyway.\n\nSo this project is creating a bridge between the `cec-client` binary and an MQTT\nbroker placed on localhost. Basically it's creating a dual-way pipe between the\nservices.\n\n--------------------------------------------------------------------------------\n\n### How's this working\n\n - The `cec-client-mqtt-bridge` binary connects to the MQTT broker\n - It subscribes to `cec/client/tx` on a different thread\n - It spills the received messages in `stdout` which is piped to `cec-client`\n - It then listens for `stdin` input which is piped from `cec-client` on the\n   main thread\n - When receiving something it publishes the message on `cec/client/rx/TRAFFIC`\n\n--------------------------------------------------------------------------------\n\n### Hardware\n\nMake sure you have HDMI CEC capable hardware\n\n - Raspberry PIs have this by default\n - Intel NUCs usually require an [additional hardware module](https://www.pulse-eight.com/p/154/intel-nuc-hdmi-cec-adapter) to be installed\n - Other devices can use [this generic adapter](https://www.pulse-eight.com/p/104/usb-hdmi-cec-adapter)\n\n--------------------------------------------------------------------------------\n\n### Build\n\nThe build/dependency/run scripts are built for Apline Linux but can be easily\nadapted for Debian or something else.\n\n```bash\n# Install git, go \u0026 musl-dev\nash install-build-dependencies.sh\n\n# Build binary\nash build.sh\n\n# Remove git, go \u0026 musl-dev\nash remove-build-dependencies.sh\n```\n\n--------------------------------------------------------------------------------\n\n### Runtime dependencies\n\nFor this to work you need the `cec-client` binary.\n\nTo install it in Alpine Linux just run:\n\n```bash\napk add libcec\n```\n\nFor Debian based systems this should do the trick:\n\n```bash\napt install cec-utils\n```\n\n--------------------------------------------------------------------------------\n\n### Run\n\nCreates two pipes in `/tmp/fifo/` which will facilitate the communication\nbetween processes and then launches the processes.\n\n```bash\nbash run.sh\n```\n\nHere's how `run.sh` looks like:\n\n```bash\n# Create pipes\nmkdir -p /tmp/fifo\nrm -rf /tmp/fifo/mqtt2cec /tmp/fifo/cec2mqtt\nmkfifo /tmp/fifo/mqtt2cec /tmp/fifo/cec2mqtt\n\n# Launch bridge\n./cec-client-mqtt-bridge \u003e /tmp/fifo/mqtt2cec \u003c /tmp/fifo/cec2mqtt \u0026\n\n# Launch cec client\ncec-client \u003c /tmp/fifo/mqtt2cec \u003e /tmp/fifo/cec2mqtt\n\n```\n\n--------------------------------------------------------------------------------\n\n### Docker\n\nTo use this in an Alpine based Docker image you could use this:\n\n```dockerfile\nENV CECCLIENT_MQTT_BRIDGE_PATH \"/app/modules/cec-client-mqtt-bridge\"\nRUN echo -e \"\\n \u003e INSTALL CEC-CLIENT-MQTT-BRIDGE\\n\" \\\n \u0026\u0026 apk add --no-cache --virtual=build-dependencies \\\n    git \\\n    \\\n \u0026\u0026 mkdir -p $CECCLIENT_MQTT_BRIDGE_PATH/src \\\n \u0026\u0026 cd $CECCLIENT_MQTT_BRIDGE_PATH \\\n \u0026\u0026 git clone https://github.com/blchinezu/cec-client-mqtt-bridge.git ./src \\\n \u0026\u0026 ash src/install-build-dependencies.sh \\\n \u0026\u0026 ash src/build.sh \\\n \\\n \u0026\u0026 echo -e \"\\n \u003e CLEANUP\\n\" \\\n \u0026\u0026 ash src/remove-build-dependencies.sh \\\n \u0026\u0026 apk del --purge build-dependencies \\\n \u0026\u0026 rm -rf \\\n    ./src \\\n    /root/.cache \\\n    /root/go \\\n    /tmp/* \\\n    /var/tmp/*\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblchinezu%2Fcec-client-mqtt-bridge","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblchinezu%2Fcec-client-mqtt-bridge","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblchinezu%2Fcec-client-mqtt-bridge/lists"}