Linux 4G & 5G Configuration¶
Note
Please note that the network modules (EC20, EC200M, RG200U) referenced in this document have been tested and verified for use only within China. Their operation in other regions/countries may not be supported. It is recommended that users acquire and test their own network modules suitable for their local environment.
The board supports connection of 4G or 5G modules via USB interface as well as onboard MiniPCIe interface. The onboard MiniPCIe interface and supported modules are listed in the table below:
| Motherboard | SoC | Platform | Onboard MiniPCIe Supported Modules |
|---|---|---|---|
| K1 | RK3568 | Rockchip | EC20, EC200M |
| K1B | RK3568 | Rockchip | / |
| K1MINI | RK3568 | Rockchip | / |
| K2B | H618 | Allwinner | / |
| K2C | H618 | Allwinner | EC20, EC200M |
| K3 | RK3562 | Rockchip | EC20, EC200M |
| K3B | RK3562 | Rockchip | / |
| K4B | T113 | Allwinner | EC20, EC200M |
| K5C | A133 | Allwinner | EC20, EC200M |
| K7 | RK3576 | Rockchip | EC20, EC200M, RG200U |
| K7C | RK3576 | Rockchip | EC20, EC200M |
| K7S | RK3576 | Rockchip | EC20, EC200M |
| K8 | RK3588 | Rockchip | EC20, EC200M, RG200U |
| K8D | RK3588S2 | Rockchip | / |
| K9 | T527 | Allwinner | EC20 |
| K10B | A733 | Allwinner | / |
| K11C | RK3566 | Rockchip | / |
MiniPCIe Interface¶
- Example of K7 MiniPCIe slot hardware installation
Warning
Please install/remove the network module only when the board is powered off. The SIM card supports hot-swapping.


Script Configuration¶
The 4G/5G mobile module is automatically configured at boot: the system detects the module and performs dial-up configuration.
Tip
By default, dial-up is attempted only once at boot. In cases of poor signal or communication anomalies, dial-up may fail. If there is no network, you can manually run the dial-up script to retry.
$ cat /usr/bin/hardware-optimization
4g_config() {
wait_time=30
for((i=1;i<=$wait_time;i++));
do
if [ -c /dev/ttyUSB2 ]; then
echo "$i: 4g /dev/ttyUSB2 exists and is a character device." >> $LOG_FILE
/usr/bin/4G_dialing.sh
break;
else
echo "$i: 4g /dev/ttyUSB2 does not exist or is not a character device." >> $LOG_FILE
sleep 1
fi
done
}
Dial-up script, which supports RG200U / EC200 / EC20:
$ cat /usr/bin/4G_dialing.sh
#!/bin/bash
DIRECTORY="/dev/serial/by-id"
Serial_port=""
counter=0
FORCE_CONFIG=0
Switching_mode() {
PRODUCT_NAME=$(cat "$device_dir/product")
MANUFACTURER=$(cat "$device_dir/manufacturer")
SERIAL_NUMBER=$(cat "$device_dir/serial")
if [ "$SERIAL_NUMBER" == "" ]; then
Serial="usb-${MANUFACTURER}_${PRODUCT_NAME}"
else
Serial="usb-${MANUFACTURER}_${PRODUCT_NAME}_$SERIAL_NUMBER"
fi
for file in $(ls "$DIRECTORY" | grep "$Serial" | sort); do
if [ "$counter" -eq 2 ]; then
Serial_port=$file
break
fi
counter=$((counter + 1))
done
}
for device_dir in /sys/bus/usb/devices/*; do
if [ -e "$device_dir/idProduct" ]; then
product_id=$(cat "$device_dir/idProduct")
# EC200: 6002 / 6001 / 6005
if [ "$product_id" = "6002" ] || [ "$product_id" = "6001" ] || [ "$product_id" = "6005" ]; then
for interface in ${device_dir}/*/net/*; do
name=$(basename $interface)
done
if [ ! -e "/sys/class/net/$name" ]; then
Switching_mode "$device_dir"
if [ -e $DIRECTORY/$Serial_port ]; then
echo -e "AT+QCFG=\"usbnet\",1" >$DIRECTORY/$Serial_port
sleep 1
/usr/bin/quectel-CM >>/tmp/4G.log 2>&1 &
fi
fi
fi
# EC20: 0125
if [ "$product_id" = "0125" ]; then
for interface in ${device_dir}/*/net/*; do
name=$(basename $interface)
done
if [ ! -e "/sys/class/net/$name" ]; then
Switching_mode "$device_dir"
if [ -e $DIRECTORY/$Serial_port ]; then
echo -e "AT+QCFG=\"usbnet\",0" >$DIRECTORY/$Serial_port
sleep 1
/usr/bin/quectel-CM >>/tmp/4G.log 2>&1 &
fi
fi
fi
# RG200U: 0900
if [ "$product_id" = "0900" ]; then
RG200U_config "$device_dir"
fi
fi
done
Network Testing¶
1. Check whether the module is detected by reviewing the logs.
Tip
The message /dev/ttyUSB2 exists and is a character device. indicates that the device has been successfully recognised.
$ cat /tmp/kickpi-hardware.log
1: 4g /dev/ttyUSB2 does not exist or is not a character device.
2: 4g /dev/ttyUSB2 does not exist or is not a character device.
...
24: 4g /dev/ttyUSB2 does not exist or is not a character device.
25: 4g /dev/ttyUSB2 exists and is a character device.
Alternatively, check whether /dev/ttyUSB2 exists:
2. Check whether dial-up is successful.
Tip
The network interface name is in the format enx* (* is a variable suffix). Please refer to the actual environment for the exact name.
$ ifconfig
enxca7f24fb0e94: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.138.192.102 netmask 255.255.255.0 broadcast 10.138.192.255
inet6 fe80::583f:ed51:782d:318d prefixlen 64 scopeid 0x20<link>
ether ca:7f:24:fb:0e:94 txqueuelen 1000 (Ethernet)
RX packets 181 bytes 15185 (14.8 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 194 bytes 17394 (16.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
3. Ping network test.
Tip
Specify the device enx* when running the ping test.
$ ping www.baidu.com -I enxca7f24fb0e94
PING www.wshifen.com (103.235.46.115) from 10.138.192.102 enxca7f24fb0e94: 56(84) bytes of data.
64 bytes from 103.235.46.115 (103.235.46.115): icmp_seq=1 ttl=45 time=1094 ms
64 bytes from 103.235.46.115 (103.235.46.115): icmp_seq=2 ttl=45 time=3924 ms
64 bytes from 103.235.46.115 (103.235.46.115): icmp_seq=3 ttl=45 time=1870 ms
Customising Dial-up Functionality¶
The board uses the official quectel-CM tool for dial-up by default. If you need to modify or customise the dial-up functionality, download the Quectel Linux software for customisation.