Quectel EC25-EC miniPCIe


we are facing some issues with Quectel EC25-EC (EC25ECGA-128-SNNS) modems.

During this year we bought one for series of tests to replace our current modems in devices that we are producing, the tests went fine.

To connect to the internet we mount the device as usb ethernet interface and using following commands it successfully connects to the internet:

printf “AT+QCFG=“usbnet”,1\r\n” > /dev/ttyUSB2
printf “AT+CGDCONT=1,“IP”,“internet”\r\n” > /dev/ttyUSB2
printf “AT+CFUN=1,1\r\n” > /dev/ttyUSB2

However, we have recently bought another two that are completely same, only having different SN and they do not connect to the internet at all. We have tried to debug this issue without much success. What can be wrong? Wasnt any FW change in between? How to fix this issue? The problem is that after AT+QCFG command we cant connect to the modem via serial connection from our embedded device using screen /dev/ttyUSB2 115200, so it is hard to debug the issue.

All modems are having the same revision:


Any suggestions please?
Thank you



all have similar settings, cant find a difference when debugging using at commands:
&C: 1
&D: 2
&F: 0
&W: 0
E: 1
Q: 0
V: 1
X: 1
Z: 0
S0: 0
S3: 13
S4: 10
S5: 8
S6: 2
S7: 0
S8: 2
S10: 15

+CSQ: 22,99

Only one difference was in the strength of the signal, for not working one it was following:
+CSQ: 18,99

+COPS: 0,0,“T-Mobile CZ T-Mobile CZ”,7


+IFC: 0,0

+IPR: 115200

+CPAS: (0,3,4)


+QSPN: “T-Mobile CZ”,“T-Mobile CZ”,“T-Mobile CZ”,0,“23001”

+QCFG: “gprsattach”,(0,1)
+QCFG: “nwscanmode”,(0-8),(0,1)
+QCFG: “nwscanseq”,(00-0102030405),(0,1)
+QCFG: “servicedomain”,(0,1,2),(0,1)
+QCFG: “roamservice”,(1,2,255),(0,1)
+QCFG: “band”,(0-200),(0-7FFFFFFFFFFFFFFF),(0-7FFFFFFFFFFFFFFF),(0,1)
+QCFG: “rrc”,(0-4)
+QCFG: “cops_no_mode_change”,(0-1)
+QCFG: “disable_backoff_lte”,(0-1)
+QCFG: “msc”,(0-2)
+QCFG: “sgsn”,(0-2)
+QCFG: “hsdpacat”,(6,8,10-24)
+QCFG: “hsupacat”,(5,6)
+QCFG: “pdp/duplicatechk”,(0,1)
+QCFG: “tdscsq”,(0,1)
+QCFG: “airplanecontrol”,(0,2)
+QCFG: “airplane”,(0-3)
+QCFG: “ledmode”,(0-2)
+QCFG: “ehrpd”,(0,7)
+QCFG: “usbid”,,
+QCFG: “usbee”,
+QCFG: “usbnet”,<0-4>
+QCFG: “usbmode”,(0,1)
+QCFG: “usbcfg”,,,,,<at_port>,,,,
+QCFG: “urc/ri/ring”,(“off”,“pulse”,“always”,“auto”,“wave”),(1-2000),(1-10000),(1-10000),(“off”,“on”),(1-5)
+QCFG: “urc/ri/smsincoming”,(“off”,“pulse”,“always”),(1-2000),(1-5)
+QCFG: “urc/ri/other”,(“off”,“pulse”),(1-2000),(1-5)
+QCFG: “urc/ri/restart”,(0,1)
+QCFG: “risignaltype”,(“respective”,“physical”)
+QCFG: “urc/delay”,(0,1)
+QCFG: “urcdelay”,(0,1),(0-10000)
+QCFG: “agps/string”,(0,1)
+QCFG: “cmux/urcport”,(0-4)
+QCFG: “ModemRstLevel”,(0,1)
+QCFG: “ApRstLevel”,(0,1)
+QCFG: “noauthcheck”,(0,1)
+QCFG: “nwscanmodeex”,(1-63)
+QCFG: “oostimer”,,,
+QCFG: “diversity”,(0-1)
+QCFG: “ppp/termframe”,(0,1)
+QCFG: “ppp/v4v6”,(0,1)
+QCFG: “bootup”,,(0,1)
+QCFG: “nwoptmz/acq”,(0,1),(60-16777200)
+QCFG: “ims”,(0-2)
+QCFG: “pcmclk”,(0,1)
+QCFG: “tone/incoming”,(0,2)
+QCFG: “sim/recovery”,(3-300),(0,5-300),(0,300)
+QCFG: “rssi”,(0-20)
+QCFG: “ltesms/format”[,(0,1)]
+QCFG: “amrcodec”,(0-255)
+QCFG: “apready”,(0,1),(0,1),(100-3000)
+QCFG: “sleepind/level”,(0,1)
+QCFG: “wakeupin/level”,(0,1),(0,1)
+QCFG: “urc/cache”,(0,1)
+QCFG: “thermal/modem”[,,,]
+QCFG: “thermal/limit_rates”[,]
+QCFG: “thermal/txpwrlmt”[,<on_off>,,<temp_threshold>,,<trig_cnt>,<crl_cnt>]
+QCFG: “sim/softsimmode”,(0,9)
+QCFG: “codec/powsave”,(0,1)
+QCFG: “lte/bandprior”,(1-43),(1-43),(1-43)
+QCFG: “codec/powsave”,(0,1)
+QCFG: “qmisync”,(0,1)
+QCFG: “disrplmn”,(0,1)
+QCFG: “vts/async”,(0,1)
+QCFG: “urc/ri/pin”,(“uart_ri”,“uart_dcd”)
+QCFG: “stkauto/setupmenutr”,(0,1)
+QCFG: “iproute_enable”,(0,1)
+QCFG: “imsreg/iptype”,(0,1)
+QCFG: “multi_ip_package”,,<package_max_len>,<package_max_count_in_queue>,
+QCFG: “apn/blocked”,(0,1),(0,1)
+QCFG: “pktsize”
+QCFG: “redir/3gtolte”,(0,1),(0,1),(0,1)
+QCFG: “qcautoconnect”,(0,1)
+QCFG: “volte_disable”,(0,1)
+QCFG: “sim/clk_freq”,(0,1)
+QCFG: “sim/features_status_list”,(0-62),(0,1)
+QCFG: “sim/uim_config_params”,(0-79),(0,1)
+QCFG: “writedata/modem”,,,<data_size>
+QCFG: “writedata/ap”,,,<data_size>
+QCFG: “roaming/voicecall”,(0,1)
+QCFG: “usage/apmem”
+QCFG: “usage/apfs”
+QCFG: “remove_fplmn”,(0,1)
+QCFG: “ftm/mbim”,(0,1)
+QCFG: “ims/ut”,(0,1)
+QCFG: “gpsweek”,(0,1)
+QCFG: “sim/onchip”,(0,1)
+QCFG: “fast/poweroff”,(0,1)
+QCFG: “siminvalirecovery”,(0,1),(1,60),(1,255)
+QCFG: “sleep/datactrl”,(0-7),(50-5000),(0,1)
+QCFG: “disablesrlte”,(0,1)
+QCFG: “sim/type”,(0,1,3)
+QCFG: “epcflag”,(0,1)
+QCFG: “sms/omadm”,(0,1)
+QCFG: “plmn/autoblock”,(0,1),(1-0xFFFFFFFF)
+QCFG: “fast_dormancy”,(0,1,2),(1-65535)
+QCFG: “sarcfg”,(“lte_wcdma”,“gsm”),max_power,row_grads,column_grads
+QCFG: “csdctl”,(0,1)
+QCFG: “hplmn/search_timer”,(1-71582)
+QCFG: “Feature_Switch_Flag”,(0,1),(0x01 – 0xFFFFFFFF)
+QCFG: “efratctl”,(0,1)
+QCFG: “tdd/config”,(0-6),(0-8)
+QCFG: “plmn/addinfbdn”,(0,1)
+QCFG: “icf”,(0-3),(0-3),(0-3)
+QCFG: “mbn/ctcc_compat”,(0,1)
+QCFG: “estk/send_sms”,(0,1)
+QCFG: “dhcppktfltr”,(0,1)
+QCFG: “bip/auth”,(0-3)
+QCFG: “urcport/sms”,(0,1)
+QCFG: “ntp”,(1-10),(5- 60)
+QCFG: “TCP/SendMode”,(0-2)
+QCFG: “freezeband”,(0,1)
+QCFG: “ppp/sleep_ri”,(0,1),(500-50000)
+QCFG: “divctl”,(“lte”,“wcdma”),(0-2)
+QCFG: “watchdog_ctrl”,(0,1),(0-200),(0,1,2,3),(0-200),(0,1,2,3),(1-300)
+QCFG: “rrc/control”,(0,1),(0-60),(0-60),(0-300),(0,1),(0-60)
+QCFG: “qoos”,(0-2),(1-600),(1-43200),(1-600),(1-255),(0-60),(0-60),(0-5),(1-60)
+QCFG: “urc/poweron”,(0,1)
+QCFG: “tcp/windowsize”,(0,1),(16-100)
+QCFG: “pingdiscard”,(0,1)
+QCFG: “lte/preferfre”,op,index,band,bandwith,earfcn,mcc,mnc
+QCFG: “lpm/dataind”,(0-1),(0-7)
+QCFG: “cops_control”,(0,1)


+QURCCFG: “urcport”,(“usbat”,“usbmodem”,“uart1”,“uart2”,“all”)

+CGDCONT: (1-24),“IP”,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24),“PPP”,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24),“IPV6”,(0-2),(0-4),(0-1),(0-1)
+CGDCONT: (1-24),“IPV4V6”,(0-2),(0-4),(0-1),(0-1)


I have solved it. The issue was with AT+CGDCONT settings. Somehow it does not like the commands typed from the script… What is the right way to send the command to the modem from shell script?

So far we have been using in following format:
printf “ATCMDD\r\n” > /dev/ttyUSB2

using echo -e ?

Another issue is now, that after the modem is active on the internet, it does not show anything in the serial console anymore and also we cant connect to the modem using screen /dev/ttyUSB2 115200 anymore. Is there a way, how to see the response from AT command? We need to be able to check the SIM IMEI code from the shell script - we did it this way before and do not want to change it.

That newline character “\n” is not part of the AT command syntax, and shouldn’t be there.

Having said that, most modern modems accept it without problems. But one day it might bite you.

As far as sending AT commands from the shell prompt is concerned, please try eg:

echo "ATI" | socat - /dev/ttyUSB2,crnl

1 Like


unfortunatelly, our board does not have socat at this moment, but following commands are accepted:

echo -e “AT+QCFG=“usbnet”,1” > /dev/ttyUSB2
echo -e “AT+CGDCONT=1,“IP”,“internet”,0,0” > /dev/ttyUSB2
echo -e “AT+CFUN=1,1” > /dev/ttyUSB2

after that the modem connects to the internet and data works properly

However, I am still not able to get the AT command response after the modem is mounted as usb ethernet adapter… What is the right way retrieve the response from console? Previously with Huawei modems, we have been using cat/head commands to read the data with some timeout and than to parse the data and that is not working anymore, as I cant even connect to the console of the modem using screen /dev/ttyUSB2 115200. The connection is refused. If I reboot the board and do not send the script commands for connecting to the internet, I can at least connect to the modem console interface using screen tool and to see the AT cmd responses there.

I will try to crosscompile the socat tool and test it once again with socat.

It works with socat!! Thanks a lot, such a nightmare for me and such an easy solution after all … Incredible :slight_smile: