usim800 is a Python driver module for SIM800 GSM/GPRS .
Project description
usim800
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
usim800-0.0.7.tar.gz
(7.3 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file usim800-0.0.7.tar.gz.
File metadata
- Download URL: usim800-0.0.7.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
80ed47565e846d145e12f2640350cdef4dfaa537b6b73a0622c8c5311173f120
|
|
| MD5 |
57b9927fc916d527e1739ff174bed523
|
|
| BLAKE2b-256 |
31885c10c48f9a7b5798c6bc403eb74738af6daea3c8184b0d78c23b0508a6f7
|
File details
Details for the file usim800-0.0.7-py3-none-any.whl.
File metadata
- Download URL: usim800-0.0.7-py3-none-any.whl
- Upload date:
- Size: 9.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c85e369915c2c287e17ca4798a97525cf338088075c7f902641d9fb64f192be
|
|
| MD5 |
05df7c1e49522f2704eb460a024f8057
|
|
| BLAKE2b-256 |
72572b613ba061df7ee4146ab917e2769e59a93c5a8ac7eb6454db69d5fa6a09
|