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
Release files for usim800 0.0.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| usim800-0.0.7.tar.gz | 7.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| usim800-0.0.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.2 kB
Release files / usim800-0.0.7.tar.gz
| Download URL | usim800-0.0.7.tar.gz |
|---|---|
| Size | 7.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
80ed47565e846d145e12f2640350cdef4dfaa537b6b73a0622c8c5311173f120
|
|
BLAKE2b-256 checksum How to use checksums |
31885c10c48f9a7b5798c6bc403eb74738af6daea3c8184b0d78c23b0508a6f7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / usim800-0.0.7-py3-none-any.whl
| Download URL | usim800-0.0.7-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6c85e369915c2c287e17ca4798a97525cf338088075c7f902641d9fb64f192be
|
|
BLAKE2b-256 checksum How to use checksums |
72572b613ba061df7ee4146ab917e2769e59a93c5a8ac7eb6454db69d5fa6a09
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|