Home > Linux, osX > Send AT commands to USB modem

Send AT commands to USB modem

The idea to monitor and communicate with the device is the same on both OS, what changes is the device name. For Linux the devices name to use can be found with

sudo dmesg | grep tty

Normally is/dev/ttyUSB0,  /dev/ttyUSB1,  /dev/ttyUSB2,  /dev/ttyUSB3,  /dev/ttyUSB4 for Linux, and on my Mac osX Lion I have

ls -l /dev/cu.*
crw-rw-rw- 1 root wheel /dev/cu.HUAWEIMobile-Diag
crw-rw-rw- 1 root wheel /dev/cu.HUAWEIMobile-Modem
crw-rw-rw- 1 root wheel /dev/cu.HUAWEIMobile-Pcui

For this purpose lets assume a generic device name <DEVICE>, that it is either a Linux or osX tty. First we need to find out which of the several terminal is used for communication, and for that we need to open monitor terminals for each of the devices.

Terminal 1: cat /dev/<DEVICE1>
Terminal 2: cat /dev/<DEVICE2>
Etc..

and in another terminal we send an AT command like this:

echo "ATi^M" > /dev/<DEVICE> #(note: ^M is ctrl+v+m)

And one of the monitor terminals above will show something like this:

ATi
Manufacturer: huawei
Model: E353
Revision: 11.810.09.40.156
IMEI: 86816500xxxxxxxxx
+GCAP: +CGSM,+DS,+ES
OK

In my mac the terminal that I need to use is /dev/cu.HUAWEIMobile-Pcui and in Linux is /dev/ttyUSB0.

About these ads
Categories: Linux, osX
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: