AT-GSM
Python lib for AT GSM commands
Install
pip install atgsm
Usage
from atgsm import AT
AT.get_ports_list()
# Ex result: ['/dev/ttyXX1', '/dev/ttyXX2']
# Create new device instance
device = AT('/dev/ttyACM0', baudrate=115200)
############################
# Device related functions #
############################
device.is_responding()
# return boolean (ex: True)
device.get_imei()
# return device IMEI (ex: '000000000000001')
device.set_imei(new_imei)
# - new_imei = string (new imei number to set)
# return boolean (ex: True)
device.get_imsi()
# return SIM IMSI (ex: '000000000000001')
device.get_iccid()
# return SIM ICCID (ex: '00000000000000000001')
device.get_signal_strength()
# return signal strength from 0 to 31 (ex: 12')
device.is_network_ready()
# return boolean (ex: True)
device.reboot()
# return nothing
#########################
# SIM related functions #
#########################
device.is_sim_locked()
# return boolean (ex: True)
device.unlock_sim(pin)
# return boolean of success (ex: True)
device.change_sim_pin(actual_pin, new_pin)
# return boolean of success (ex: True)
device.disable_sim_pin(pin)
# return boolean of success (ex: True)
device.enable_sim_pin(pin)
# return boolean of success (ex: True)
device.reset_sim_pin(puk, new_pin)
# return boolean of success (ex: True)
#########################
# SMS related functions #
#########################
device.send_sms(phone_number, content)
# - phone_number = string (destination phone number)
# - content = string (sms content)
# return nothing
device.get_sms_list(include_read, keep_unread)
# - include_read = boolean (include already read messages only if True)
# - keep_unread = boolean (keep messages unread only if True)
# return list of messages dicts, ex :
# [{'index': '1', 'status': 'REC READ', 'readed': True, 'sender': '+33XXXXXXXXX', 'time': '2023/XX/XX XX:XX:XX+XX', 'content': 'This is text'}]
device.get_sms(message_index, keep_unread)
# - message_index = int (index of specific message to get)
# - keep_unread = boolean (keep messages unread only if True)
# return requested message as dict, ex :
# {'index': '1', 'status': 'REC READ', 'readed': True, 'sender': '+33XXXXXXXXX', 'time': '2023/XX/XX XX:XX:XX+XX', 'content': 'This is text'}
device.delete_sms(message_index)
# - message_index = int (index of specific message to delete)
# return boolean of success (ex: True)
device.delete_all_sms(include_unread)
# - include_read = boolean (delete also unread messages if True)
# return boolean of success (ex: True)
##############################
# Contacts related functions #
##############################
device.get_contact(contact_id)
# - contact_id = int (id of specific contact to get)
# return requested contact as dict
# {'id': 1, 'name': 'My phone number', 'number': '+33XXXXXXXXX'}
device.set_contact(contact_id, contact_name, contact_phone_number)
# - contact_id = int (id of specific contact to create)
# - contact_name = string (name of contact to create)
# - contact_phone_number = string (phone number of contact to create)
# return boolean of success (ex: True)
###########################
# Calls related functions #
###########################
device.dial(phone_number)
# - phone_number = string (phone number to dial)
# return boolean of success (ex: True)
device.answer()
# (answer to incomming call)
# return boolean of success (ex: True)
device.hang_up()
# (hang up actual call)
# return boolean of success (ex: True)
device.press_key(key)
# - key = string (key to press on keypad during call)
# return boolean of success (ex: True)
device.get_call_count()
# return current calls counts for each status (active, held, dialing, alerting, incoming, waiting, total) as dict, ex :
# {'active': 1, 'held': 0, 'dialing': 0, 'alerting': 0, 'incoming': 1, 'waiting':0, 'total': 2}
Metadata
Release files for atgsm 0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| atgsm-0.4.tar.gz | 4.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| atgsm-0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 9.6 kB
Release files / atgsm-0.4.tar.gz
| Download URL | atgsm-0.4.tar.gz |
|---|---|
| Size | 4.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a1d00759c97e1bf39860e8c81fea93b6de3b7d1a490a131bbb20d2fadc33a18e
|
|
BLAKE2b-256 checksum How to use checksums |
ebcd16e2c0bdd5fddecfae2f701039ecde6f1aa544deb5369091ddc68da85091
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|
Release files / atgsm-0.4-py3-none-any.whl
| Download URL | atgsm-0.4-py3-none-any.whl |
|---|---|
| Size | 5.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
848112cddef9a55f223e264150166bee093ab7f3e4269b159b85289ebc5d677c
|
|
BLAKE2b-256 checksum How to use checksums |
1bb6f76b3e8f9a57c9833c281f9ca52afe3355b30b7004ea8a97d63c597064e8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.5
|