PoiNtEr->: AT-Commands

                             Difference between a dream and an aim. A dream requires soundless sleep, whereas an aim requires sleepless efforts.

Search This Blog

Friday, December 28, 2012

AT-Commands



In this tutorial I will walk through the steps of sending and receiving text message (SMS) from your Ubuntu laptop using a package called minicom. We also need a modem which dials into the telco provider. For this I use a USB Wifi modem.


Firstly connect the USB Wifi modem to a USB port of your laptop or PC. Fire up your mnicom program. If it was not installed, you can easily do so by typing:

#apt-get install minicom

To launch minicom, type:

root@ubuntu:~/script# minicom -m

Welcome to minicom 2.3

OPTIONS: I18n



Port /dev/ttyUSB1

Press ESC,Z for help on special keys

AT S7=45 S0=0 L1 V1 X4 &c1 E1 Q0

OK

You will get a OK prompt, which means that your minicom recognizes the USB Wifi modem. You can configure the device when in OK prompt using a combination of keys i.e. Press Ctrl and A together and release.Then press Z for the menu. In the menu you should press O to configure minicom.

One of the important settings is the port settings. In my case it is set at /dev/ttyUSB1. In case you need to terminal into a Ciso router, you can try /dev/ttyS0. To do this press Ctrl and A together and release.Then press Z for the menu. In the menu you should press O to configure minicom. Select Serial Port setup



Set the Bps as 115200 8N1

Now let’s send a SMS to your own mobile phone. At the OK prompt in minicom type:
Send a message to your handphone

at+cmgf=1

OK

at+cmgw=”some_mobile_number”

For example,

at+cmgw=”12345678″

> its fun

>

Press Ctrl+Z when you finish typing your message. In my case I don’t need to type the country code +91

+CMGW: 1

OK

at+cmss=1

+CMSS: 0

OK

My handphone received the SMS

To read the SMS,

at+cmgl=”all”

+CMGL: 1,”STO SENT”,”mobilenumber”,,

its fun

+CMGL: 0,”STO UNSENT”,”+mobilenumber”,,

hello !!

OK

at+cmgr=0

+CMGR: “STO UNSENT”,”+mobilenumber”,

hello !!

OK


Making calls from Modem to Mobile Pphone

ATDmobilenumber;
Reading messages on your Wifi Modem SIM Card

Read all the messages

at+cmgl=”all”

+CMGL: 0,”REC READ”,”+91mobilenumber”,,”10/06/20,19:43:29+32″

It works!

+CMGL: 1,”REC UNREAD”,”+91mobilenumber”,,”10/06/21,19:03:10+32″

chill

The latest SMS is unread

Read the SMS

at+cmgr=1

+CMGR: “REC READ”,”+91mobilenumber”,,”10/06/21,19:03:10+32″

chill

OK

Now the status is read

at+cmgl=”all”

+CMGL: 0,”REC READ”,”+91mobilenumber”,,”10/06/20,19:43:29+32″

It works!

+CMGL: 1,”REC READ”,”+91mobilenumber”,,”10/06/21,19:03:10+32″

chill

OK

No comments:

Post a Comment