Skip to main content

Quectel AT Commands Python Library

A Python library for interacting with Quectel modems and GNSS devices using AT commands. This package provides classes for managing and sending AT commands for modem and GNSS configurations, as well as command-line interfaces (CLIs) for quick access.


This package simplifies interaction with Quectel modems and GNSS modules by providing Python classes and CLI tools for managing configurations and sending AT commands.

Modem source documentation

ECx00x&EG800K&EG810M&EG91xN&EG950A Series - AT Commands Manual
LTE Standard Module Series
Version: 1.3
Date: 2024-09-27
Status: Released

Gnss source documentation

EC2x&EG9x&EG2x-G&EM05 Series - GNSS Application Note
LTE Standard Module Series
Version: 1.3
Date: 2020-09-04
Status: Released

Source code organization :

Whether for modem or gnss, the class methods are numbered according to the chapters in the documentation.

class QuectelModemATCommands:
    # Extract
    def generalCommands201DisplayProductIdentificationInformation(
        self,
    ) -> tuple[bool, list[str]]:
        """
        General commands 201: Display product identification information.

        :return: Tuple containing the status of the command and the response.
        :rtype: tuple[bool, list[str]]
        """
        return self.sendCommand("ATI")

generalCommands201DisplayProductIdentificationInformation is the method name:

  • generalCommands is the chapter name in the documentation.
  • 201 corresponds to chapter 2.1 in the documentation.
  • DisplayProductIdentificationInformation is the title of the chapter in the documentation : "Display product identification information".

Installation

Install the package using pip:

pip install quectelatcommands

Usage

This package provides two main classes and corresponding CLI tools:

  1. QuectelModemATCommandsCLI: For interacting with Quectel modems.
  2. QuectelGnssATCommandsCLI: For GNSS (Global Navigation Satellite System) configurations.

Python API

QuectelModemATCommands

This class allows you to send AT commands to a Quectel modem for various configurations and operations.

Example:

from quectelatcommands import QuectelModemATCommands

# Initialize with default port and baudrate
modem = QuectelModemATCommands("/dev/ttyUSB2", 115200)

# Open connection
modem.open()

# Send a command to display product identification information
status, response = modem.generalCommands201DisplayProductIdentificationInformation()
print(response if status else "Error sending command")

# Close connection
modem.close()

Available Methods in QuectelModemATCommands (Examples):

  • generalCommands201DisplayProductIdentificationInformation: Displays modem information.
  • packetDomainCommands1015PacketDataCounterWrite: Configures packet data counters.
  • statusControlCommands40314RiSignalOutputCarrier: Sets the RI signal output carrier type.

Refer to the class documentation for a full list of available AT commands.

QuectelGnssATCommands

This class provides GNSS-specific AT commands for configuring output ports, enabling or disabling NMEA sentence acquisition, and more.

Example:

from quectelatcommands import QuectelGnssATCommands

# Initialize with default port and baudrate
gnss = QuectelGnssATCommands("/dev/ttyUSB1", 115200)

# Open connection
gnss.open()

# Configure the output port for NMEA sentences
status, response = gnss.configureGnss2201ConfigureOutputPortOfNmeaSentencesWrite("usbnmea")
print(response if status else "Error sending command")

# Close connection
gnss.close()

Available Methods in QuectelGnssATCommands (Examples):

  • configureGnss2201ConfigureOutputPortOfNmeaSentencesWrite: Sets the output port for NMEA sentences.
  • configureGnssEnableDisableNmeaSentencesAcquisition: Enables or disables NMEA sentence acquisition.

Refer to the class documentation for a complete list of available commands.

Command-Line Interface (CLI)

The package provides two CLI commands, modem-cli and gnss-cli, for quick command execution without writing a script.

Modem CLI (modem-cli)

Example Usage:

quectelModemATCommandsCLI --help

Output:

Usage: quectelModemATCommandsCLI [OPTIONS] COMMAND [ARGS]...

  CLI for interacting with the Quectel modem via AT commands.

Options:
  -p, --port TEXT         Serial port to use.  [default: /dev/ttyUSB2]
  -b, --baudrate INTEGER  Baudrate to use.  [default: 115200]
  -t, --timeout INTEGER   Timeout for serial communication.  [default: 1]
  --help                  Show this message and exit.

Commands:
  call-related-commands           Group for call related commands.
  free-at-command                 Free AT command.
  general-command                 Group for general AT commands.
  hardware-related-commands       Group for hardware related commands.
  network-service-commands        Group for network services commands.
  packet-domain-commands          Group for packet domain commands.
  phonebook-commands              Group for phonebook commands.
  serial-interface-control        Group for serial interface control...
  short-message-service-commands  Group for short message service commands.
  sim-related-commands            Group for SIM related commands.
  status-control-commands         Group for status control commands.

GNSS CLI (gnss-cli)

Example Usage:

quectelGnssATCommandsCLI configure-gnss --help

Output:

Usage: quectelGnssATCommandsCLI configure-gnss [OPTIONS] COMMAND [ARGS]...

  Configure GNSS 20201.

Options:
  --help  Show this message and exit.

Commands:
  configure-agnss-positioning-protocols
                                  Configure AGNSS...
  configure-agps-positioning-mode
                                  Configure AGPS...
  configure-nmea-output-frequency
                                  Configure NMEA output...
  configure-odp-mode              Configure ODP mode.
  configure-output-port-of-nmea-sentences
                                  Configure output port...
  configure-output-type-of-beidou-nmea-sentences
                                  Configure output type...
  configure-output-type-of-galileo-nmea-sentences
                                  Configure output type...
  configure-output-type-of-glonass-nmea-sentences
                                  Configure output type...
  configure-output-type-of-gps-nmea
                                  Configure output type...
  configure-plane-mode-used-by-mo-agps-session
                                  Configure plane mode...
  configure-supl-protocol-version
                                  Configure SUPL...
  configure-supported-gnss-constellations
                                  Configure supported...
  enable-disable-acquisition-of-nmea-sentences
                                  Enable/disable...
  enable-disable-dpo-mode         Enable/disable DPO mode.
  enable-disable-gnss-extended-ggsv
                                  Enable/disable GNSS...
  enable-disable-gnss-to-run-automatically
                                  Enable/disable GNSS to...

Requirements

This library requires the following dependencies:

  • pyserial: For handling serial communication with the Quectel modem/GNSS devices.
  • click: For building the command-line interfaces.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more details.

Additional Information

For more details on the AT commands used by this library, please refer to the official Quectel AT command documentation provided by Quectel for your specific modem or GNSS device model.

Troubleshooting

If you encounter issues with serial communication:

  • Ensure the correct permissions are set on the serial device (e.g., /dev/ttyUSB2).
  • Verify the serial port and baud rate (e.g., 115200) match those required by your Quectel device.

Known Limitations

Given the large number of possible AT commands, the classes are not fully tested. If you find bugs, don't hesitate to correct them by submitting a PR.

Metadata

Release files for quectelatcommands 1.0.20

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for quectelatcommands 1.0.20
File Size Uploaded Provenance Actions
quectelatcommands-1.0.20.tar.gz 74.7 kB Without provenance Details for quectelatcommands-1.0.20.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for quectelatcommands 1.0.20
File Interpreter ABI Platform Actions
quectelatcommands-1.0.20-py3-none-any.whl Python 3 none any Details for quectelatcommands-1.0.20-py3-none-any.whl

Total release size: 147.4 kB

Release files / quectelatcommands-1.0.20.tar.gz

Download URL quectelatcommands-1.0.20.tar.gz
Size 74.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9db45b17c0425b33a962fc7c28def93dd5d668a03bf78057dbcdeeb301cd403f
BLAKE2b-256 checksum
How to use checksums
8321bcf8492fe04f2a029da3e34531ea0bd21291000fb8687deb73d2cead9a38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Release files / quectelatcommands-1.0.20-py3-none-any.whl

Download URL quectelatcommands-1.0.20-py3-none-any.whl
Size 72.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
864933f36f7835bb96260094c86184a5f1042ee9c2ce4b64bb09d00164f34ca5
BLAKE2b-256 checksum
How to use checksums
c0832f82fd2a843e02d4fae62fb131df43375ced16be6b2cd44db56ed680234d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.10.20

Security for quectelatcommands 1.0.20

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page