This section introduces how to configure and connect to the network in the QuecPython solution. QuecPython supports multiple types of NICs, each with different usage methods. This chapter will introduce them one by one to facilitate the understanding of network configuration applications.
Network Configuration Introduction
QuecPython supports various types of NICs. How can we configure the NICs to enable them to communicate over the network? This introduces NIC configuration to help you quickly use NIC devices to connect to the network.
QuecPython provides two ways to configure NICs:
QuecPython APIs.
Built-in web service.
Only cellular network modules cannot use the web service.
Cellular NIC
Cellular NICs rely on the network operator. A module must be integrated with a SIM card and be in the coverage of the network operator’s base station to establish a network connection. QuecPython-supported cellular communication modules will automatically connect to the cellular network after power-on.
Example:
Wi-Fi NIC
Wi-Fi NICs have different application scenarios in different working modes. In station mode, the NIC needs to connect to a Wi-Fi hotspot (such as a router) to connect to the network. In AP mode, the Wi-Fi NIC serves as a hotspot, accepting connections from other Wi-Fi devices and providing network services to them.
There are multiple ways to configure Wi-Fi NICs, such as directly entering the hotspot name and password, quick configuration, AP configuration and web page configuration. However, the ultimate goal is to successfully obtain the hotspot name and password. This chapter focuses on loading the Wi-Fi NIC and connecting to the hotspot directly. For other configuration methods, please refer to Wi-Fi NIC.
Example:
General Wi-Fi NIC configuration
Ethernet NIC
In different application scenarios, Ethernet NICs have different operating modes: WAN mode and LAN mode.
WAN Mode
In WAN mode, an Ethernet NIC serves as the WAN port to provide Internet access capability to the module, as shown in the following diagram.
In this mode, you can get a dynamic IP address through DHCP or set a static IP address.
Example of getting an IP address through DHCP:
Example of setting a static IP address:
LAN Mode
In LAN mode, an Ethernet NIC connects with another Ethernet device as a LAN port, thus providing Internet access capability for the device through 4G network, as shown in the following diagram.
In this mode, the module will enable DHCP service by default to assign a dynamic IP address to the connected Ethernet device.
Example:
USB Network Adapter
Currently, the USB network adapter is used when the USB port serves as a LAN port to transfer data through the 4G NIC for Internet access. Both ECM and RNDIS protocols are supported by USB network adapter. You can select one according to your needs. RNDIS can be directly loaded in Windows, while ECM can be directly loaded in Linux/Android/iOS systems.
Cellular communication modules that support USB network adapter are connected to host devices that support ECM or RNDIS protocols via a USB port to provide Internet access for the host device through the 4G network, as shown in the following diagram.

After calling set_worktype(USBNET_Type) to set the protocol type of the USB network adapter, call USBNET.open() to enable the USB network adapter.
USBNET_Type description:
• USBNET.Type_RNDIS: RNDIS protocol. Windows operating system supports RNDIS protocol by default.
• USBNET.Type_ECM: ECM protocol. Linux, Android, iOS, macOS, and other operating systems support ECM protocol by default.
Example:












Top comments (0)