{"id":36027530,"url":"https://github.com/Domochip/sms2mqtt","last_synced_at":"2026-01-11T20:00:41.228Z","repository":{"id":44115306,"uuid":"331938431","full_name":"Domochip/sms2mqtt","owner":"Domochip","description":"Gateway to send/receive SMS through MQTT using an USB GSM dongle (gammu)","archived":false,"fork":false,"pushed_at":"2024-06-26T21:02:24.000Z","size":99,"stargazers_count":57,"open_issues_count":3,"forks_count":11,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-04T13:29:05.796Z","etag":null,"topics":["docker","gammu","mqtt","sms"],"latest_commit_sha":null,"homepage":"","language":"Python","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/Domochip.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":"2021-01-22T12:22:42.000Z","updated_at":"2025-05-14T20:19:40.000Z","dependencies_parsed_at":"2024-01-16T23:31:41.433Z","dependency_job_id":"13e7693f-0914-4fd1-bc42-2e5207f36b3a","html_url":"https://github.com/Domochip/sms2mqtt","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/Domochip/sms2mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsms2mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsms2mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsms2mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsms2mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Domochip","download_url":"https://codeload.github.com/Domochip/sms2mqtt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Domochip%2Fsms2mqtt/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":["docker","gammu","mqtt","sms"],"created_at":"2026-01-10T15:00:40.726Z","updated_at":"2026-01-11T20:00:41.212Z","avatar_url":"https://github.com/Domochip.png","language":"Python","funding_links":[],"categories":["Interfaces"],"sub_categories":["Telephony, PBX"],"readme":"# Prerequisites\n\nYou need a GSM dongle \"compatible\" with Gammu : https://wammu.eu/phones/  \nEven if your dongle is not listed, it should works with.\n\nIf you need specific gammu settings to be added, feel free to open a PR or an issue.\n\n# How does it work\n\n![Diagram](https://raw.githubusercontent.com/Domochip/sms2mqtt/master/diagram.svg)\n\n# How-to\n## Install\nFor Docker, run it by executing the following commmand:\n\n```bash\ndocker run \\\n    -d \\\n    --name sms2mqtt \\\n    --restart=always \\\n    --device=/dev/ttyUSB0:/dev/mobile \\\n    -e PIN=\"1234\" \\\n    -e HOST=\"192.168.1.x\" \\\n    -e PORT=1883 \\\n    -e PREFIX=\"sms2mqtt\" \\\n    -e CLIENTID=\"sms2mqttclid\" \\\n    -e USER=\"usr\" \\\n    -e PASSWORD=\"pass\" \\\n    domochip/sms2mqtt\n```\nFor Docker-Compose, use the following yaml:\n\n```yaml\nversion: '3'\nservices:\n  sms2mqtt:\n    container_name: sms2mqtt\n    image: domochip/sms2mqtt\n    devices:\n    - /dev/serial/by-id/usb-HUAWEI_HUAWEI_Mobile-if00-port0:/dev/mobile\n    environment:\n    - PIN=1234\n    - HOST=10.0.0.2\n    - PORT=1883\n    - PREFIX=sms2mqtt\n    - CLIENTID=sms2mqttclid\n    - USER=mqtt_username\n    - PASSWORD=mqtt_password\n    restart: always\n```\n\n### Configure\n\n#### Device\n* `device`: Location of GSM dongle (replace /dev/ttyUSB0 with yours), it need to be mapped to /dev/mobile\n\n*NOTE: The `/dev/ttyUSBx` path of your GSM modem could change on reboot, so it's recommended to use the `/dev/serial/by-id/` path or symlink udev rules to avoid this issue.*\n\n#### Environment variables\n* `PIN`: **Optional**, Pin code of your SIM\n* `GAMMUOPTION`: **Optional**, Allow to add a specific line in gammu configuration (ex : 'atgen_setcnmi = 1,2,0,0')\n* `MOREINFO`: **Optional**, Add more topics about your GSM device (battery and network)\n* `HEARTBEAT`: **Optional**, Enable the heartbeat topic\n* `HOST`: IP address or hostname of your MQTT broker\n* `PORT`: **Optional**, port of your MQTT broker\n* `PREFIX`: **Optional**, MQTT prefix used in topics for subscribe/publish\n* `CLIENTID`: **Optional**, MQTT client id to use\n* `USER`: **Optional**, MQTT username\n* `PASSWORD`: **Optional**, MQTT password\n\n## Send\n\nThe default {prefix} for topics is sms2mqtt.  \n\nTo send SMS: \n1. Publish this payload to topic **sms2mqtt/send** :  \n`{\"number\":\"+33612345678\", \"text\":\"This is a test message\"}`  \n2. SMS is sent  \n3. A confirmation is sent back through MQTT to topic **sms2mqtt/sent** :  \n`{\"result\":\"success\", \"datetime\":\"2021-01-23 13:00:00\", \"number\":\"+33612345678\", \"text\":\"This is a test message\"}`  \n  \n- ✔️ SMS to multiple Numbers using semicolon (;) seperated list. A confirmation will be sent back for each numbers.\n- ✔️ very long messages (more than 160 char).\n- ✔️ unicode messages containing emoji like : `{\"number\":\"+33612345678\", \"text\":\"It's working fine 👌\"}`\n- ✔️ very long messages containing emoji\n\n## Receive\n\nReceived SMS are published to topic **sms2mqtt/received** like this :  \n`{\"datetime\":\"2021-01-23 13:30:00\", \"number\":\"+31415926535\", \"text\":\"Hi, Be the Pi with you\"}`  \n\n- ✔️ long SMS messages\n- ❌ any MMS\n\n## Other topics\n - **sms2mqtt/connected**: Indicates connection status of the container (0 or 1)  \n E.g. `1`\n\n- **sms2mqtt/signal**: A signal quality payload is published when quality changes  \n E.g. `{\"SignalStrength\": -71, \"SignalPercent\": 63, \"BitErrorRate\": -1}`\n\n### Additionnal topics (enabled using MOREINFO flag)\n - **sms2mqtt/battery**: A battery payload with status and charge is published when it changes  \n E.g. `{\"BatteryPercent\": 100, \"ChargeState\": \"BatteryPowered\", \"BatteryVoltage\": -1, \"ChargeVoltage\": -1, \"ChargeCurrent\": -1, \"PhoneCurrent\": -1, \"BatteryTemperature\": -1, \"PhoneTemperature\": -1, \"BatteryCapacity\": -1}`\n\n - **sms2mqtt/network**: A network payload is published when it changes  \n E.g. `{\"NetworkName\": \"\", \"State\": \"HomeNetwork\", \"PacketState\": \"HomeNetwork\", \"NetworkCode\": \"392 11\", \"CID\": \"74C5\", \"PacketCID\": \"74C5\", \"GPRS\": \"Attached\", \"PacketLAC\": \"8623\", \"LAC\": \"8623\"}`\n\n### heartbeat topic (enabled using HEARTBEAT flag)\n - **sms2mqtt/datetime**: A payload containing current timestamp of the GSM device is published for every loop  \n E.g. `1634671168.531913`\n\n# Troubleshoot\n## Logs\nYou need to have a look at logs using :  \n`docker logs sms2mqtt`\n\n# Updating\nTo update to the latest Docker image:\n```bash\ndocker stop sms2mqtt\ndocker rm sms2mqtt\ndocker rmi domochip/sms2mqtt\n# Now run the container again, Docker will automatically pull the latest image.\n```\n# Ref/Thanks\n\nI want to thanks those repositories for their codes that inspired me :  \n* https://github.com/pajikos/sms-gammu-gateway\n* https://github.com/pkropf/mqtt2sms \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDomochip%2Fsms2mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDomochip%2Fsms2mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDomochip%2Fsms2mqtt/lists"}