Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/basanovase/sim800
Library for interfacing with SIM800 module in Micropython
https://github.com/basanovase/sim800
Last synced: 3 months ago
JSON representation
Library for interfacing with SIM800 module in Micropython
- Host: GitHub
- URL: https://github.com/basanovase/sim800
- Owner: basanovase
- License: mit
- Created: 2021-08-29T04:51:44.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-15T13:04:49.000Z (about 3 years ago)
- Last Synced: 2024-04-22T12:33:08.437Z (7 months ago)
- Language: Python
- Homepage:
- Size: 14.6 KB
- Stars: 11
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-micropython - sim800 - Library for interfacing with SIM800 module in MicroPython. (Libraries / Communications)
README
# SIM800 MicroPython Library
This library provides an interface for the SIM800 module to perform GSM, GPRS, SMS, and TCP/IP communications using MicroPython on microcontrollers. It includes functions to handle voice calls, SMS, HTTP requests, FTP, and more.
## Installation
Copy the `sim800` folder to your MicroPython device filesystem. I advise a repo structure main.py entrypoint and importing as below.
## Usage
### Initialize the SIM800 Module
```python
from sim800 import SIM800
sim800 = SIM800(uart_pin=1, baud=115200)
```### Send an SMS
```python
from sim800 import SIM800SMS
sim800 = SIM800SMS(uart_pin=1)
sim800.send_sms('+1234567890', 'Hello World')
```### Make a Voice Call
```python
from sim800 import SIM800
sim800 = SIM800(uart_pin=1)
sim800.dial_number('+1234567890')# To hang up the call
sim800.hang_up()
```
### Get Network Time
```python
from sim800 import SIM800
sim800 = SIM800(uart_pin=1)
time = sim800.get_network_time()
print(time)
```
### HTTP GET Request
```python
from sim800 import SIM800TCPIP
sim800 = SIM800TCPIP(uart_pin=1)
sim800.http_init()
sim800.http_set_param("URL", "http://example.com")
response = sim800.http_get()
print(response)
sim800.http_terminate()
```### FTP Download File
```python
from sim800 import SIM800TCPIP
sim800 = SIM800TCPIP(uart_pin=1)
sim800.ftp_init(server='ftp.example.com', username='user', password='pass')
file_content = sim800.ftp_get_file('path/to/file.txt', '/remote/path')
print(file_content)
```
### Get GSM Location
```pythonfrom sim800 import SIM800GPRS
sim800 = SIM800GPRS(uart_pin=1)
location_info = sim800.get_gsm_location()
print("GSM Location Info:", location_info)
```