usim800_hamilkar is a Python driver module for SIM800 GSM/GPRS .
Project description
usim800-hamilkar - ahoj!
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
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_hamilkar-0.0.2.1.tar.gz.
File metadata
- Download URL: usim800_hamilkar-0.0.2.1.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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac8ae250a8efe4471ad0789e254da5713934915bb404e443d80dc0da72da55bb
|
|
| MD5 |
ddd5550226507e6de3435adb4e62e400
|
|
| BLAKE2b-256 |
acd521e6048ac40b30a791a7d213c6bc817933f5f84cf6d93970b0602802ba01
|
File details
Details for the file usim800_hamilkar-0.0.2.1-py3-none-any.whl.
File metadata
- Download URL: usim800_hamilkar-0.0.2.1-py3-none-any.whl
- Upload date:
- Size: 17.4 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d419892367e6f8ee176f3b67fa6b2698451c45bb91f42c8292648b68587d9903
|
|
| MD5 |
efcc2e95f1e85dd5fa0e5e8b204fb801
|
|
| BLAKE2b-256 |
207e2fceb7c2e500658e5e611c163ca46248d371143f668ef355efd778b5c44f
|