{"id":21078547,"url":"https://github.com/wilsonwang371/sim-access","last_synced_at":"2025-08-17T01:06:39.606Z","repository":{"id":54376770,"uuid":"184964684","full_name":"wilsonwang371/sim-access","owner":"wilsonwang371","description":"SIM module library for sending text and receiving call notifications","archived":false,"fork":false,"pushed_at":"2022-06-30T05:43:39.000Z","size":78,"stargazers_count":47,"open_issues_count":0,"forks_count":7,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-07-01T10:04:41.996Z","etag":null,"topics":["python3","raspberry-pi","serialport","sim-module","sim7000","sim800"],"latest_commit_sha":null,"homepage":"","language":"Python","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/wilsonwang371.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":"2019-05-05T01:55:03.000Z","updated_at":"2023-07-21T05:54:38.000Z","dependencies_parsed_at":"2022-08-13T13:50:27.982Z","dependency_job_id":null,"html_url":"https://github.com/wilsonwang371/sim-access","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/wilsonwang371/sim-access","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonwang371%2Fsim-access","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonwang371%2Fsim-access/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonwang371%2Fsim-access/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonwang371%2Fsim-access/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wilsonwang371","download_url":"https://codeload.github.com/wilsonwang371/sim-access/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wilsonwang371%2Fsim-access/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270792128,"owners_count":24646000,"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-16T02:00:11.002Z","response_time":91,"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":["python3","raspberry-pi","serialport","sim-module","sim7000","sim800"],"created_at":"2024-11-19T19:40:53.046Z","updated_at":"2025-08-17T01:06:39.519Z","avatar_url":"https://github.com/wilsonwang371.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sim-access\nA Python module for managing SIM modules\n\n\n## Setup\nThe setup is:\n- A serial sim module SIM7500A (SIM800L is supported too).\n- A USB to serial module connecting my computer with SIM7500A. \n\nThe reason I am using a USB to Serial module is because I always want to make things easier to integrate with different setups. I hate connecting different GPIO wires with the SIM module and this is not sexy at all. With a USB to Serial module. It can be easier to plug and unplug to your systems.\n\n\u003cimg src=\"./images/sim7500a.jpeg\" height=160\u003e \u003cimg src=\"./images/usb-to-serial.jpeg\" width=200\u003e\n\n\n## Coding\n\n### Texts and Calls\n\nTo receive SMS and calls, you need to write a class from base class SIMModuleBase. There are two method you need to implement. **on_sms()** and **on_call()**. Here is one example.\n\n```python\nclass MySIM(SIMModuleBase):\n    def on_sms(self, number, content):\n        print('Text from: {0}, Content: \\\"{1}\\\"'.format(number, content))\n\n    def on_call(self, number):\n        print('Got phone call from {0}'.format(number))\n        time.sleep(5)\n        self.call_hangup()\n\n    def on_call_missed(self, number):\n        ''' This function is not working for SIM800\n        '''\n        self.sms_send(number, 'Sorry, I missed your call!')\n\nif __name__ == '__main__':\n    MySIM().mainloop()\n\n```\n\nYou can detach the mainloop thread\n\n``` python\n    a.mainloop(True)\n```\n\nYou can manage the loop yourself\n\n``` python\n    while True:\n        # do something 1 ...\n        a.loop_once()\n        # do something 2 ...\n```\n\n### GPS\n\nYou can also get your GPS locations, date and time using method **gps_location_date_time**\n\n``` python\n    class MySIM(SIMModuleBase):\n        ...\n    \n    sim = MySIM()\n    ((mylong, mylat), mydate, mytime) = sim.gps_location_date_time('\u003cYOUR APN\u003e')\n    print('Longitude: {0}\\nLatitude: {1}\\nDate: {2}\\nTime: {3}\\n'.format(mylong, mylat, mydate, mytime))\n```\n\n\nWhenever you received an SMS, **on_sms()** willl be called. If you receive a phone call, **on_call()** will be called. Please note that **on_call()** could be called multiple times during a phone call.\n\nThere is no implemenation of answering the phone call right now. The SIM module I bought does not support answering phone calls.\n\n## Implementation\n\nInternally, I use a thread to monitor incoming texts and calls.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilsonwang371%2Fsim-access","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwilsonwang371%2Fsim-access","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwilsonwang371%2Fsim-access/lists"}