{"id":20333581,"url":"https://github.com/arha/musq","last_synced_at":"2026-05-19T03:32:39.561Z","repository":{"id":150861692,"uuid":"118283765","full_name":"arha/musq","owner":"arha","description":"MQTT glue. Connect everything to everything via MQTT","archived":false,"fork":false,"pushed_at":"2018-04-28T16:40:39.000Z","size":135,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-04T12:46:47.437Z","etag":null,"topics":["gpio","iot","mqtt","nanopi","onion-omega2","orange-pi","rpi","unicorn-hat"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/arha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-01-20T21:53:24.000Z","updated_at":"2018-04-28T16:40:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"27a5d0ae-36d6-4ce0-bb3a-03cc9c172fa5","html_url":"https://github.com/arha/musq","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/arha/musq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arha%2Fmusq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arha%2Fmusq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arha%2Fmusq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arha%2Fmusq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/arha","download_url":"https://codeload.github.com/arha/musq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/arha%2Fmusq/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264929722,"owners_count":23684863,"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":["gpio","iot","mqtt","nanopi","onion-omega2","orange-pi","rpi","unicorn-hat"],"created_at":"2024-11-14T20:32:21.843Z","updated_at":"2026-05-19T03:32:39.517Z","avatar_url":"https://github.com/arha.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# musq\n\nSwiss knife of MQTT. Trigger or log to/from bash scripts, GPIO, SPI/I\u003csup\u003e2\u003c/sup\u003eC or 'smart' plugs/devices from MQTT. MQTT is an IOT protocol supported by pretty much every platform and with some patience, exotic ones too, like Alexa, Tasker or IFTTT.\n\nEasily configurable, modular and easily extendable with either shell scripts or full-on python.\n\nmusq is mqtt glue.\n\n-----------------\n\n## What's supported?\n\nThe following have been tested:\n* RPI v3 model B\n* Vanilla x64 debian9\n* Raspberry Pi Zero, Unicorn HAT\n* Orange PI, GPIO only\n* Omega Onion2\n\nMostly with python3, but python2 should work well.\n\n# Prerequirements\n\n### Dependencies\n\n```\napt-get install python3-pip\npip3 install paho-mqtt pyyaml\n```\n\nExtended stuff (varies depending on what you want)\n\n### 'Smart' devices\n```\npip3 install pyHS100 pyw215 \n```\n\n### Pimoroni's unicorn hat\n\n```\napt-get install python3-pip python3-dev\npip3 install unicornhat\n```\n\n# Installation\n\nEither clone the repo ```git clone https://github.com/arha/musq``` or download the [master zip](https://github.com/arha/musq/archive/master.zip). With the provided config file, sending a message to ```/test/beep-simple``` will call ```/usr/bin/beep``` and messages to ```/test/module/demo/#``` should output some debug data.\n\nRun musq, ```python3 musq``` or simply ```./musq```.\n\n## Messing around\n\nOnce that works, setup the logging module (```module: log_file```, needs a ```filename``` and ```topic``` argument) and see what appears. Send a few messages, then configure your own scripts.\n\nThe ```pizero``` module loaded on a RPi Zero will publish its internal temperature to ```/example/pizero/temperature```, while writing 1 or 0 to its subscribed topic followed by led (```/this/is/your/topic/led```) will trigger the onboard led.\n\nOrange PIs can have stuff written to ```/example/opi/gpio/action/PG7``` (where action can be read, write, output, pullup), or to /example/opi/led/red (or green) to mess with its leds. The OPi will publish its internal temperature to ```/example/opi/temperature/soc```\n\n# Standalone 'smart' devices\n\nModern 'smart' consumer IoT devices, like relays (such as D-LINK W215 or TP-Link HS100), or the various assortment of glass/door/PIR sensors require 50-100MB of bad APKs to use; rarely, if ever, have a plain HTTP interface, and usually die when the vendor phases them out/shuts down the server/files for bankruptcy. \n\nOnce you go to the trouble of setting it up, the vendor's APK is useless; hooking the device up to MQTT makes much more sense: access it from anywhere, any OS, any interface and cut the dependency to the manufacturer's ecosystem.\n\nThe following devices have musq modules available and have been tested:\n\n* D-LINK W215, via [pyw215](https://github.com/LinuxChristian/pyW215) by LinuxChristian. Needs: one-time setup with their dedicated APK to enter ssid/password (SSID/password cannot be entered by connecting to the device in AP mode); will also need installing the python library `pip3 install pyw215`\n* HS-100, via [pyHS100](https://github.com/GadgetReactor/pyHS100) by GadgetReactor. Needs: one time setup from APK; will also need installing the python library `pip3 install pyHS100`\n\nAny 'smart' device that acts as an output can be connected to mqtt via musq if its protocol has been reversed-engineered, and is callable by some sort of script - simply call the script from musq.\n\n# Hats and modules supported\n\n* Pimoroni Unicorn HAT (Standard, 8x8) - GPIO\n\n# Wishlist\n\n## Boards \n- [ ] Full RPi v1 and RPI v3\n- [ ] NanoPi NEO\n- [X] OrangePi\n- [X] Onion Omega2\n\n## Hardware and HAL features\n- [ ] Support for hardware libs for peripheral access (I^2C, SPI, serial links...)\n- [ ] MIDI to MQTT\n- [ ] Cross-platform compatible GPIO access\n- [ ] Cross-platform peripheral access\n\n## Application features\n- [ ] Allow configuration of subscriptions, autoguess from modules\n- [ ] Routing (copy messages to/from topics, check for feedback loops)\n- [X] Log to file\n- [ ] Log to databases (MySQL, Postgres, MSSQL, db2) and CouchDB/MongoDB\n- [ ] DynamoDB, AWS IoT core\n- [ ] Blynk seems popular\n- [X] Write to IR or 433/866 MHz RF stuff with dumb dongle (audio out), works via script+aplay\n- [ ] SNMP\n\n\u003c!-- Pushed this file to trigger github's activity thingie 2 --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farha%2Fmusq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farha%2Fmusq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farha%2Fmusq/lists"}