3g.chat AT commands seems not executed on Mango Router latest FW

Hello, I have just upgraded my Mango Router MT-300N-V2 to firmware 3.216.
I am using a 3G USB modem (Huawei E122) to connect to the internet using a mobile operator SIM card with a data-plan.

The Huawei E122 needs a specific sequence of AT commands to connect to the mobile operator, that I provided modifying the vi /etc/chatscripts/3g.chat file.

It looks like the following:

root@GL-MT300N-V2:~# cat /etc/chatscripts/3g.chat

ABORT BUSY
ABORT ‘NO CARRIER’
ABORT ERROR
REPORT CONNECT
TIMEOUT 10
“” “ATE0”
OK “ATZ E0 V1”
OK “AT+CFUN=1”
OK ‘AT+CSCS=“UCS2”’
OK “AT+CREG=2”
OK “AT+CGREG=2”
OK “AT+COPS=3,2;+COPS?”
OK ‘AT+CGDCONT=1,“IP”,“$USE_APN”’
SAY “Calling UMTS/GPRS”
TIMEOUT 30
OK “ATD$DIALNUMBER”
CONNECT ’ ’

Previous firmware revisions of the Mango router always worked fine with this configuration. The USB modem was autodetected and connected properly via /dev/ttyUSB0. The USB modem registered to the network and used the provided APN to get internet connectivity.

Wed Apr 26 05:54:02 2023 daemon.info pppd[26158]: Renamed interface ppp0 to 3g-modem_1_1
Wed Apr 26 05:54:02 2023 daemon.info pppd[26158]: Using interface 3g-modem_1_1
Wed Apr 26 05:54:02 2023 daemon.notice pppd[26158]: Connect: 3g-modem_1_1 ↔ /dev/ttyUSB0

The new firmware 3.216 seems to have introduced a glitch.
The USB modem does not register to the network (no blue LED blinking on it) like if the 3g.chat file does not get executed when the pppd gets started.

I have found a workaround, but it does not look very clean.
I am forcing the AT commands of the 3g.chat file using the rc.local file that gets automatically executed after the Linux Kernel start-up.
I have added those lines to pass the required AT commands. I have also found that a network reload on OpenWRT is needed to get the modem_1_1 interface wan to force ppp0 to retry and restart the modem_1_1 interface.

root@GL-MT300N-V2:~# cat /etc/rc.local

echo -e “ATE0” > /dev/ttyUSB0
echo -e “ATZ E0 V1” > /dev/ttyUSB0
echo -e “AT+CFUN=1” > /dev/ttyUSB0
echo -e “AT+CSCS=“UCS2"”> /dev/ttyUSB0
echo -e “AT+CREG=2” > /dev/ttyUSB0
echo -e “AT+CGREG=2”> /dev/ttyUSB0
echo -e “AT+COPS=3,2;+COPS?” > /dev/ttyUSB0
echo -e “AT+CGDCONT=1,“IP”,”$USE_APN”" > /dev/ttyUSB0
sleep 50
/etc/init.d/network restart

Have you any idea why the 3g.chat AT commands script does not get executed properly when ppp0 starts in the current most actual firmware (3.216)?

You can use the following commands to monitor the execution of AT instructions while dialing.

logread -f