usim800 is a Python driver module for SIM800 GSM/GPRS (utf-8 support).
Project description
usim800 this project belongs to Bhagyarsh
Github Link : https://github.com/Bhagyarsh/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
usim800forutf8-0.1.3.tar.gz
(9.9 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 usim800forutf8-0.1.3.tar.gz.
File metadata
- Download URL: usim800forutf8-0.1.3.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2e270515beeb8a1e45f79ab9347c6c48b38ee80f1340b1a9ec2ed9d7503c7d23
|
|
| MD5 |
1ba136eb479ee5f06d62fb9ca01d808c
|
|
| BLAKE2b-256 |
714c79f5c4e2d45b757328a7a1e858fc05d5269d65a41fc018f816190da2b3f3
|
File details
Details for the file usim800forutf8-0.1.3-py3-none-any.whl.
File metadata
- Download URL: usim800forutf8-0.1.3-py3-none-any.whl
- Upload date:
- Size: 11.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c3a9edb1a433777385002f98dac878266ad438c276597761cd072c380bf69533
|
|
| MD5 |
c09dcaf2411cf02a451041fdaf610425
|
|
| BLAKE2b-256 |
6051404754c447351dfea3153844deda8e1ad2e045b45d1cd7c814416f27ebd2
|