Application of Wireless Module Based on EPCM3568B-LI — 4G Edition

Recommended Video

Application of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G Edition

This article introduces the use of the 4G module on the EPCM3568B-LI 5G intelligent edge computing gateway device.

Application of Wireless Module Based on EPCM3568B-LI — 4G Edition IntroductionThe EPCM3568B-LI/EPCM3568C-LI is a powerful industrial EMC edge computing gateway product developed by ZLG Zhiyuan Electronics. This product features a hardware compatibility design, standardizing the communication module interfaces. It reserves an M.2 socket for connecting 5G/RedCap modules and can also be compatible with MiniPCIe interface 4G modules through an adapter board. The full compatibility design of 4G/5G/RedCap in EPCM3568B-LI/EPCM3568C-LI allows it to easily meet various communication needs such as wide coverage, high performance, and low power consumption in fragmented IoT scenarios.Application of Wireless Module Based on EPCM3568B-LI — 4G Edition Using the 4G ModuleThe system is pre-configured to support the Quectel EC20 module. The following are the steps for using this module.1. Preliminary Preparation

  • One EPCM3568B-LI/EPCM3568C-LI device;
  • One MiniPCIe-to-M.2 adapter board, as shown in Figure 1 (left);
  • One EC20CE module, as shown in Figure 1 (right).

Application of Wireless Module Based on EPCM3568B-LI — 4G Edition

Figure 1 MiniPCIe-to-M.2 adapter board (left), EC20CE MiniPCIe 4G module accessory (right)

2. Installing the 4G ModuleAfter opening the EPCM3568B-LI/EPCM3568C-LI device casing, insert the MiniPCIe EC20 4G module into the M.2 B KEY interface adapter and connect it to the motherboard’s M.2 B KEY socket. Connect the 4G antenna and insert the (U)SIM card, as shown in Figure 2:

Application of Wireless Module Based on EPCM3568B-LI — 4G Edition

Figure 23. Module RecognitionThe EPCM3568B-LI device is configured to automatically load the firmware driver.After powering on the EPCM3568B-LI device, check if the 4G module is recognized.3.1 The following device nodes are generated in the /dev directory

Application of Wireless Module Based on EPCM3568B-LI — 4G Edition

Figure 33.2 Use the ifconfig command to check if the usb0 node is generated, indicating that the 4G module has been recognized and the driver has been successfully loaded.

Application of Wireless Module Based on EPCM3568B-LI — 4G Edition

Figure 44. Dialing for Internet Access4.1 QMI DialingNote: The default dialing method is QMI.Use the quectel-CM tool to dial and obtain an IP address, testing the mobile 4G card for internet access:Telecom card: ctnet, Mobile card: cmnet, Unicom card: 3gnet

root@epc356x-devel:/home/zlg# quectel-CM -s &[1] 1099root@epc356x-devel:/home/zlg# [06-05_16:35:55:164] Quectel_QConnectManager_Linux_V1.6.0.16[06-05_16:35:55:166] Find /sys/bus/usb/devices/5-1 idVendor=0x2c7c idProduct=0x125, bus=0x005, dev=0x002[06-05_16:35:55:173] Auto find qmichannel = /dev/qcqmi0[06-05_16:35:55:178] Auto find usbnet_adapter = usb0[06-05_16:35:55:183] netcard driver = GobiNet, driver version = 5.10.110[06-05_16:35:55:190] ioctl(0x89f3, qmap_settings) failed: Operation not supported, rc=-1[06-05_16:35:55:197] Modem works in QMI mode[06-05_16:35:55:246] Get clientWDS = 7[06-05_16:35:55:278] Get clientDMS = 8[06-05_16:35:55:310] Get clientNAS = 9[06-05_16:35:55:342] Get clientUIM = 10[06-05_16:35:55:374] Get clientWDA = 11[06-05_16:35:55:406] requestBaseBandVersion EC20CEHCLGR06A05M1G[06-05_16:35:55:534] requestGetSIMStatus SIMStatus: SIM_READY[06-05_16:35:55:535] requestSetProfile[1] ///0[06-05_16:35:55:598] requestGetProfile[1] ///0[06-05_16:35:55:630] requestRegistrationState2 MCC: 460, MNC: 0, PS: Attached, DataCap: LTE[06-05_16:35:55:662] requestQueryDataCall IPv4ConnectionStatus: DISCONNECTED[06-05_16:35:55:664] ifconfig usb0 0.0.0.0[06-05_16:35:56:366] ifconfig usb0 down[06-05_16:35:56:527] requestSetupDataCall WdsConnectionIPv4Handle: 0xe179e250[06-05_16:35:56:545] ifconfig usb0 up[06-05_16:35:56:545] busybox udhcpc -f -n -q -t 5 -i usb0udhcpc: started, v1.30.1udhcpc: sending discoverudhcpc: sending select for10.42.9.32udhcpc: lease of 10.42.9.32 obtained, lease time 7200

Check if the IP address has been obtained:

root@epc356x-devel:/home/zlg# ifconfig usb0usb0: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST>  mtu 1500        inet 10.42.9.32  netmask 255.255.255.192  broadcast 10.42.9.63        inet6 fe80::f41b:5cff:fe06:a979  prefixlen 64  scopeid 0x20<link>        ether f6:1b:5c:06:a9:79  txqueuelen 1000  (Ethernet)        RX packets 2  bytes 612 (612.0 B)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 22  bytes 3031 (2.9 KiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Test network connectivity:

root@epc356x-devel:/home/zlg# ping www.baidu.comPING www.baidu.com (183.240.99.169) 56(84) bytes of data.64 bytes from 183.240.99.169 (183.240.99.169): icmp_seq=1 ttl=52 time=90.3 ms64 bytes from 183.240.99.169 (183.240.99.169): icmp_seq=2 ttl=52 time=69.4 ms64 bytes from 183.240.99.169 (183.240.99.169): icmp_seq=3 ttl=52 time=57.9 ms64 bytes from 183.240.99.169 (183.240.99.169): icmp_seq=4 ttl=52 time=60.8 ms64 bytes from 183.240.99.169 (183.240.99.169): icmp_seq=5 ttl=52 time=64.2 ms

4.2 ECM DialingSwitch to ECM mode:

echo -e "AT+QCFG=\"usbnet\",1\r\n" > /dev/ttyUSB2

After rebooting, check if the switch was successful:

cat /dev/ttyUSB2 & echo -e "AT+QCFG=\"usbnet\"\r\n" > /dev/ttyUSB2

If the following is returned, it indicates a successful switch to ECM mode:

root@epc356x-devel:/home/zlg# cat /dev/ttyUSB2 & root@epc356x-devel:/home/zlg# echo -e "AT+QCFG=\"usbnet\"\r\n" > /dev/ttyUSB2 +QCFG: "usbnet",1OK

Configure PDP:

// For Telecom operator echo -e "AT+CGDCONT=1,\"IP\",\"CTNET\"\r\n" > /dev/ttyUSB2 // For Unicom operator echo -e "AT+CGDCONT=1,\"IP\",\"3GNET\"\r\n" > /dev/ttyUSB2 // For Mobile operator echo -e "AT+CGDCONT=1,\"IP\",\"CMNET\"\r\n" > /dev/ttyUSB2

Dial:

echo -e "AT+QNETDEVCTL=1,1,1\r\n" > /dev/ttyUSB2

Obtain IP address:

udhcpc -i usb0

Test network connectivity:

ping www.baidu.com

Application of Wireless Module Based on EPCM3568B-LI — 4G Edition Q&AQ1 Dialing Failure / Unable to Obtain IPFollow these steps for troubleshooting:1. The module is not configured for QMI mode: Check if the dialing mode of the module is correctly configured, use the following command to check the dialing mode.

cat /dev/ttyUSB2 & echo -e "AT+QCFG=\"usbnet\"\r\n" > /dev/ttyUSB2

If it returns +QCFG: “usbnet”,1, it indicates ECM dialing mode. If using QMI dialing, execute the following command to switch back to QMI dialing mode:

echo -e "AT+QCFG=\"usbnet\",0\r\n" > /dev/ttyUSB2

2. Driver not loaded or other conflictsAfter confirming that the module is properly inserted, the antenna is connected, and the SIM card status (can access the internet) is normal, check the driver loading status. Use the dmesg command to see if there are any of the following kernel prints:In QMI mode, the driver automatically loads the GobiNet driver. If you need to switch to the QMI_WWAN driver, you can remove /usr/lib/modules/5.10.110/kernel/drivers/net/usb/GobiNet.ko and restart the device. Choose the required driver based on the application scenario.

[ 17.794334] usb 5-1: new high-speed USB device number 2using xhci-hcd [ 17.930536] usb 5-1: New USB device found, idVendor=2c7c, idProduct=0125, bcdDevice= 3.18 [ 17.930575] usb 5-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0[ 17.930588] usb 5-1: Product: Android [ 17.930601] usb 5-1: Manufacturer: Android [ 18.081294] option 5-1:1.0: GSM modem (1-port) converter detected [ 18.082787] usb 5-1: GSM modem (1-port) converter now attached to ttyUSB0 [ 18.085663] option 5-1:1.1: GSM modem (1-port) converter detected [ 18.087365] usb 5-1: GSM modem (1-port) converter now attached to ttyUSB1 [ 18.090730] option 5-1:1.2: GSM modem (1-port) converter detected [ 18.092486] usb 5-1: GSM modem (1-port) converter now attached to ttyUSB2 [ 18.094562] option 5-1:1.3: GSM modem (1-port) converter detected [ 18.096265] usb 5-1: GSM modem (1-port) converter now attached to ttyUSB3 [ 18.098028] find the interface for QUECTEL_VENDOR [ 18.239528] GobiNet: Quectel_Linux&Android_GobiNet_Driver_V1.6[ 18.271607] GobiNet::GobiNetDriverBind in 88, out 5[ 18.273915] GobiNet 5-1:1.4 usb0: register'GobiNet' at usb-xhci-hcd.0.auto-1, GobiNet Ethernet Device, 02:26:e6:16:80:93[ 18.276874] creating qcqmi0

Check if the device nodes are generated:

ls -l /dev/ | grep qcqmi0

Check if the network nodes usb0/wwan0 are generated

ifconfig -a

3. Check the 4G module information to troubleshoot the issueList the currently available 4G modules

root@epc356x-devel:/home/zlg# mmcli -L    /org/freedesktop/ModemManager1/Modem/0 [Quectel] EC20F

Obtain detailed information about the 4G module:

root@epc356x-devel:/home/zlg# mmcli -m 0  --------------------------------  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0           |            device id: cb8803df26fff3ec0b293197bea9c1a099be1e8d  --------------------------------  Hardware |         manufacturer: Quectel           |                model: EC20F           |    firmware revision: EC20CEHCLGR06A05M1G           |            supported: gsm-umts, lte           |              current: gsm-umts, lte           |         equipment id: 869446074787727  --------------------------------  System   |               device: /sys/devices/platform/usbhost/fd000000.dwc3/xhci-hcd.0.auto/usb5/5-1           |              drivers: option1, GobiNet           |               plugin: quectel           |         primary port: ttyUSB2           |                ports: ttyUSB0 (qcdm), ttyUSB1 (gps), ttyUSB2 (at), ttyUSB3 (at),           |                       usb0 (net)  --------------------------------  Numbers  |                  own: xxx  --------------------------------  Status   |       unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)           |                state: registered           |          power state: on           |          access tech: lte           |       signal quality: 80% (recent)  --------------------------------  Modes    |            supported: allowed: 2g, 3g, 4g; preferred: none           |              current: allowed: 2g, 3g, 4g; preferred: none  --------------------------------  IP       |            supported: ipv4, ipv6, ipv4v6  --------------------------------  3GPP     |                 imei: 869446074787727           |          operator id: 46000           |        operator name: CHINA MOBILE           |         registration: home  --------------------------------  3GPP EPS | ue mode of operation: csps-2  --------------------------------  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0
  • firmware revision: EC20CEHCLGR06A05M1G The firmware version of the 4G module is maintained by the 4G module manufacturer.
  • signal quality: 80% (recent) The signal quality of the 4G signal, the higher the percentage, the better the signal. If it is 0%, please check the antenna connection, SIM card status (whether it is overdue, or the card slot has poor contact, loose), etc.
  • state: registered The SIM card is registered normally.
  • operator name: CHINA MOBILE The currently registered operator CHINA MOBILE is China Mobile.

4. Abnormal network configurationGenerally, when using quectel-CM dialing, the IP is automatically obtained, but if the IP cannot be obtained, you can try to manually obtain the IP address.

udhcpc -i usb0 or dhclient usb0

Try pinging an external server to test network connectivity:

ping 8.8.8.8

Try pinging to test domain name resolution:

ping www.baidu.com

If pinging 8.8.8.8 is normal but cannot access the internet, check the DNS settings and gateway settings.

DNS settings:

// Add the following: vim /etc/resolv.conf ...nameserver 8.8.8.8

Check gateway and routing configuration:

ip route route -n If there is no default gateway, you can manually add: ip route add default via <gateway-ip> dev usb0

Q2 When dialing with quectel-CM, the SIM card status always shows SIM_ABSNET

Application of Wireless Module Based on EPCM3568B-LI — 4G Edition

Figure 51. Ensure the physical connection of the SIM card is normal

  • Power off the device, remove the SIM card, and check for physical damage (such as scratches, oxidation);
  • Use another device (such as a mobile phone) to test whether the SIM card can be recognized normally, to rule out SIM card damage issues;
  • If using an IoT card, confirm whether there are any mandatory binding issues with the device. You can first replace it with a mobile phone card for testing to rule out SIM card issues;
  • Reinsert the SIM card, ensuring the direction is correct (the notch aligns with the card slot direction) for proper installation.

2. Use AT commands to check the SIM card status

cat /dev/ttyUSB2 & echo -e "AT+CPIN?\r\n" > /dev/ttyUSB2

Possible return values and their meanings:

  • CPIN: READY : The SIM card is normal, no PIN code required.
  • CPIN: SIM PIN: PIN code is required (send AT+CPIN=1234, replace 1234 with the actual PIN code).
  • CPIN: SIM ABSENT: The module did not detect the SIM card.
  • ERROR: AT command format error or the module did not respond.

3. Try disabling the SIM card auto-detection feature of the module and reboot.

echo -e "AT+QSIMDET=0,0\r\n" > /dev/ttyUSB2

4. Hardware fault troubleshooting

  • Replace the SIM card slot or try using another EC20 module;
  • Check if there are any cold solder joints on the PCB (especially in the SIM card interface circuit).

Q3 Unable to recognize the module, no /dev/ttyUSB* device nodes generatedCheck if the module is properly inserted, if the module is damaged, and confirm whether the firmware version includes the relevant driver.If using another 4G module, the reason may be that the device ID is not written into the driver. You need to obtain the 4G module’s device vid and pid from the boot information each time you start, and then write it into the driver using the following command.

echo "2c7c 6005 ff" > /sys/bus/usb-serial/drivers/option1/new_id

2c7c is the vid of the actual 4G module used, and 6005 is the pid of the actual 4G module used.Q4 How to set up automatic dialing on bootCreate a dialing script in the /etc/init.d directory as follows:

#!/bin/bash### BEGIN INIT INFO# Provides: zlg# Required-Start: # Required-Stop: # Default-Start: # Default-Stop: # Short-Description: EC20_startup_script### END INIT INFO# set -x
LOG_FILE="/var/log/4G_init.log"
# Clear the log file before each run > "$LOG_FILE"echo "Startup 4g" >> $LOG_FILEec20_start() {    while true    do        if [ -e "/sys/class/net/usb0" ]; then            echo "Detected modem on usb0" >> $LOG_FILE        else            sleep 2            echo "Try again" >> $LOG_FILE            continue        fi        quectel-CM -s >> $LOG_FILE 2>&1 &&        sleep 3        ping 8.8.8.8 -W 1 -c 1 > /dev/null        if [[ $? -ne 0 ]];then        sleep 1             killall quectel-CM             continue      else        echo "ec20 startup success." >> $LOG_FILE        break;      fi     done}
case "$1" in start)        ec20_start        sleep 1        ;;stop)    killall quectel-CM    ;;restart)    # First stop the service    $0 stop    # Then start the service again    $0 start;;  *)    echo "Usage: $0 {start|stop|restart}"    exit 1esacexit 0

Grant execution permission to the script:

sudo chmod +x /etc/init.d/ec20_startup_script.sh

Add the script startup command before exit 0 at the end of the /etc/rc.local file, such as:

vim /etc/rc.local ... /etc/init.d/ec20_startup.sh start && exit 0

Finally, execute sync to save, then reboot and test the automatic dialing of the 4G module.Q5 How to use NetworkManager to manage the 4G networkCheck if the 4G module has started, list the current 4G module list.

root@epc356x-devel:/home/zlg# mmcli -L    /org/freedesktop/ModemManager1/Modem/0 [Quectel] EC20F

Currently, there is only one 4G module, the 0 at the end of /org/freedesktop/ModemManager1/Modem is the index of the 4G module. Remember this index, as it will be used in the remaining commands to communicate with the 4G module.Query detailed information about the 4G module:

root@epc356x-devel:/home/zlg# mmcli -m 0  --------------------------------  General  |            dbus path: /org/freedesktop/ModemManager1/Modem/0           |            device id: cb8803df26fff3ec0b293197bea9c1a099be1e8d  --------------------------------  Hardware |         manufacturer: Quectel           |                model: EC20F           |    firmware revision: EC20CEHCLGR06A05M1G           |            supported: gsm-umts, lte           |              current: gsm-umts, lte           |         equipment id: 869446074787727  --------------------------------  System   |               device: /sys/devices/platform/usbhost/fd000000.dwc3/xhci-hcd.0.auto/usb5/5-1           |              drivers: option1, GobiNet           |               plugin: quectel           |         primary port: ttyUSB2           |                ports: ttyUSB0 (qcdm), ttyUSB1 (gps), ttyUSB2 (at), ttyUSB3 (at),           |                       usb0 (net)  --------------------------------  Numbers  |                  own: xxx  --------------------------------  Status   |       unlock retries: sim-pin (3), sim-puk (10), sim-pin2 (3), sim-puk2 (10)           |                state: registered           |          power state: on           |          access tech: lte           |       signal quality: 80% (recent)  --------------------------------  Modes    |            supported: allowed: 2g, 3g, 4g; preferred: none           |              current: allowed: 2g, 3g, 4g; preferred: none  --------------------------------  IP       |            supported: ipv4, ipv6, ipv4v6  --------------------------------  3GPP     |                 imei: 869446074787727           |          operator id: 46000           |        operator name: CHINA MOBILE           |         registration: home  --------------------------------  3GPP EPS | ue mode of operation: csps-2  --------------------------------  SIM      |            dbus path: /org/freedesktop/ModemManager1/SIM/0

From the above information, obtain the primary port number as ttyUSB2, and use the following command to create a 4G network connection:

sudo nmcli con add type gsm ifname ttyUSB2 con-name test-ec20-con apn "cmnet" ipv4.method auto ipv6.method ignore

Start the connection

sudo nmcli c up test-ec20-con

Stop the connection

sudo nmcli c down test-ec20-con

Check the connection status

sudo nmcli c show test-ec20-con

Test network connection

ping www.baidu.com

Set to automatically connect on boot

sudo nmcli con modify test-ec20-con connection.autoconnect yes

Set to automatically reconnect on disconnection (default is enabled)

sudo nmcli con modify test-ec20-con connection.autoconnect-retries 5
Application of Wireless Module Based on EPCM3568B-LI — 4G Edition

5G Industrial IoT Edge Computing Intelligent Gateway

EPCM3568 Series

  • 5G Link

  • Multi-Protocol

  • Industrial Grade

  • Multi-Cloud Platform

Application of Wireless Module Based on EPCM3568B-LI — 4G Edition

Long press to purchase

Application of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G EditionApplication of Wireless Module Based on EPCM3568B-LI — 4G Edition

Leave a Comment