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.3.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.3-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: usim800_hamilkar-0.0.3.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.3.tar.gz
Algorithm Hash digest
SHA256 61835be07cf40d77e93c71b5c5f5a70fd9d9812eb196e0c4b77ff8ccff3b0e73
MD5 b86fbff32fde23118bba40937947dc8b
BLAKE2b-256 fa3908990c9a89abb4e5ba827380d995f1fcc59735e633e6fa170a9fc5476d04

See more details on using hashes here.

File details

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

File metadata

  • Download URL: usim800_hamilkar-0.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4f41887567b737d3a84ca5ce14f8295d38fb79580cb5b042770f022fdf0315ab
MD5 17ffc5259a5837a42d7e7fcb43044c96
BLAKE2b-256 8bc972c0c98be361f00bb4b9556e993c1a8511275f687f7e6bd9a7aa2902bb91

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