Skip to main content

usim800_hamilkar is a Python driver module for SIM800 GSM/GPRS .

Project description

usim800-hamilkar - ahoj!

image image image

usim800 is a Python driver module for SIM800 GSM/GPRS . Its has easy-to-use api to access GPRS and to send sms .

Support

  • raspberry pi
  • Tested on python 3 with orange pi zero and linux machine using (usb to ttl) .

Features

Send Get and post requests(supports HTTP/1.1).

requests API similar to pythons Requests module.

Send SMS

Installation

> pip install usim800

Quick start :

Import

>>> from usim800 import sim800
>>> import json
>>> gsm = sim800(baudrate=9600,path="/dev/ttyUSB3")

set APN

>>> gsm.requests.APN = "www"

get and post request

>>> gsm.requests.get(url="http://my-json-server.typicode.com/typicode/demo/posts")
>>> r = gsm.requests
>>> r.status_code
'200'
>>> r.content
b'[  {    "id": 1,    "title": "Post 1"  },  {    "id": 2,    "title": "Post 2"  },  {    "id": 3,    "title": "Post 3"  }]'
>>> r.json()
[[{'id': 1, 'title': 'Post 1'}, {'id': 2, 'title': 'Post 2'}, {'id': 3, 'title': 'Post 3'}]]
>>> r.IP
'10.110.188.15'
>>> data = {"name":"somthing...."}
>>> gsm.requests.post(url="http://ptsv2.com/t/usim800/post",data=json.dumps(data))
'201'
>>> r.status_code
'201'
>>> r.content
b'Thank you for this dump. I hope you have a lovely day!'

>>> r.IP
'10.182.199.208'

SMS

>>> gsm.sms.send("8850813167","hi from usim800")
True

Future Plan and improvements

  • better error handling
  • read sms

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

usim800_hamilkar-0.0.2.5.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

usim800_hamilkar-0.0.2.5-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file usim800_hamilkar-0.0.2.5.tar.gz.

File metadata

  • Download URL: usim800_hamilkar-0.0.2.5.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.3

File hashes

Hashes for usim800_hamilkar-0.0.2.5.tar.gz
Algorithm Hash digest
SHA256 fa85cb0319786652b174048e3ec7295657f566aaf17334d766db081daa64b99f
MD5 2be49e974ad9b6c5030d6fcded0578f5
BLAKE2b-256 39f58b1130bf5a128ee8182194ceb4063993d48d7cb58e0f8a75ee3a5a8956e6

See more details on using hashes here.

File details

Details for the file usim800_hamilkar-0.0.2.5-py3-none-any.whl.

File metadata

  • Download URL: usim800_hamilkar-0.0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.7.3

File hashes

Hashes for usim800_hamilkar-0.0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 63ad0fa7e38fb3f5e0e16faa3fcc9ae6cdf502dad0133daecdb4d2a62dd33303
MD5 cb1c6819fc30f5ae2c71abfba2f548ac
BLAKE2b-256 74c67646ea40586530e9d472d268337c7f5b9e79159b13ecfd9c7b1532e63244

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page