https://github.com/basanovase/sim800
Library for interfacing with SIM800 module in Micropython
https://github.com/basanovase/sim800
Last synced: 13 days 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 (over 4 years ago)
- Default Branch: main
- Last Pushed: 2025-09-14T08:21:23.000Z (7 months ago)
- Last Synced: 2025-09-14T10:13:33.665Z (7 months ago)
- Language: Python
- Homepage:
- Size: 63.5 KB
- Stars: 28
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
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
```python
from sim800 import SIM800GPRS
sim800 = SIM800GPRS(uart_pin=1)
location_info = sim800.get_gsm_location()
print("GSM Location Info:", location_info)
```