GSMTC35


NameGSMTC35 JSON
Version 2.1.1 PyPI version JSON
download
home_pagehttps://github.com/QuentinCG/GSM-TC35-Python-Library
SummaryGSM TC35/MC35 controller (Send/Receive SMS/MMS/Call and a lot more!)
upload_time2024-09-13 16:20:02
maintainerNone
docs_urlNone
authorQuentin Comte-Gaz
requires_pythonNone
licenseMIT
keywords gsm pdu tc35 mc35 at sms mms call phone pin puk phonebook imei imsi ucs2 7bit forward unlock lock
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            # GSM TC35 Python library
[![PyPI version](https://badge.fury.io/py/GSMTC35.svg)](https://badge.fury.io/py/GSMTC35) [![codecov](https://codecov.io/gh/QuentinCG/GSM-TC35-Python-Library/branch/master/graph/badge.svg)](https://codecov.io/gh/QuentinCG/GSM-TC35-Python-Library) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://github.com/QuentinCG/GSM-TC35-Python-Library/blob/master/LICENSE.md) [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/QuentinCG) [![Downloads](https://static.pepy.tech/badge/GSMTC35)](https://pepy.tech/project/GSMTC35) [![Downloads](https://static.pepy.tech/badge/GSMTC35/month)](https://pepy.tech/project/GSMTC35)

## What is it

This python library is designed to be integrated in python or shell projects using TC35 module.
It is multi-platform and compatible with python 3+.

Most functionalities should work with other GSM module using AT commands.

<img src="https://github.com/QuentinCG/GSM-TC35-Python-Library/raw/master/TC35_module.jpg" width="800">

## Functionalities

Non-exhaustive list of GSMTC35 class functionalities:
  - Check/Enter PIN/PUK
  - Lock/Unlock/Change PIN
  - Send/Receive/Delete SMS/MMS
  - Call/Re-call (possible to hide phone number)
  - Hang-up/Pick-up call
  - Enable/disable/check Call/SMS/Fax forwarding
  - Get/Add/Delete phonebook entries (phone numbers + contact names)
  - Sleep with wake up possibilities (Low power consumption)
  - Check if someone is calling
  - Check if there is a call in progress
  - Check call status (call/ringing/...) and get the associated phone number
  - Get last call duration
  - Check if module is alive
  - Switch off
  - Reboot
  - Check sleep mode status
  - Get IDs (manufacturer, model, revision, IMEI, IMSI)
  - Set module to manufacturer state
  - Get the current used operator
  - Get the signal strength (in dBm)
  - Set and get the date from the module internal clock
  - Get list of operators
  - Get list of neighbour cells
  - Get accumulated call meter and accumulated call meter max (in home units)
  - Get temperature status
  - Change the baudrate mode

Non-exhaustive list of shell commands:
  - Send/Receive/Delete SMS/MMS
  - Call
  - Hang-up/Pick-up call
  - Show information (PIN status, operator, signal strength, last call duration, manufacturer/model/revision ID, IMEI, IMSI, date from internal clock, call status and associated phone number, operator list, neighbour cells, accumulated call meter (max), temperature status, sleep mode status)

## How to install (python script and shell)

  - Install package calling `pip install GSMTC35` (or `python setup.py install` from the root of this repository)
  - Connect your GSM module to a serial port
  - Get the port name (you can find it out by calling `python GSMTC35/GSMTC35.py --help` from the root of this repository)
  - Load your shell or python script

Note: If you want to install test dependency and execute the library test, the command is `python setup.py test`

## How to use in shell

```shell
# Get help
python GSMTC35.py --help

# Send SMS or MMS (in UTF-8, using PDU mode)
python GSMTC35.py --serialPort COM4 --pin 1234 --sendSMS +33601234567 "Hello from shell! 你好,你是?"

# Send SMS/MMS (encoded in UTF-8 hexadecimal, using PDU mode)
python GSMTC35.py --serialPort COM4 --pin 1234 --sendEncodedSMS +33601234567 48656C6C6F2066726F6D207368656C6C2120E4BDA0E5A5BDEFBC8CE4BDA0E698AFEFBC9F

# Send (multiple) SMS (in UTF-8, using 'Text Mode', NOT RECOMMENDED)
python GSMTC35.py --serialPort COM4 --pin 1234 --sendTextModeSMS +33601234567 "Hello from shell!"

# Get SMS/MMS (decoded, in plain text)
python GSMTC35.py --serialPort COM4 --pin 1234 --getSMS "ALL"

# Get SMS/MMS (encoded, in hexadecimal, charset specified in response)
python GSMTC35.py --serialPort COM4 --pin 1234 --getEncodedSMS "ALL"

# Get SMS (decoded by TC35 using 'Text Mode', NOT RECOMMENDED)
python GSMTC35.py --serialPort COM4 --pin 1234 --getTextModeSMS "ALL"

# Delete SMS
python GSMTC35.py --serialPort COM4 --pin 1234 --deleteSMS "ALL"

# Call
python GSMTC35.py --serialPort COM4 --pin 1234 --call +33601234567

# Call in hidden mode
python GSMTC35.py --serialPort COM4 --pin 1234 --call +33601234567 True

# Hang up call
python GSMTC35.py --serialPort COM4 --pin 1234 --hangUpCall

# Pick up call
python GSMTC35.py --serialPort COM4 --pin 1234 --pickUpCall

# Show GSM module and network information
python GSMTC35.py --serialPort COM4 --pin 1234 --information

# Use "--debug" to show more information during command
# Use "--nodebug" to not show any warning information during command
```

## How to use in python script

Example of python script using this library:

```python
import sys
from GSMTC35.GSMTC35 import GSMTC35

gsm = GSMTC35()
pin = "1234"
puk = "12345678"
pin2 = "4321"
puk2 = "87654321"

# Mandatory step (PIN/PUK/PIN2/PUK2 will be entered if required, not needed to specify them)
if not gsm.setup(_port="COM3", _pin=pin, _puk=puk, _pin2=pin2, _puk2=puk2):
  print("Setup error")
  sys.exit(2)

if not gsm.isAlive():
  print("The GSM module is not responding...")
  sys.exit(2)

# Send SMS or MMS (if > 140 normal char or > 70 unicode char)
print("SMS sent: "+str(gsm.sendSMS("+33601234567", u'Hello from python script!!! 你好,你是?')))

# Send (multiple) SMS (encoded by TC35 using 'Text Mode', NOT RECOMMENDED)
print("SMS Text Mode sent: "+str(gsm.sendSMS("+33601234567", 'Hello from python script!!!', True)))

# Show all received SMS/MMS (decoded)
rx_sms = gsm.getSMS(GSMTC35.eSMS.ALL_SMS)
print("List of SMS (decoded):")
for sms in rx_sms:
  print(str(sms["phone_number"])+" (id " +str(sms["index"])+", "
        +str(sms["status"])+", "+str(sms["date"])+" "+str(sms["time"])
        +"): "+str(sms["sms"]))

# Show all received SMS/MMS (encoded)
rx_encoded_sms = gsm.getSMS(GSMTC35.eSMS.ALL_SMS, False)
print("List of SMS (encoded):")
for sms in rx_encoded_sms:
  print(str(sms["phone_number"])+" (id " +str(sms["index"])+", "
        +str(sms["status"])+", "+str(sms["charset"])+", "
        +str(sms["date"])+" "+str(sms["time"])+"): "+str(sms["sms"]))

# Show all received SMS (using text mode, NOT RECOMMENDED)
rx_text_mode_sms = gsm.getSMS(GSMTC35.eSMS.ALL_SMS, False, True)
print("List of SMS (using text mode, NOT RECOMMENDED):")
for sms in rx_text_mode_sms:
  print(str(sms["phone_number"])+" (id " +str(sms["index"])+", "
        +str(sms["status"])+", "+str(sms["date"])+" "+str(sms["time"])
        +"): "+str(sms["sms"]))

# Delete all received SMS
print("Delete all SMS: "+str(gsm.deleteSMS(GSMTC35.eSMS.ALL_SMS)))

# Call
print("Called: "+str(gsm.call(phone_number="0601234567", hide_phone_number=False)))

# Re-call same number
print("Re-called: "+str(gsm.reCall()))

# Last call duration
print("Last call duration: "+str(gsm.getLastCallDuration())+"sec")

# Pick up call
print("Picked up: "+str(gsm.pickUpCall()))

# Hang up call
print("Hanged up: "+str(gsm.hangUpCall()))

# Check Call/SMS/Fax/Data forwarding
print("Call/SMS/Fax/Data forwarding status: "+str(gsm.getForwardStatus()))

# Enable/disable Call/SMS/Fax/Data forwarding
print("Enable call forwarding: "+str(gsm.setForwardStatus(GSMTC35.eForwardReason.UNCONDITIONAL, GSMTC35.eForwardClass.VOICE, True, "+33601020304")))
print("Disable call forwarding: "+str(gsm.setForwardStatus(GSMTC35.eForwardReason.UNCONDITIONAL, GSMTC35.eForwardClass.VOICE, False)))

# Add entry in GSM module phonebook
print("Added contact to GSM module phonebook: "
      +str(gsm.addEntryToPhonebook("0600000000", "Dummy contact",
                                   GSMTC35.ePhonebookType.GSM_MODULE)))

# Get entry list in GSM module phonebook:
entries = gsm.getPhonebookEntries(GSMTC35.ePhonebookType.GSM_MODULE)
print("List of stored contacts:")
for entry in entries:
  print(str(entry['index'])+": "+str(entry['contact_name'])+" -> "+str(entry['phone_number']))

# Delete all GSM phonebook entries:
print("Deleted all contact from GSM module phonebook: "
      +str(gsm.deleteAllEntriesFromPhonebook(GSMTC35.ePhonebookType.GSM_MODULE)))

# Check if someone is calling
print("Incoming call: "+str(gsm.isSomeoneCalling()))

# Check if there is a call in progress
print("Call in progress: "+str(gsm.isCallInProgress()))

# Check if someone is calling, if a call is in progress, dialing and the associated phone number
call_state, phone_number = gsm.getCurrentCallState()
print("Call status: "+str(call_state)+" (associated phone number: "+str(phone_number)+")")
print("(-1=No call, 0=Call active, 1=Held, 2=Dialing, 3=Alerting, 4=Incoming, 5=Waiting)")

# Edit SIM Pin
print("SIM Locked: "+str(gsm.lockSimPin(pin)))
print("SIM Unlocked: "+str(gsm.unlockSimPin(pin)))
new_pin = pin # (Just for test)
print("SIM Pin changed: "+str(gsm.changePin(pin, new_pin)))

# Set module clock to current date
print("Clock set: "+str(gsm.setInternalClockToCurrentDate()))

# Show additional information
print("GSM module Manufacturer ID: "+str(gsm.getManufacturerId()))
print("GSM module Model ID: "+str(gsm.getModelId()))
print("GSM module Revision ID: "+str(gsm.getRevisionId()))
print("Product serial number ID (IMEI): "+str(gsm.getIMEI()))
print("International Mobile Subscriber Identity (IMSI): "+str(gsm.getIMSI()))
print("Current operator: "+str(gsm.getOperatorName()))
sig_strength = gsm.getSignalStrength()
if sig_strength != -1:
  print("Signal strength: "+str(sig_strength)+"dBm")
else:
  print("Signal strength: Wrong value")
print("Date from internal clock: "+str(gsm.getDateFromInternalClock()))
print("List of operators: "+str(gsm.getOperatorNames()))
print("Neighbour cells: "+str(gsm.getNeighbourCells()))
print("Accumulated call meter: "+str(gsm.getAccumulatedCallMeter())+" home units")
print("Accumulated call meter max: "+str(gsm.getAccumulatedCallMeterMaximum())+" home units")
print("Is temperature critical: "+str(gsm.isTemperatureCritical()))
print("Is in sleep mode: "+str(gsm.isInSleepMode()))

# Make the GSM module sleep for 20sec (may be wake up by received call or SMS)
sleep_ok, timer_wake, call_wake, sms_wake, temp_wake = \
  gsm.sleep(wake_up_with_timer_in_sec=20, wake_up_with_call=True,
            wake_up_with_sms=True)
print("GSM was in sleep mode ("+str(sleep_ok)+"), wake-up by: Timer ("
      +str(timer_wake)+") or a call ("+str(call_wake)+") or a SMS ("+str(sms_wake)+")")

# Reboot (an init is needed to use gsm functions after such a call)
print("Reboot: "+str(gsm.reboot()))

# Switch off device (gsm will not respond after such a call)
print("Switched off: "+str(gsm.switchOff()))

# At the end, close connection with GSM module
gsm.close()
```

## Examples

List of examples:
  - <a target="_blank" href="https://github.com/QuentinCG/GSM-TC35-Python-Library/blob/master/examples/rest_api/rest_api.py">Expose GSM module to REST-API</a>

## License

This project is under MIT license. This means you can use it as you want (just don't delete the library header).

## Contribute

If you want to add more examples or improve the library, just create a pull request with proper commit message and right wrapping.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/QuentinCG/GSM-TC35-Python-Library",
    "name": "GSMTC35",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "gsm pdu tc35 mc35 at sms mms call phone pin puk phonebook imei imsi ucs2 7bit forward unlock lock",
    "author": "Quentin Comte-Gaz",
    "author_email": "quentin@comte-gaz.com",
    "download_url": "https://files.pythonhosted.org/packages/d7/2f/d68df3216cd531aa5ce64bb4981541c14d2bf1bff4ae57513e2e096d3b15/gsmtc35-2.1.1.tar.gz",
    "platform": "any",
    "description": "# GSM TC35 Python library\n[![PyPI version](https://badge.fury.io/py/GSMTC35.svg)](https://badge.fury.io/py/GSMTC35) [![codecov](https://codecov.io/gh/QuentinCG/GSM-TC35-Python-Library/branch/master/graph/badge.svg)](https://codecov.io/gh/QuentinCG/GSM-TC35-Python-Library) [![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://github.com/QuentinCG/GSM-TC35-Python-Library/blob/master/LICENSE.md) [![Donate](https://img.shields.io/badge/Donate-PayPal-blue.svg)](https://paypal.me/QuentinCG) [![Downloads](https://static.pepy.tech/badge/GSMTC35)](https://pepy.tech/project/GSMTC35) [![Downloads](https://static.pepy.tech/badge/GSMTC35/month)](https://pepy.tech/project/GSMTC35)\n\n## What is it\n\nThis python library is designed to be integrated in python or shell projects using TC35 module.\nIt is multi-platform and compatible with python 3+.\n\nMost functionalities should work with other GSM module using AT commands.\n\n<img src=\"https://github.com/QuentinCG/GSM-TC35-Python-Library/raw/master/TC35_module.jpg\" width=\"800\">\n\n## Functionalities\n\nNon-exhaustive list of GSMTC35 class functionalities:\n  - Check/Enter PIN/PUK\n  - Lock/Unlock/Change PIN\n  - Send/Receive/Delete SMS/MMS\n  - Call/Re-call (possible to hide phone number)\n  - Hang-up/Pick-up call\n  - Enable/disable/check Call/SMS/Fax forwarding\n  - Get/Add/Delete phonebook entries (phone numbers + contact names)\n  - Sleep with wake up possibilities (Low power consumption)\n  - Check if someone is calling\n  - Check if there is a call in progress\n  - Check call status (call/ringing/...) and get the associated phone number\n  - Get last call duration\n  - Check if module is alive\n  - Switch off\n  - Reboot\n  - Check sleep mode status\n  - Get IDs (manufacturer, model, revision, IMEI, IMSI)\n  - Set module to manufacturer state\n  - Get the current used operator\n  - Get the signal strength (in dBm)\n  - Set and get the date from the module internal clock\n  - Get list of operators\n  - Get list of neighbour cells\n  - Get accumulated call meter and accumulated call meter max (in home units)\n  - Get temperature status\n  - Change the baudrate mode\n\nNon-exhaustive list of shell commands:\n  - Send/Receive/Delete SMS/MMS\n  - Call\n  - Hang-up/Pick-up call\n  - Show information (PIN status, operator, signal strength, last call duration, manufacturer/model/revision ID, IMEI, IMSI, date from internal clock, call status and associated phone number, operator list, neighbour cells, accumulated call meter (max), temperature status, sleep mode status)\n\n## How to install (python script and shell)\n\n  - Install package calling `pip install GSMTC35` (or `python setup.py install` from the root of this repository)\n  - Connect your GSM module to a serial port\n  - Get the port name (you can find it out by calling `python GSMTC35/GSMTC35.py --help` from the root of this repository)\n  - Load your shell or python script\n\nNote: If you want to install test dependency and execute the library test, the command is `python setup.py test`\n\n## How to use in shell\n\n```shell\n# Get help\npython GSMTC35.py --help\n\n# Send SMS or MMS (in UTF-8, using PDU mode)\npython GSMTC35.py --serialPort COM4 --pin 1234 --sendSMS +33601234567 \"Hello from shell! \u4f60\u597d\uff0c\u4f60\u662f\uff1f\"\n\n# Send SMS/MMS (encoded in UTF-8 hexadecimal, using PDU mode)\npython GSMTC35.py --serialPort COM4 --pin 1234 --sendEncodedSMS +33601234567 48656C6C6F2066726F6D207368656C6C2120E4BDA0E5A5BDEFBC8CE4BDA0E698AFEFBC9F\n\n# Send (multiple) SMS (in UTF-8, using 'Text Mode', NOT RECOMMENDED)\npython GSMTC35.py --serialPort COM4 --pin 1234 --sendTextModeSMS +33601234567 \"Hello from shell!\"\n\n# Get SMS/MMS (decoded, in plain text)\npython GSMTC35.py --serialPort COM4 --pin 1234 --getSMS \"ALL\"\n\n# Get SMS/MMS (encoded, in hexadecimal, charset specified in response)\npython GSMTC35.py --serialPort COM4 --pin 1234 --getEncodedSMS \"ALL\"\n\n# Get SMS (decoded by TC35 using 'Text Mode', NOT RECOMMENDED)\npython GSMTC35.py --serialPort COM4 --pin 1234 --getTextModeSMS \"ALL\"\n\n# Delete SMS\npython GSMTC35.py --serialPort COM4 --pin 1234 --deleteSMS \"ALL\"\n\n# Call\npython GSMTC35.py --serialPort COM4 --pin 1234 --call +33601234567\n\n# Call in hidden mode\npython GSMTC35.py --serialPort COM4 --pin 1234 --call +33601234567 True\n\n# Hang up call\npython GSMTC35.py --serialPort COM4 --pin 1234 --hangUpCall\n\n# Pick up call\npython GSMTC35.py --serialPort COM4 --pin 1234 --pickUpCall\n\n# Show GSM module and network information\npython GSMTC35.py --serialPort COM4 --pin 1234 --information\n\n# Use \"--debug\" to show more information during command\n# Use \"--nodebug\" to not show any warning information during command\n```\n\n## How to use in python script\n\nExample of python script using this library:\n\n```python\nimport sys\nfrom GSMTC35.GSMTC35 import GSMTC35\n\ngsm = GSMTC35()\npin = \"1234\"\npuk = \"12345678\"\npin2 = \"4321\"\npuk2 = \"87654321\"\n\n# Mandatory step (PIN/PUK/PIN2/PUK2 will be entered if required, not needed to specify them)\nif not gsm.setup(_port=\"COM3\", _pin=pin, _puk=puk, _pin2=pin2, _puk2=puk2):\n  print(\"Setup error\")\n  sys.exit(2)\n\nif not gsm.isAlive():\n  print(\"The GSM module is not responding...\")\n  sys.exit(2)\n\n# Send SMS or MMS (if > 140 normal char or > 70 unicode char)\nprint(\"SMS sent: \"+str(gsm.sendSMS(\"+33601234567\", u'Hello from python script!!! \u4f60\u597d\uff0c\u4f60\u662f\uff1f')))\n\n# Send (multiple) SMS (encoded by TC35 using 'Text Mode', NOT RECOMMENDED)\nprint(\"SMS Text Mode sent: \"+str(gsm.sendSMS(\"+33601234567\", 'Hello from python script!!!', True)))\n\n# Show all received SMS/MMS (decoded)\nrx_sms = gsm.getSMS(GSMTC35.eSMS.ALL_SMS)\nprint(\"List of SMS (decoded):\")\nfor sms in rx_sms:\n  print(str(sms[\"phone_number\"])+\" (id \" +str(sms[\"index\"])+\", \"\n        +str(sms[\"status\"])+\", \"+str(sms[\"date\"])+\" \"+str(sms[\"time\"])\n        +\"): \"+str(sms[\"sms\"]))\n\n# Show all received SMS/MMS (encoded)\nrx_encoded_sms = gsm.getSMS(GSMTC35.eSMS.ALL_SMS, False)\nprint(\"List of SMS (encoded):\")\nfor sms in rx_encoded_sms:\n  print(str(sms[\"phone_number\"])+\" (id \" +str(sms[\"index\"])+\", \"\n        +str(sms[\"status\"])+\", \"+str(sms[\"charset\"])+\", \"\n        +str(sms[\"date\"])+\" \"+str(sms[\"time\"])+\"): \"+str(sms[\"sms\"]))\n\n# Show all received SMS (using text mode, NOT RECOMMENDED)\nrx_text_mode_sms = gsm.getSMS(GSMTC35.eSMS.ALL_SMS, False, True)\nprint(\"List of SMS (using text mode, NOT RECOMMENDED):\")\nfor sms in rx_text_mode_sms:\n  print(str(sms[\"phone_number\"])+\" (id \" +str(sms[\"index\"])+\", \"\n        +str(sms[\"status\"])+\", \"+str(sms[\"date\"])+\" \"+str(sms[\"time\"])\n        +\"): \"+str(sms[\"sms\"]))\n\n# Delete all received SMS\nprint(\"Delete all SMS: \"+str(gsm.deleteSMS(GSMTC35.eSMS.ALL_SMS)))\n\n# Call\nprint(\"Called: \"+str(gsm.call(phone_number=\"0601234567\", hide_phone_number=False)))\n\n# Re-call same number\nprint(\"Re-called: \"+str(gsm.reCall()))\n\n# Last call duration\nprint(\"Last call duration: \"+str(gsm.getLastCallDuration())+\"sec\")\n\n# Pick up call\nprint(\"Picked up: \"+str(gsm.pickUpCall()))\n\n# Hang up call\nprint(\"Hanged up: \"+str(gsm.hangUpCall()))\n\n# Check Call/SMS/Fax/Data forwarding\nprint(\"Call/SMS/Fax/Data forwarding status: \"+str(gsm.getForwardStatus()))\n\n# Enable/disable Call/SMS/Fax/Data forwarding\nprint(\"Enable call forwarding: \"+str(gsm.setForwardStatus(GSMTC35.eForwardReason.UNCONDITIONAL, GSMTC35.eForwardClass.VOICE, True, \"+33601020304\")))\nprint(\"Disable call forwarding: \"+str(gsm.setForwardStatus(GSMTC35.eForwardReason.UNCONDITIONAL, GSMTC35.eForwardClass.VOICE, False)))\n\n# Add entry in GSM module phonebook\nprint(\"Added contact to GSM module phonebook: \"\n      +str(gsm.addEntryToPhonebook(\"0600000000\", \"Dummy contact\",\n                                   GSMTC35.ePhonebookType.GSM_MODULE)))\n\n# Get entry list in GSM module phonebook:\nentries = gsm.getPhonebookEntries(GSMTC35.ePhonebookType.GSM_MODULE)\nprint(\"List of stored contacts:\")\nfor entry in entries:\n  print(str(entry['index'])+\": \"+str(entry['contact_name'])+\" -> \"+str(entry['phone_number']))\n\n# Delete all GSM phonebook entries:\nprint(\"Deleted all contact from GSM module phonebook: \"\n      +str(gsm.deleteAllEntriesFromPhonebook(GSMTC35.ePhonebookType.GSM_MODULE)))\n\n# Check if someone is calling\nprint(\"Incoming call: \"+str(gsm.isSomeoneCalling()))\n\n# Check if there is a call in progress\nprint(\"Call in progress: \"+str(gsm.isCallInProgress()))\n\n# Check if someone is calling, if a call is in progress, dialing and the associated phone number\ncall_state, phone_number = gsm.getCurrentCallState()\nprint(\"Call status: \"+str(call_state)+\" (associated phone number: \"+str(phone_number)+\")\")\nprint(\"(-1=No call, 0=Call active, 1=Held, 2=Dialing, 3=Alerting, 4=Incoming, 5=Waiting)\")\n\n# Edit SIM Pin\nprint(\"SIM Locked: \"+str(gsm.lockSimPin(pin)))\nprint(\"SIM Unlocked: \"+str(gsm.unlockSimPin(pin)))\nnew_pin = pin # (Just for test)\nprint(\"SIM Pin changed: \"+str(gsm.changePin(pin, new_pin)))\n\n# Set module clock to current date\nprint(\"Clock set: \"+str(gsm.setInternalClockToCurrentDate()))\n\n# Show additional information\nprint(\"GSM module Manufacturer ID: \"+str(gsm.getManufacturerId()))\nprint(\"GSM module Model ID: \"+str(gsm.getModelId()))\nprint(\"GSM module Revision ID: \"+str(gsm.getRevisionId()))\nprint(\"Product serial number ID (IMEI): \"+str(gsm.getIMEI()))\nprint(\"International Mobile Subscriber Identity (IMSI): \"+str(gsm.getIMSI()))\nprint(\"Current operator: \"+str(gsm.getOperatorName()))\nsig_strength = gsm.getSignalStrength()\nif sig_strength != -1:\n  print(\"Signal strength: \"+str(sig_strength)+\"dBm\")\nelse:\n  print(\"Signal strength: Wrong value\")\nprint(\"Date from internal clock: \"+str(gsm.getDateFromInternalClock()))\nprint(\"List of operators: \"+str(gsm.getOperatorNames()))\nprint(\"Neighbour cells: \"+str(gsm.getNeighbourCells()))\nprint(\"Accumulated call meter: \"+str(gsm.getAccumulatedCallMeter())+\" home units\")\nprint(\"Accumulated call meter max: \"+str(gsm.getAccumulatedCallMeterMaximum())+\" home units\")\nprint(\"Is temperature critical: \"+str(gsm.isTemperatureCritical()))\nprint(\"Is in sleep mode: \"+str(gsm.isInSleepMode()))\n\n# Make the GSM module sleep for 20sec (may be wake up by received call or SMS)\nsleep_ok, timer_wake, call_wake, sms_wake, temp_wake = \\\n  gsm.sleep(wake_up_with_timer_in_sec=20, wake_up_with_call=True,\n            wake_up_with_sms=True)\nprint(\"GSM was in sleep mode (\"+str(sleep_ok)+\"), wake-up by: Timer (\"\n      +str(timer_wake)+\") or a call (\"+str(call_wake)+\") or a SMS (\"+str(sms_wake)+\")\")\n\n# Reboot (an init is needed to use gsm functions after such a call)\nprint(\"Reboot: \"+str(gsm.reboot()))\n\n# Switch off device (gsm will not respond after such a call)\nprint(\"Switched off: \"+str(gsm.switchOff()))\n\n# At the end, close connection with GSM module\ngsm.close()\n```\n\n## Examples\n\nList of examples:\n  - <a target=\"_blank\" href=\"https://github.com/QuentinCG/GSM-TC35-Python-Library/blob/master/examples/rest_api/rest_api.py\">Expose GSM module to REST-API</a>\n\n## License\n\nThis project is under MIT license. This means you can use it as you want (just don't delete the library header).\n\n## Contribute\n\nIf you want to add more examples or improve the library, just create a pull request with proper commit message and right wrapping.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "GSM TC35/MC35 controller (Send/Receive SMS/MMS/Call and a lot more!)",
    "version": "2.1.1",
    "project_urls": {
        "Homepage": "https://github.com/QuentinCG/GSM-TC35-Python-Library"
    },
    "split_keywords": [
        "gsm",
        "pdu",
        "tc35",
        "mc35",
        "at",
        "sms",
        "mms",
        "call",
        "phone",
        "pin",
        "puk",
        "phonebook",
        "imei",
        "imsi",
        "ucs2",
        "7bit",
        "forward",
        "unlock",
        "lock"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4a8e76e5cff60dd2b0a010d153c7464dd84eee015a84ed14ed474e74f31d3769",
                "md5": "e9346d69e543bd4d57ffeee4f42ba653",
                "sha256": "199fee4e8fe4d24fdc672dae0937904f14f8741ab01a1ac8154bd55931969fbb"
            },
            "downloads": -1,
            "filename": "GSMTC35-2.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "e9346d69e543bd4d57ffeee4f42ba653",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 33571,
            "upload_time": "2024-09-13T16:20:01",
            "upload_time_iso_8601": "2024-09-13T16:20:01.682081Z",
            "url": "https://files.pythonhosted.org/packages/4a/8e/76e5cff60dd2b0a010d153c7464dd84eee015a84ed14ed474e74f31d3769/GSMTC35-2.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "d72fd68df3216cd531aa5ce64bb4981541c14d2bf1bff4ae57513e2e096d3b15",
                "md5": "835e7b9f7a1193c628317e0975141e4f",
                "sha256": "55a575c2c12bcf1427047b57b49746c13206b186c047b93a6ec172ac8226cf8e"
            },
            "downloads": -1,
            "filename": "gsmtc35-2.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "835e7b9f7a1193c628317e0975141e4f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 32988,
            "upload_time": "2024-09-13T16:20:02",
            "upload_time_iso_8601": "2024-09-13T16:20:02.656532Z",
            "url": "https://files.pythonhosted.org/packages/d7/2f/d68df3216cd531aa5ce64bb4981541c14d2bf1bff4ae57513e2e096d3b15/gsmtc35-2.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-09-13 16:20:02",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "QuentinCG",
    "github_project": "GSM-TC35-Python-Library",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": true,
    "lcname": "gsmtc35"
}
        
Elapsed time: 1.25194s