BPI-4G LTE 14 pin header problem

Hi. I started using BPI-4G LTE module by 14 pin connector instead of Mini USB port. When I was using the steps mt_gpio.sh 34 dir out and mt_gpio.sh 34 val 1 along with quectel-CM & and dhclient wwan0 one by one manually, I was able connect the internet without any issues. However, when I added all of them in rc.local, I am getting the following error,

[   49.656849] rc.local[1173]: chip id : gpiochip233
[   49.691079] rc.local[1173]: chip id : gpiochip233
[   49.797156] rc.local[1173]: [08-03_18:16:38:575] WCDMA&LTE_QConnectManager_Linux&Android_V1.1.34
[   49.820994] rc.local[1173]: [08-03_18:16:38:576] /root/quectel-CM/quectel-CM profile[1] = (null)/(null)/(null)/0, pincode = (null)
[   49.850948] rc.local[1173]: [08-03_18:16:38:578] Cannot find qmichannel((null)) usbnet_adapter((null)) for Quectel modules
[   50.340439] rc.local[1173]: Cannot find device "wwan0"

If I add quectel-CM & and dhclient wwan0 in .bashrc file of the user and after login, the script is working automatically. But I want to automate all of them in rc.local to enable the internet during bootup and there will be NO user login on the BPI board. May I know if anyone have any idea about how to make these steps automated without need of login.

TIA.

you can try to add you commands in a separate script (e.g. /usr/local/sbin/startlte.sh) wait some time…i guess something is not fully initialized while booting

sleep 30s && startlte.sh

Yes, tested and working fine once I gave 30s delay. If the internet is down for some reason, the 4G module automatically retry for internet connection or we need to write such script separately?.

TIA.

You have to try it…i don’t know how connection works in detail…i guess reconnect should be done automaticly via dhclient.

You can try setting shorter wait in rc.local e.g.15s instead of 30