{"id":15636453,"url":"https://github.com/warthog618/modem","last_synced_at":"2025-08-20T20:33:34.745Z","repository":{"id":24577006,"uuid":"101961419","full_name":"warthog618/modem","owner":"warthog618","description":"A Go driver for AT based modems","archived":false,"fork":false,"pushed_at":"2022-07-31T14:49:01.000Z","size":109,"stargazers_count":125,"open_issues_count":0,"forks_count":43,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-14T02:32:42.163Z","etag":null,"topics":["driver","go","golang","golang-library","gsm","low-level","modem","sms"],"latest_commit_sha":null,"homepage":"","language":"Go","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/warthog618.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}},"created_at":"2017-08-31T05:06:12.000Z","updated_at":"2025-08-12T07:47:49.000Z","dependencies_parsed_at":"2022-07-06T09:02:42.150Z","dependency_job_id":null,"html_url":"https://github.com/warthog618/modem","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/warthog618/modem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warthog618%2Fmodem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warthog618%2Fmodem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warthog618%2Fmodem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warthog618%2Fmodem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/warthog618","download_url":"https://codeload.github.com/warthog618/modem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warthog618%2Fmodem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271378718,"owners_count":24749199,"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","status":"online","status_checked_at":"2025-08-20T02:00:09.606Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["driver","go","golang","golang-library","gsm","low-level","modem","sms"],"created_at":"2024-10-03T11:04:05.823Z","updated_at":"2025-08-20T20:33:34.431Z","avatar_url":"https://github.com/warthog618.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# modem\n\nA low level Go driver for AT modems.\n\n[![Build Status](https://app.travis-ci.com/warthog618/modem.svg)](https://app.travis-ci.com/warthog618/modem)\n[![Coverage Status](https://coveralls.io/repos/github/warthog618/modem/badge.svg?branch=master)](https://coveralls.io/github/warthog618/modem?branch=master)\n[![Go Report Card](https://goreportcard.com/badge/github.com/warthog618/modem)](https://goreportcard.com/report/github.com/warthog618/modem)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/warthog618/modem/blob/master/LICENSE)\n\nmodem is a Go library for interacting with AT based modems.\n\nThe initial impetus was to provide functionality to send and receive SMSs via a\nGSM modem, but the library may be generally useful for any device controlled by\nAT commands.\n\nThe [at](at) package provides a low level driver which sits between an\nio.ReadWriter, representing the physical modem, and a higher level driver or\napplication.\n\nThe AT driver provides the ability to issue AT commands to the modem, and to\nreceive the info and status returned by the modem, as synchronous function\ncalls.\n\nHandlers for asynchronous indications from the modem, such as received SMSs,\ncan be registered with the driver.\n\nThe [gsm](gsm) package wraps the AT driver to add higher level functions to\nsend and receive SMS messages, including long messages split into multiple\nparts, without any knowledge of the underlying AT commands.\n\nThe [info](info) package provides utility functions to manipulate the info\nreturned in the responses from the modem.\n\nThe [serial](serial) package provides a simple wrapper around a third party\nserial driver, so you don't have to find one yourself.\n\nThe [trace](trace) package provides a driver, which may be inserted between the\nAT driver and the underlying modem, to log interactions with the modem for\ndebugging purposes.\n\nThe [cmd](cmd) directory contains basic commands to exercise the library and a\nmodem, including [retrieving details](cmd/modeminfo/modeminfo.go) from the\nmodem, [sending](cmd/sendsms/sendsms.go) and\n[receiving](cmd/waitsms/waitsms.go) SMSs, and\n[retrieving](cmd/phonebook/phonebook.go) the SIM phonebook.\n\n## Features\n\nSupports the following functionality:\n\n- Simple synchronous interface for AT commands\n- Serialises access to the modem from multiple goroutines\n- Asynchronous indication handling\n- Tracing of messages to and from the modem\n- Pluggable serial driver - any io.ReadWriter will suffice\n\n## Usage\n\nThe [at](at) package allows you to issue commands to the modem and receive the\nresponse. e.g.:\n\n```go\nmodem := at.New(ioWR)\ninfo, err := modem.Command(\"I\")\n```\n\nproduces the following interaction with the modem (exact results will differ for your modem):\n\n```shell\n2018/05/17 20:39:56 w: ATI\n2018/05/17 20:39:56 r:\nManufacturer: huawei\nModel: E173\nRevision: 21.017.09.00.314\nIMEI: 1234567\n+GCAP: +CGSM,+DS,+ES\n\nOK\n```\n\nand returns this info:\n\n```go\ninfo = []string{\n    \"Manufacturer: huawei\",\n    \"Model: E173\",\n    \"Revision: 21.017.09.00.314\",\n    \"IMEI: 1234567\",\n    \"+GCAP: +CGSM,+DS,+ES\",\n    }\n```\n\nRefer to the [modeminfo](cmd/modeminfo/modeminfo.go) for an example of how to create a modem object such as the one used in this example.\n\nFor more information, refer to package documentation, tests and example commands.\n\nPackage | Documentation | Tests | Example code\n------- | ------------- | ----- | ------------\n[at](at) | [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/warthog618/modem/at) | [at_test](at/at_test.go) | [modeminfo](cmd/modeminfo/modeminfo.go)\n[gsm](gsm) | [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/warthog618/modem/gsm) | [gsm_test](gsm/gsm_test.go) | [sendsms](cmd/sendsms/sendsms.go), [waitsms](cmd/waitsms/waitsms.go)\n[info](info) | [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/warthog618/modem/info) | [info_test](info/info_test.go) | [phonebook](cmd/phonebook/phonebook.go)\n[serial](serial) | [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/warthog618/modem/serial) | [serial_test](serial/serial_test.go) | [modeminfo](cmd/modeminfo/modeminfo.go), [sendsms](cmd/sendsms/sendsms.go), [waitsms](cmd/waitsms/waitsms.go)\n[trace](trace) | [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go\u0026logoColor=white\u0026style=flat-square)](https://pkg.go.dev/github.com/warthog618/modem/trace) | [trace_test](trace/trace_test.go) | [sendsms](cmd/sendsms/sendsms.go), [waitsms](cmd/waitsms/waitsms.go)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarthog618%2Fmodem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarthog618%2Fmodem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarthog618%2Fmodem/lists"}