{"id":15374223,"url":"https://github.com/moteus/lua-lluv-gsmmodem","last_synced_at":"2025-09-13T16:48:35.451Z","repository":{"id":31713113,"uuid":"35278896","full_name":"moteus/lua-lluv-gsmmodem","owner":"moteus","description":"Control GSM modem connected to serial port using AT commands","archived":false,"fork":false,"pushed_at":"2017-09-25T08:05:06.000Z","size":162,"stargazers_count":12,"open_issues_count":3,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-15T15:11:41.989Z","etag":null,"topics":["gsm","lua","sms"],"latest_commit_sha":null,"homepage":"","language":"Lua","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/moteus.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":"2015-05-08T12:48:35.000Z","updated_at":"2024-10-25T15:29:56.000Z","dependencies_parsed_at":"2022-08-31T09:58:37.679Z","dependency_job_id":null,"html_url":"https://github.com/moteus/lua-lluv-gsmmodem","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moteus/lua-lluv-gsmmodem","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-lluv-gsmmodem","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-lluv-gsmmodem/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-lluv-gsmmodem/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-lluv-gsmmodem/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moteus","download_url":"https://codeload.github.com/moteus/lua-lluv-gsmmodem/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moteus%2Flua-lluv-gsmmodem/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274996280,"owners_count":25387923,"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-09-13T02:00:10.085Z","response_time":70,"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":["gsm","lua","sms"],"created_at":"2024-10-01T13:57:50.779Z","updated_at":"2025-09-13T16:48:35.409Z","avatar_url":"https://github.com/moteus.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lua-lluv-gsmmodem\n[![Licence](http://img.shields.io/badge/Licence-MIT-brightgreen.svg)](LICENSE)\n[![Build Status](https://travis-ci.org/moteus/lua-lluv-gsmmodem.svg?branch=master)](https://travis-ci.org/moteus/lua-lluv-gsmmodem)\n[![Coverage Status](https://coveralls.io/repos/moteus/lua-lluv-gsmmodem/badge.svg)](https://coveralls.io/r/moteus/lua-lluv-gsmmodem)\n\n### Usage\n* Open and configure\n  ```Lua\n  local device = GsmModem.new('COM3', {\n      baud         = '_9600';\n      data_bits    = '_8';\n      parity       = 'NONE';\n      stop_bits    = '_1';\n      flow_control = 'OFF';\n      rts          = 'ON';\n  })\n  device:open(function(self, err, info)\n    if err then\n      print('Fail open port:', err)\n      return self:close()\n    end\n    print('Connected to port:', info)\n    -- Now we should configure modem to allow GsmModem class works properly\n    -- (e.g. sms pdu mode, notify mode for sms and calls)\n    -- Ofcourse you can use it as-is with out configure.\n    self:configure(function(self, err, cmd)\n      if err then\n        print('Configure error:', err, ' Command:', cmd)\n        return self:close()\n      end\n      print('Configure done')\n      -------------------------------------------\n      -- Here you can start do your work\n      -------------------------------------------\n    end)\n  end)\n  ```\n\n* Send SMS\n  ```Lua\n  device:send_sms('+7777777', 'Hello world', function(self, err, ref)\n    print('SMS Send result:', err or 'OK', 'Message reference:', ref or '\u003cNONE\u003e')\n  end)\n  ```\n\n* Send SMS and wait report\n  ```Lua\n  device:send_sms('+7777777', 'Hello world', {waitReport = 'final'}, function(self, err, ref, response)\n    if err or not response.success then\n      print('SMS Send fail:', err or response.info, 'Message reference:', ref or '\u003cNONE\u003e')\n    else\n      print('SMS Send pass', 'Message reference:', ref or '\u003cNONE\u003e')\n    end\n  end)\n  ```\n\n* Send USSD\n  ```Lua\n  device:send_ussd('*100#', function(self, err, msg)\n    print('USSD Result:', err, msg and msg:status(), msg and msg:text())\n  end)\n  ```\n\n* Recv SMS\n  ```Lua\n  device:on('sms::recv', function(self, event, sms)\n    print(\"SMS from:\", sms:number(), \"Text:\", sms:text())\n  end)\n  ```\n\n* Proceed SMS delivery report\n  ```Lua\n  device:on('report::recv', function(self, event, sms)\n    local success, status = sms:delivery_status()\n    print(\"SMS reference:\", sms:reference(), \"Number:\", sms:number(), \"Success:\", success, \"Status:\", status.info)\n  end)\n  ```\n\n* Read SMS\n  ```Lua\n  -- read and delete first SMS from SIM card\n  device:read_sms(1, {memory = 'SM', delete = true}, function(self, err, sms)\n    print(\"SMS from:\", sms:number(), \"Text:\", sms:text())\n  end)\n\n  -- read all unreaded sms from phone memory\n  device:each_sms(GsmModem.REC_UNREAD, {memory='ME'}, function(self, err, idx, sms)\n    if err and not index then\n      -- e.g. invalid memory\n      return print(\"List SMS error:\", err)\n    end\n\n    if err then\n      -- Some times device can return invalid sms on list (CMGL), but you can\n      -- try read sms directly (CMGR) (e.g. device:read_sms(idx ...)\n      -- This is works on my WaveCom SIM300\n      return print(\"Read SMS #\" .. idx .. \" error:\", err)\n    end\n\n    print(\"#\" .. idx, \"SMS from:\", sms:number(), \"Text:\", sms:text())\n  end)\n  ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoteus%2Flua-lluv-gsmmodem","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoteus%2Flua-lluv-gsmmodem","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoteus%2Flua-lluv-gsmmodem/lists"}