How to connect to a cellular modem via USB

What are the process/procedure to access the Mongoto devkit with SIM via a Unix shell interface to fire AT command for status reports/change network parameters via USB connection?

I have done something similarly via Sierra Wireless phone module boards for 4G/LTE SIMs to get status reports on coverage network parameters.

1 Like

Hi CodeHawk,

To connect your laptop to a cellular modem via USB, you could use a terminal program such as screen or mincom (Mac/Linux) or pUTTY (Windows).

How to connect to a cellular modem using screen or minicom:

  1. List the USB connections:

    ls /dev/tty.*
    
  2. Connect to the specific USB port:
    Replace tty.usbmodem12201 with the name of your USB connection
    Connect using screen:

    screen -L /dev/tty.usbmodem12201 115200
    

    Connect using minicom:

    minicom -D  /dev/tty.usbmodem12201 115200
    
  3. Start sending AT Commands
    At my end, this looks something like this:
    Screen Shot 2022-05-04 at 10.18.40

Hi!

I like to use socat especially when using FTDI/CP2102/PL2303 USB dongles.

Examples:

Interactive console with specific connection speed:

socat - /dev/ttyUSB0,echo=0,raw,crlf,b115200

Sending single command to check every 15s whether the modem acquired a network:

watch -n 15 "echo 'AT+COPS?' | socat - /dev/ttyUSB2,crlf,echo=0"

You may check with dmesg | grep "attached to ttyUSB" which /dev/ttyUSBx to use.

1 Like