ON THE USE OF AT COMMANDS FOR CONTROLING THE MOBILE PHONE WITH MICROCONTROLLER LABORATORY EXERCISE

Similar documents
SYNOPSIS PROJECT TITLE : GSM BASED E-NOTICE BOARD

AT commands APLICATION NOTE

How to handle SMS messages

Mobile forensics. SMS (Short Message Service) EMS, MMS, CBS

Application Note. SIM7100_SMS_Application_Note_V

Quick help quide to GSM PDU mode structure

Serial interface configuration. Syntax of the standard AT commands

PROJECT REPORT ON ELECTION VOTING VIA SMS

SCOPE. SMS Application notes

3.5G AT Commands Manual v1.0

SMS Application notes AN_SMS_V1.01

SMS Application Note. Version 2.6

3GPP TS V3.2.0 ( )

MICROCONTROLLER BASED LPG GAS DETECTOR USING GSM MODULE

GSM Enabled Embedded System for Energy Measurement & Billing

ETSI TS V4.1.0 ( )

Gemalto EHS6T-USB Terminal Starter Kit. Getting Started Guide

AT Command Interface Specification

AT Command Interface Specification

USE OF GSM TECHNILOGY TO CONTROL THE SPEED OF STEPPER MOTOR

Hands-On Workshop. Introduction to AT Commands, Sending SMS & GPRS

Cinterion BGS2T (RS232) Terminal Starter Kit. Getting Started Guide

GSM GSM TECHNICAL January 1998 SPECIFICATION Version 5.5.0

Application Note basic Voice and SMS Connection with SIM900 rev03

Implementation of suggests GSM/GPRS system in governmental service departments Raad G. Hameed Al-Azawi.

MARCH ISSN: INTERNATIONALJOURNALFORENGINEERINGAPPLICATIONSAND TECHNOLOGY GPS ENABLED EMERGENT TRACING AND NEAREST FACILITY AVAILANCE SYSTEM

ETSI TS V7.0.1 ( )

AVR323: Interfacing GSM modems. 8-bit Microcontrollers. Application Note. Features. 1 Introduction

3GPP TS V ( )

GSM GSM TECHNICAL July 1996 SPECIFICATION Version 5.0.0

Manual Reference. AT Command Set (GSM 07.07, GSM 07.05) S25

SIM800C-DS_Application Note _V1.00

AT Command Interface Specification

Nokia F-Bus Protocol

Institutions and Organizations today are facing several unique communication challenges:

AT Command Addendum and Getting Started Guide for LAT1 Devices. Telit Firmware x3 Reference Guide.

GSM FUNCTION APPLIED IN WIRELESS SOLUTION

AT Command Interface Specification

xxx xxx Project GSM/GPS Communication Module

ETSI TS V ( )

IMS Client Framework for All IP-Based Communication Networks

Chapter 1 Introduction

Concealed Data in Two Way Text Messaging: A Framework for Interactive Mobile Learning Environment

ETSI TS V ( )

Transmitting GPS position by an Iridium phone

GSM Interfacing Board

GTM-201 Series FAQ Ver1.1. GTM-201 Series FAQ ICP DAS CO., LTD.

Arm11 Based Accident Alert and Vehicle Tracking Using GSM and GPS

DANGER indicates that death or severe personal injury will result if proper precautions are not taken.

H20 AT Command User Guide

3GPP TS V6.1.0 ( )

3GPP TS V ( )

E-Blocks Mobile Communications Bundle

GPRS-T1. Monitoring Converter. SATEL sp. z o.o. ul. Schuberta Gdańsk POLAND tel

GPRS /GSM SIM900A MODEM

u-blox TOBY-L1 and MPCI-L1

IMPLEMENTATION OF AAA SERVER LABORATORY MODEL

GSM GSM TECHNICAL March 1996 SPECIFICATION Version 5.1.0

GMM-SM Event Logging. Feature Description. Feature Overview. Events to be Logged

NOKIA 12 GSM MODULE AT COMMAND GUIDE

I lllll llllllll II llllll lllll lllll lllll lllll lllll lllll lllll

ITU-T Q Signalling architecture and requirements for IP-based short message service over ITU-T defined NGN

GGB-1916 GNSS/2.5G GSM/GPRS/Bluetooth Module AT Commands Manual 2016 LOCOSYS Technology Inc.

SIMATIC NET. Industrial Remote Communication - TeleControl MODEM MD720. Preface. Application and functions 1. Installation and connecting up 2

GMM-SM Event Logging. Feature Description. Feature Overview. Events to be Logged

ETSI EN V7.0.2 ( )

CHANGE REQUEST. Ericsson, Siemens AG, Lucent Technologies

ETSI TS V4.2.0 ( )

Design and Development of Software Coding for m- Advertisement Using VB6

Procedia Computer Science

Development KIT for TM2 GPRS modem User manual 1.2. Development KIT. Development KIT for TM2 GSM/GPRS modem User s manual 1.2

ETSI TS V5.2.0 ( )

User Manual. Configuration OWL LTE (Industrial Cellular Router) UM Configuration OWL LTE Release 1.0 Rev /2016

Telit Modules Software User Guide. 1vv rev

AT Commands Over SMS. Application Note ENF0000AN012. Version:2.00

TS V6.1.0 ( )

Telit Modules Software User Guide. 1vv rev

MM-6854 / MM-6864 GSM Dual-Band Data Modem

V1.0. Ai-Thinker Inc. Ai-Thinker

Mobile telephony solution. Copyright 2006 Matrix Multimedia Limited

Developing for Cellular Networks

GTM-204M FAQ Ver1.0 GTM-204M FAQ

GSM BASED SMART NOTICE BOARD

GSM V7.0.0 ( )

Analysis of a Multiple Content Variant Extension of the Multimedia Broadcast/Multicast Service

MultiModem GPRS USB. Wireless Modem. User Guide MTCBA-G-U

Lecture overview. Modifications and derivatives of GSM Data transmission in GSM: HSCSD GPRS part one EDGE

LTE GLOBAL PHONE Version: 0.1 Apr. 2016

USING SatTerm SOFTWARE WITH SMS APPLICATION NOTE

TS-3GA (Rel6)v6.0.0 GSM - UMTS Public Land Mobile Network (PLMN) Access Reference Configuration

THE DESIGN AND REALIZATION OF EMBEDDED WIRELESS DATA COLLECTION SYSTEM

3GPP TS V8.2.0 ( )

User Manual for VE GSM Modem

3GPP TS V8.3.0 ( )

ETSI TS V4.0.0 ( )

Design of Fault Tolerant Automated Energy Metering System using GSM/GPRS Modems

GSM GSM TECHNICAL December 1995 SPECIFICATION Version 5.0.0

User Module. AT Modem Emulator APPLICATION NOTE

ETSI TS V ( )

Transcription:

2007 Poznańskie Warsztaty Telekomunikacyjne Poznań 6-7 grudnia 2007 P OZNAN POZNAN UNIVERSIT UNIVERSITY Y OF OF TECHNOLOGY ACADEMIC ACADEMIC JOURNALS JOURNALS No 54 Electrical Engineering 2007 Adrian KLIKS* Paweł SROKA* ON THE USE OF AT COMMANDS FOR CONTROLING THE MOBILE PHONE WITH MICROCONTROLLER LABORATORY EXERCISE In this paper an example of exercise for the microprocessor or wireless communications laboratory is presented. The idea of the exercise is to use the AT commands to control the mobile phone or GSM/GPRS modem. The paper describes the exercise in every detail including the explanation of formulating the AT commands and their use for SMS messaging. Two modes of SMS messaging are presented: the text mode and PDU mode. Message formulation rules are explained for the PDU mode including data encoding. Finally, a detailed description of the exercise is given including examples of the commands and responses obtained through the experiment. The proposed exercise gives opportunity to familiarize the student with mobile phone s features, that are unavailable when using the Graphical User Interface (GUI). Keywords: AT commands, SMS messaging, GSM, GPRS 1. INTRODUCTION Global System for Mobile Communication (GSM) has become in recent years a very common system of communication. With the great variety of GSM devices in the world market some standardized methods of controlling the phone behaviour and operations are required. Thus, the AT commands have been standardized by the European Telecommunications Standards Institute (ETSI), enabling the control of a GSM device using a microcontroller [1, 2]. In this paper we present an example of laboratory exercise explaining the use and syntax of AT commands. The proposed project relies on controling the mobile phone with the 8051 microcontroller connected using the RS232 interface. The SMS messaging system has been used to exemplify the appliance * Poznan University of Technology. PWT 2007 - POZNAŃ 6-7 GRUDNIA 2007 1/8

Adrian Kliks, Paweł Sroka of AT commands. This paper is organised as follows. Section 2 introduces the AT commands, their syntax and most notable examples. The SMS messaging system including the text mode and the PDU (Protocol Data Unit) mode has been explained in Section 3. This section also includes the examples of AT commands syntax for both modes, as well as the information formulation algorithm for the PDU mode. In Section 4 the system setup and exercise description has been presented. Finally, in Section 5 the conclusions are drawn. 2. AT COMMANDS AT (ATtention) commands, also known as Hayes commands, are used to control the dial-up modems, as well as mobile phones or GSM/GPRS modem. Every command starts with the AT or at prefix. Many of these commands used to control the dial-up modems are also supported by mobile phones and GSM/GPRS modems. The most notable examples are: ATD (dial), ATA (answer) or ATH (hook). Moreover, mobile phones and GSM/GPRS modems support an extended set of commands (starting with +) used for controlling features unavailable to the dial-up modems, such as sending and receiving the SMS messages. The examples of GSM specific commands are: AT+CMGS (send SMS message), AT+CMGR (read SMS message) or AT+CMGL (list SMS messages) [2, 4, 5]. The general syntax of extended AT commands is straightforward, as presented below [2]: AT+CMD1;+CMD2=10;+CMD3?;+CMD4=?<CR> For example: AT+CMGL= ALL ;+CGMI<CR> All command lines must start with AT prefix and end with the carriage return (represented as <CR> in this paper). A command line may contain more than one AT command, where only the first one should be prefixed with AT. The commands in the same line are separated with semicolons. All string parameters are enclosed within double quotes [2, 5]. The information responses and result codes always start and end with a carriage return character and linefeed (represented as <LF>) character. For example, after sending the command AT+CGMI<CR> the device should return a response similar to: <CR><LF>Nokia<CR><LF> PWT 2007 - POZNAŃ 6-7 GRUDNIA 2007 2/8

On the use of AT commands for controling the mobile phone with microcontroller <CR><LF>OK<CR><LF> One can use the AT commands to perform many specific task with a moblie phone or GSM/GPRS modem, such as [2, 4, 5]: get basic information about the phone or modem: name of manufacturer (AT+CGMI), model number (AT+CGMM), IMEI (International Mobile Equipment Identity) number (AT+CGSN) and software version (AT+CGMR). get information about the subscriber, for example the IMSI (International Mobile Subscriber Identity) number (AT+CIMI), get status information about the mobile phone or modem, for example: phone activity status (AT+CPAS), mobile network registration status (AT+CREG), radio signal strength (AT+CSQ) or battery charge level and charging status (AT+CBC), send (AT+CMGS, AT+CMSS), read (AT+CMGR, AT+CMGL), write (AT+CMGW) or delete (AT+CMGD) SMS messages or obtain notification of newly received SMS messages (AT+CNMI), get or change the configuration of the mobile phone or modem, for example: change the GSM network (AT+COPS), SMS center address (AT+CSCA) or storage of SMS messages (AT+CPMS). The mobile phone manufacturers usually do not implement all of the AT commands, command parameters or values in their devices. Moreover, some of the commands may require support from the operator, for example the transmission of SMS over GPRS. Thus, certain features described above may be unavailable, depending on the mobile phone model and network operator. 3. AT COMMANDS FOR SMS MESSAGING The SMS message can be up to 160 characters long, where each character is represented by 7 bits according to the 7-bit default alphabet. The mobile phone or GSM/GPRS modem may operate in two SMS modes: the text mode or the PDU (Protocol Data Unit) mode. The mode the mobile phone or modem is operating in determines the syntax of some of the AT commands and the format of the responses returned after execution. Many AT commands differ in syntax in the two available modes, for example: send message (+CMGS), read message (+CMGR), etc. Also there are two commands available only in the SMS text mode: set text mode parameters (+CSMP) and show text mode parameters (+CSDH) [1, 5]. PWT 2007 - POZNAŃ 6-7 GRUDNIA 2007 3/8

Adrian Kliks, Paweł Sroka 3.1. The text mode The text mode is just an encoding of the bit stream using specified characters from the alphabet. Alphabets may differ and there are several encoding alternatives when displaying an SMS message. The mobile phone or GSM/GPRS modem will choose a proper encoding, when reading a message, but the application is limited by the set of preset encoding options. Moreover, the text mode is unavailable on some phones. The text mode of SMS messaging is enabled by using the AT command AT+CMGF=1. The syntax of the AT command for sending the SMS message in the text mode is as follows [5]: AT+CMGS="+48504089884"<CR>message<Ctrl+z>, where +48504089884 is the recipient s number. In SMS text mode all components of the message: headers and body are treated as separate fields. 3.2. The PDU mode In the PDU mode the SMS message is represented as a binary stream of information, what can be very useful to send compressed or binary data. This mode is the default mode of SMS messaging and can be enabled by using the command AT+CMGF=0. The PDU string contains the message information, but also a lot of meta-information about the sender, SMS service center, the time stamp, etc. The syntax of the AT command for sending the SMS message in PDU mode is as follows [1, 6]: AT+CMGS=28<CR>07918405210077F701000B918405049888F40 00007EDF27C1E3E9701<Ctrl+z> The message sequence comprises three parts [1, 6]: initial octet indicating the length of SMSC (SMS Service Center) information (07), the SMSC information (918405210077F7), the Transport Protocol Data Unit (TPDU) in one of two possible forms: SMS-DELIVER (from network to phone) and SMS-SUBMIT (from phone to network). In the example presented above the message consists of 28 octets, which can be described as in Table 1 [6, 7]. All of the information is represented in form of hexadecimal octets or decimal semi-octets. So, the text information has to be converted from the 7-bit form to octet form. For example, message message is represented in Table 2. PWT 2007 - POZNAŃ 6-7 GRUDNIA 2007 4/8

On the use of AT commands for controling the mobile phone with microcontroller Table 1. Structure of the SMS-SUBMIT message Octet Description 07 Length of the SMSC information 91 Type of address of the SMSC (91 represents the international format of the phone number) 8405210077F7 Service Center number (in decimal semi-octets). The length of the number is 11 digits, so a trailing F has been added. Also an internal swapping within the semioctets is performed (from 85 to 58, etc.) 01 First octet of the SMS-SUBMIT TPDU 00 TP-Message-Reference (if 00 the phone sets it itself) 0B Address length length of phone number 91 Type of recipient s address 8405049888F4 The phone number in decimal semi-octets 00 TP-PID - protocol identifier 00 TP-DCS - data coding scheme (if 00 the default coding according to the 7-bit representation is used) <optional> TP-Validity Period 07 TP-User-Data-Length of message. The TP-DCS indicated the 7-bit representation, so the number represents length in septets (21hex = 33 septets) EDF27C1E3E9701 TP-User-Data message octets Table 2. The septet form of message "message m e s s a g e 109 101 115 115 97 103 101 1101101 1100101 1110011 1110011 1100001 1100111 1100101 The conversion into octet form is performed by prepending the n-th septet with the n last bits from the n+1-th septet, as presented in Table 3. Then the rightmost n bits of the n+1-th septet are consumed and the process is repeated for the next septet. Table 3. Conversion from septet into octet form m E s s a g e 1101101 110010 1 11100 11 1110 011 110 0001 11 00111 1 100101 1+1101101 11+110010 011+11100 0001+1110 00111+110 100101+11 1 ED F2 7C 1E 3E 97 01 Althoug it is easier to use AT commands in the text mode, the PDU mode supports more features of SMS messaging. When using PDU mode one has got PWT 2007 - POZNAŃ 6-7 GRUDNIA 2007 5/8

Adrian Kliks, Paweł Sroka complete control over the header values and message body, thus can use all of the available features such as status reporting or setting the validity period [5, 6]. 4. EXERCISE DESCRIPTION In the proposed laboratory exercise the system is set up using a DSM-51 microcontroller kit (including the 8051 microcontroller) and two mobile phones: Sony-Ericsson T68i connected to the DSM-51 kit using the RS232 interface (serving as a transmitter) and Nokia 6020 serving as a receiver. The system set up is shown in Fig. 1 and Fig. 3. Fig. 1. System set up for the proposed exercise The exercise is divided into four parts, including the set up of the serial transmission between the DSM-51 nad mobile phone, configuration of the RS232 driver on the DSM-51 board and controlling the mobile phone using AT commands: 1) The first part depends on implementation of the serial transmission driver on the 8051 microcontroller (using assembler language) or configuring the existing RS232 driver on the DSM-51 kit [3]. Depending on the serial modem installed (v.24, v.23, etc.), what can be checked using the ATI7 command, the transmission speed shall be defined, for example as 300 bps (bits per second). Transmisson should be bidirectional (full duplex). One should also implement the interface for the serial driver, i.e. the incoming information should be displayed on the LCD. There could be also a possibility to retrieve the input data from the DSM-51 keyboard. PWT 2007 - POZNAŃ 6-7 GRUDNIA 2007 6/8

On the use of AT commands for controling the mobile phone with microcontroller 2) When the setup phase is finished, a connection test should be performed using the pure AT command. Then one may check the signal strength and BER (bit error ratio) using the AT+CSQ command and the battery status and charging status using the AT+CBC command. The response of the mobile phone should look similarly to the one presented in Fig. 2. Fig. 2. Mobile phone response for commands AT+CSQ and AT+CBC Fig. 3. The example of AT command for sending an SMS message in PDU mode and the result (received message) PWT 2007 - POZNAŃ 6-7 GRUDNIA 2007 7/8

Adrian Kliks, Paweł Sroka 3) To prepare the system for the SMS messaging exercise one should check the character encoding scheme used by the mobile phone, by sending command AT+CSCS?. 4) Finally, when the system is set up properly, one should send the SMS message using both available modes: the text mode and PDU mode. The message could consist of the first name and surname of the student. One also has to ensure that the message is encoded properly in the PDU mode. An example of sending SMS using AT commands and the result are shown in Fig. 3. 5. CONCLUSIONS In this paper the proposal of the micorprocessors laboratory exercise has been presented. The proposed exercise gives the opportunity to familiarize student with mobile phone s features unavailable when using the Graphical User Interface (GUI). Also a detailed insight into SMS messaging scheme is given, including explanation of the two SMS modes and coding issues related to it. Moreover, students familiarize with assembler programming by implementation of the serial transmission driver. The given instructions have been tested using two mobile phones and DSM-51 microcontroller kit and turned out to be a very illustrative method of learning about the GSM technology. REFERENCES [1] ETSI TS 127 005 v6.0.1, Digital cellular telecommunications system (Phase 2+); Universal Mobile Telecommunications System (UMTS); Use of Data Terminal Equipment Data Circuit terminating Equipment (DTE-DCE); Interface for Short Message Service (SMS) and Cell Broadcast Service (CBS) (3GPP TS 27.005 version 6.0.1 Release 6), ETSI, January 2005. [2] ETSI TS 127 007 v6.8.0, Digital cellular telecommunications system (Phase 2+); Universal Mobile Telecommunications System (UMTS); AT command set for User Equipment (UE) (3GPP TS 27.007 version 6.8.0 Release 6), ETSI, March 2005. [3] Gałka P., Gałka P., Podstawy programowania mikrokontrolera 8051, PWN Warszawa, 2002. [4] Sony Ericsson, Sony Ericsson GPRS PC Card Modem GC75 AT-Commands Manual, 2002. [5] http://www.developershome.com/sms/, 13.11.2007. [6] http://www.dreamfabric.com/sms/, 13.11.2007. [7] http://www.forum.nokia.com/, 13.11.2007. PWT 2007 - POZNAŃ 6-7 GRUDNIA 2007 8/8