Overview

The Quectel EG25-G HTTP(S) Communication Script is a comprehensive Python implementation for HTTP/HTTPS communication using the Quectel EG25-G LTE module. It provides a customer-friendly interface with detailed error handling and troubleshooting guidance.

Key Features

  • ✓ Complete HTTP/HTTPS client implementation
  • ✓ Support for GET, POST, and PUT methods
  • ✓ SSL/TLS with client authentication
  • ✓ File upload/download capabilities
  • ✓ Automatic retry logic
  • ✓ Comprehensive error handling

Requirements

  • • Python 3.6 or higher
  • • pyserial library (v3.5)
  • • Quectel EG25-G module
  • • Active SIM card with data service
  • • Serial connection to module

Installation

Quick Download: Click the button above or use the links in the Quick Start Resources section to download the script and requirements file.

1. Download Files

Download the script and requirements file:

Or via command line (if files are hosted):

wget https://quectel-application-node-guide.emon.com.bd/http_application_note_script.py
wget https://quectel-application-node-guide.emon.com.bd/requirements.txt
chmod +x http_application_note_script.py

2. Install Dependencies

pip install -r requirements.txt

3. Verify Serial Port

ls /dev/ttyUSB*    # Linux

Usage

Basic Usage

# Run with default settings
python3 http_application_note_script.py

# Interactive mode
python3 http_application_note_script.py -i

# Quick test with specific URL
python3 http_application_note_script.py -u http://httpbin.org/get

Common APN Settings

Carrier APN Username Password
Sixfab super - -

Note: Please contact your carrier for the correct APN settings if you're not using a Sixfab SIM card

Command Line Arguments

Argument Short Description Default
--port -p Serial port path /dev/ttyUSB2
--baudrate -b Serial baud rate 115200
--apn -a Access Point Name super
--interactive -i Run in interactive mode False
--url -u URL for quick test None
--method -m HTTP method (GET/POST/PUT) GET
--data -d Data for POST/PUT requests None
--verbose -v Enable verbose logging False

Module Error Codes

The script provides detailed descriptions and solutions for all error codes:

Common Error Codes

0 Success
702 Operation timed out
703 HTTP service is busy
707 Failed to open network
714 DNS resolution failed
716 Socket connect error

Network Error Codes

706 Network service busy
708 Network not configured
709 Network deactivated
710 General network error
711 Invalid URL format
730 Invalid parameter

Each error code includes a detailed solution. For example: "Error 714: Check DNS settings or use IP address instead of hostname"

HTTP Status Codes

2xx Success

200 - OK
201 - Created
204 - No Content

4xx Client Error

400 - Bad Request
401 - Unauthorized
403 - Forbidden
404 - Not Found

5xx Server Error

500 - Internal Server Error
502 - Bad Gateway
503 - Service Unavailable
504 - Gateway Timeout

Examples

HTTP GET Request

# Basic GET request
python3 http_application_note_script.py -u http://httpbin.org/get

# GET with custom port and APN
python3 http_application_note_script.py -p /dev/ttyUSB0 -a super -u http://api.example.com/data

Expected Output:

✓ GET request successful
  HTTP Status: 200 - OK - The request was successful
  Content Length: 429 bytes
✓ Response received successfully (429 bytes)

HTTP POST Request

# POST with form data
python3 http_application_note_script.py -u http://httpbin.org/post -m POST -d "name=John&age=30"

# POST with JSON data
python3 http_application_note_script.py -u http://api.example.com/users -m POST -d '{"name":"John","age":30}'

HTTPS with SSL/TLS

# HTTPS GET request
python3 http_application_note_script.py -u https://secure-api.example.com/data

# HTTPS with client certificate authentication
# First, upload certificates to module using AT+QFUPL commands

Interactive Mode

# Start interactive mode
python3 http_application_note_script.py -i

# You'll see a menu:
Options:
  1. HTTP GET Request
  2. HTTP POST Request
  3. HTTP PUT Request
  4. HTTPS GET Request
  5. Check Module Status
  6. Run All Examples
  0. Exit

Troubleshooting

Common Issues

Module Not Responding

  • • Check serial port connection
  • • Verify correct port name: ls /dev/ttyUSB*
  • • Ensure module is powered on
  • • Try different baud rate (115200, 9600)

Network Registration Failed

  • • Check antenna connection
  • • Verify SIM card is active
  • • Ensure you're in coverage area
  • • Check signal strength: AT+CSQ

HTTP Requests Failing

  • • Verify PDP context is activated
  • • Check URL format (include http:// or https://)
  • • Test with a known working URL first
  • • Check firewall/proxy settings

SSL/TLS Errors

  • • Verify server supports TLS version
  • • Check certificate validity
  • • Ensure correct certificate format (PEM)
  • • Try different cipher suites

Debug Tips

Enable verbose logging:
python3 http_application_note_script.py -v
Check log file:
tail -f quectel_eg25g.log
Test AT commands manually:
minicom -D /dev/ttyUSB0 -b 115200

Module Initialization Process

The script performs 8 steps during initialization:

1
Testing module communication

Verifies serial connection with AT command

2
Checking SIM card status

Ensures SIM is inserted and ready

3
Registering on network

Waits for network registration (up to 30s)

4
Attaching to packet service

Enables data service capability

5
Configuring PDP context

Sets up APN and authentication

6
Activating data connection

Establishes data connection (up to 150s)

7
Retrieving IP address

Gets assigned IP from network

8
Configuring HTTP service

Sets up HTTP/HTTPS parameters