Using minicom to retrieve modem information stops after x seconds

658 views Asked by At

I am using minicom in order to connect with my modem (quectelEC25). The goal is to send differente AT commands in order to retrieve ceratain information about the modem and save it in a outpu file. I wrote the following script in bash:

#!/bin/bash
while true;
        do
                sudo minicom -D /dev/ttyUSB2 -S script.txt -C AT_modems_responses_1.txt
                sleep 1
        done

Being the script.txt:

send AT
expect OK
send ATI
expect OK
send AT+COPS?
expect OK
start:
  send AT+CCLK?
  expect OK
  send AT+CREG?
  expect OK
  send AT+CSQ
  expect OK
  sleep 1
  goto start

The problem is that the AT commands stop working after 2 minutes (AT+CCLK? & AT+CSQ).

Why does it stop? What is the problem? Should I work with the AT commands in a different way?

Thank you in advance

1

There are 1 answers

0
Nfernandez On BEST ANSWER

The runscript by defautl exists after 120 seconds (2 minutes). This is the reason why the minicom was not working after 2 minutes, in order to run more time, a timeout has to be included in the script. For 5 minutes should be:

timeout 300

Don't know how it can be configured as infinite.