Trouble to talk to modem during boot sequence

Hello,

I have a raspberry 3, with a hat, and a telit LE910C1 module.
I use the standard raspian with no desktop

I have succesfully follow all tutorials, and i am able to set up connectivity throw wwan0, 4G, with my seem. No particular troubles.

But i need to automate the boot, actually i failed.
I know the sequence, wich works after login (using local keyboard). I have a script that work perfectly once logged (root account).
(the sequence is only send AT#ECM=1,0,"","",0 using minicom to device, and then wake up openvpn connection)

I copy this script in init.d, and set it up, it is executed at boot, as awaited.
But i get the following message :
minicom : No termcap entry for unknown

So i have the feeling that the service is running before /dev/ttyUSB2 has finished to set up.
I can find nothing about this error message.

What is the correct way to boot up automatically ?
What i should wait for before run this script ?
According to init.d service, there is a few parameters to set up, i have set up this :
Required-Start: $remote_fs $syslog $network
is it ok ?

the command that get the message is
sudo minicom -D /dev/ttyUSB2 -S /opt/comin/initDTelitLE910C1.script &
the script is

send “AT#ECM=1,0,”","",0"
expect “OK”

Once again after boot up on login, the whole script works perfectly.
What do you recommand ?

Thank you for your help

Found it.

In fact minicom use a term to wrok. At the time the script was running, the term was not set up.
So after a normal startup i have $TERM set up with ‘linux’.
But at the time the script was running $TEM was ‘Dumb’.
I had a line to begin my script :
export TERM=linux

Now that’s ok !

Romain.