Network Configuration

Published: (April 17, 2026 at 05:32 AM EDT)
3 min read
Source: Dev.to

Source: Dev.to

Network Configuration Introduction

QuecPython supports various types of NICs. This guide explains how to configure each NIC to enable network communication.

Configuring NICs

QuecPython provides two ways to configure NICs:

  • QuecPython APIs
  • Built‑in web service (not available for cellular network modules)

Cellular NIC

Cellular NICs rely on the network operator. A module must have a SIM card installed and be within the operator’s coverage area to establish a connection. Supported cellular communication modules automatically connect to the network after power‑on.

Example

# Cellular NIC auto‑connect after power‑on

Wi‑Fi NIC

Wi‑Fi NICs can operate in different modes:

  • Station mode – connects to an existing Wi‑Fi hotspot (e.g., a router) to access the network.
  • AP mode – acts as a hotspot, allowing other Wi‑Fi devices to connect and use its network services.

Configuration methods include:

  • Direct entry of SSID and password
  • Quick configuration
  • AP configuration
  • Web page configuration

This section focuses on loading the Wi‑Fi NIC and connecting directly to a hotspot.

General Wi‑Fi NIC configuration example

# Load Wi‑Fi NIC
# Connect to SSID "MyHotspot" with password "MyPassword"

Ethernet NIC

Ethernet NICs can operate in two modes: WAN mode and LAN mode.

WAN Mode

In WAN mode, the Ethernet NIC serves as the module’s WAN port, providing Internet access. You can obtain an IP address via DHCP or set a static IP address.

Static IP configuration example

# Set static IP
ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up
route add default gw 192.168.1.1 eth0

LAN Mode

In LAN mode, the Ethernet NIC connects to another Ethernet device, offering Internet access to that device through the module’s 4G network. DHCP service is enabled by default, assigning a dynamic IP address to the connected device.

Example

# LAN mode – DHCP enabled automatically

USB Network Adapter

The USB network adapter allows the USB port to function as a LAN port, routing data through the 4G NIC for Internet access. Both ECM and RNDIS protocols are supported:

  • RNDIS – works natively on Windows.
  • ECM – works natively on Linux, Android, iOS, macOS, and other operating systems.

Cellular modules that support the USB network adapter can connect to host devices (supporting ECM or RNDIS) via USB, providing Internet access through the 4G network.

USBNET.Type description

  • USBNET.Type_RNDIS – RNDIS protocol (default support on Windows).
  • USBNET.Type_ECM – ECM protocol (default support on Linux, Android, iOS, macOS, etc.).

Example

# Select protocol
usbnets = USBNET.Type_RNDIS   # for Windows
# or
usbnets = USBNET.Type_ECM      # for Linux/Android/iOS/macOS
0 views
Back to Blog

Related posts

Read more »