Skip to main content

Raspberry Pi SIM800L GSM module

Project description

Raspberry Pi SIM800L, SIM800C and SIM800H GSM module

PyPI Python Versions PyPI download month GitHub license

SIM800L GSM module library for Linux systems like the Raspberry Pi. This library was also successfully tested with SIM800C and should also support SIM800H.

This library provides a driver for SIMCom GSM modules (SIM800L, SIM800C, SIM800H) via AT commands over a serial interface. It supports SMS (including multipart), HTTP/HTTPS GET and POST requests, DNS resolution, RTC synchronization, and access to module information. SMS messaging can be done in TEXT, HEX, or PDU mode (default: PDU). Possibly the driver is also compatible with newer modules like SIM7100 and SIM5300.

Key features include:

  • send_sms(): Sends SMS messages, automatically handling multipart when necessary.
  • read_next_message(): Retrieves the next SMS, abstracting message type and reassembling multipart content.
  • http(): Executes HTTP and HTTPS GET/POST requests, returning response status and payload.
  • dns_query(): Resolves domain names to IPs via the module’s DNS functionality.
  • ping(): ICMP ping of a domain name or IP address.
  • internet_sync_time(): syncronize the RTC time with the NTP time server and returns the current NTP time.

The library also exposes over 30 methods to configure and query the SIM module, enabling robust control and integration.

AT Protocol issues

The SIMCom SIM800 series (including models such as SIM800L, SIM800C, and SIM800H) supports a broad set of cellular and Internet features, all accessible through a proprietary AT command set over the module’s asynchronous serial interface. This software utilizes only a limited subset of these AT commands.

The AT command protocol is fundamentally inadequate for reliable and verifiable communication and presents intrinsic limitations when employed for robust operations. Originally designed for simple control of modems, the AT protocol is inherently textual and lacks the formal structure of communication protocols that utilize packetized data exchange.

One critical drawback lies in the nature of message formatting. AT commands are plain-text strings without explicit framing mechanisms. Unlike packet-based protocols, AT messages do not encapsulate data within headers that define payload length, type, or integrity information such as checksums or CRCs. Consequently, parsing and verifying the completeness and correctness of messages becomes error-prone.

Moreover, AT-based communication lacks a standardized state machine or signaling mechanisms to indicate distinct phases of a connection lifecycle. Commands that initiate, maintain, or terminate connections must be issued and interpreted in a predefined order, but the protocol itself does not return the transition between these states. This absence of inherent session management results in brittle implementations, where the client must continually probe the status of operations.

This deficiency becomes even more critical with vendor-specific instructions, which introduce proprietary connection setup sequences requiring polling or conditional branching based on context-sensitive responses, and may also include asynchronous "Unsolicited Result Codes" within the textual communication that needs special processing while managing the workflow. Without structured feedback or flags denoting session phases, the client application must rely on loosely coupled, often ambiguous responses to maintain protocol correctness.

Through an accurately tested heuristic approach, this software attempts to handle all supported operations via the AT protocol in the most robust manner possible, aiming to automatically recover from errors when feasible.

Setup

This module only installs on Linux (not on Windows).

Hw Requirements

  • Linux system with a UART serial port, or Raspberry Pi with Raspberry Pi OS (this library has been tested with Buster and Bullseye).
  • External power supply for the SIM800L (using the Raspberry Pi 5V power supply, a standard diode (1N4007) with voltage drop of about 0.6 volts and a 1 F capacitor might work).

Full information, installation notes, API reference and usage details at the sim800l-gsm-module GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sim800l_gsm_module-2.0.5.tar.gz (51.7 kB view details)

Uploaded Source

File details

Details for the file sim800l_gsm_module-2.0.5.tar.gz.

File metadata

  • Download URL: sim800l_gsm_module-2.0.5.tar.gz
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for sim800l_gsm_module-2.0.5.tar.gz
Algorithm Hash digest
SHA256 8e0318c8fab34cd3c0503684356cc29b73dd00acd4c08247cb96e4af514c7ccd
MD5 355244120bb525bfab377ac052cd3612
BLAKE2b-256 210e9c31bcca97ec913686140df0f8de74b53590ebf1dc66572fdd1b8adfead1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page