Configuring 4G

User can choose the device with 4G version, which needs to be configured before using 4G network.

Use The NetworkManager Tool To Configure The Network

If you need to connect to a 4G network, you need to create a gsm network connection first. The following configuration is based on different scenarios.

Scenarios Without APN Configuration

If the user's 4G network does not need to be configured with APN, it can be configured according to the following steps.

Steps:

  1. Customize a gsm network name, such as 4G1.
  2. Execute the following command to create a gsm network named 4G1.
sudo nmcli connection add type gsm con-name 4G1
image-20240603171201731

Scenarios With APN Configuration

If the user's 4G network needs to be configured with APN, it can be configured with reference to the following steps.

Steps:

  1. Customize a gsm network name (for example, 4G2) and get the name of APN (for example, apn1).
  2. Execute the following command to create a gsm network named 4G2.
sudo nmcli connection add type gsm con-name 4G2 ifname cdc-wdm0 gsm.apn apn1
image-20240603171237161

Scenario Where Username And Password Need To Be Configured

If the user's 4G network needs to be configured with a username and password, you can refer to the following steps.

Steps:

  1. Customize a gsm network name (for example, 4G3), and respectively obtain the number, name and password of the gsm network to be configured (for example, 777, mycdma, mobile).
  2. Execute the following command to create a gsm network named 4G3.
sudo nmcli connection add type gsm con-name 4G3 ifname cdc-wdm0 ifname cdc-wdm0 gsm.number 777 gsm.username mycdma gsm.password mobile
image-20240603171435803

Configure The Network By Using The dhcpcd Tool

By default, automatic dialing is prohibited in 4G networks. If users want to start automatic dialing and use the network, they need to enable "lte-reconnect.service" service. You can configure as follows according to different scenarios requirements.

Scenarios Without APN Configuration

If the user's 4G network does not need to be configured with APN, it can be configured according to the following steps.

Steps:

  1. Execute the following command to enable the "lte-reconnect.service" service.
sudo systemctl enable lte-reconnect.service
  1. Execute the following command to start the "lte-reconnect.service" service and make automatic dialing.
sudo systemctl start lte-reconnect.service
  1. Execute the following command to check the status of the wwan interface.
ifconfig

Scenarios With APN Configuration

If the user's 4G network needs to be configured with APN, it can be configured with reference to the following steps.

Steps:

  1. Get the name of APN (for example, APN22).
  2. Execute the following command to enable the "lte-reconnect.service" service.
sudo systemctl enable lte-reconnect.service
  1. Execute the following command to start the "lte-reconnect.service" service and make automatic dialing.
sudo systemctl start lte-reconnect.service
  1. Execute the following command to check the status of the wwan interface.
ifconfig
  1. Execute the following command to open /usr/share/ed-ec20-qmi/lte-reconnect.sh file.
sudo nano /usr/share/ed-ec20-qmi/lte-reconnect.sh
  1. Change the dialing command "$BSP_HOME_PATH/quectel-CM -4 -f $LOGFILE &" to "$BSP_HOME_PATH/quectel-CM -4 -f $LOGFILE -s apn22 &". Where "apn22" is the name of the obtained APN.
  2. Use Ctrl+X to save the file and exit edit mode.
  3. Execute the following command to restart the "lte-reconnect.service" service.
sudo systemctl restart lte-reconnect.service

Configure 4G Module Reset

When the device fails to recognize the SIM card, you can reset the 4G module through the command line.

Steps:

  1. Execute the following commands to detect and install gpiod tools.
sudo apt update
sudo apt install gpiod
  1. Execute the following command to reset the 4G module.
gpiofind 4G_RST | awk '{print substr($0,9)}' | xargs -i bash -c "gpioset {}=0"