You are on page 1of 12

PIC_SERVER (13) PIC_SERVER

(2005-04-18)(2005-04-19)

PIC_SERVER(13)PIC_SERVER

(Short Message Service, SMS) GSM(Global System for Mobile


Communication)(Short Message Service Center, SM-SC)
PIC_SERVER
GSM SMS
GSM PIC_SERVER

1.

1(Original Mobile Station, MS)


(Terminating MS) Inter-Working Mobile Switch Center(IWMSC)
SM-SC SM-SC Gateway MSC(GMSC)
SMS GMSC MSC GMSC Terminating
MS MSC MSC Base Station Controller(BSC)
Base Station Transceiver(BTS)

SM-SC Store-and-Forward
SM-SC SMSSM-SC
TCP/IP Internet 1

SM-SC

1 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

Original MS MS : Mobile Station


BST : Base Station Transceiver
BSC : Base Station Controller
MSC : Mobile Switch Center
BSC IWMSC GMSC : Gateway MSC
IWMSC : Inter-Working MSC
BST GSM Network SM-SC : SMS Center

Terminating MS SM-
SM-SC

Short Message Sender

BSC MSC SMS GMSC

BST GSM Network

User PC

1.

SMS 160
70 MS
SIM

2. GSM

GSMGSM 07.05 Attention(AT)


ATHayesHayes
ATATAT
RS232 GSM
ATGSM
GSM 1 SMSAT

2 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

1. SMS AT

AT
AT(Attention) AT
ATZ ATZ

ATE(Echo) ATE<mode> <mode>=0,
<mode>=1,
AT+CMGF(Messag AT+CMGF=<mode> <mode>=0, PDU mode
e Format) <mode>=1, Text mode
AT+CMGS(Send AT+CMGS=<length> <length>
Message) AT+CMGS=<Phone number> PDU mode
<Phone number>
Text mode
AT+CPMS(Perferre AT+CPMS=<mem1>,<mem2>,< <mem1>=ME SM
dMessage Storage) mem3> CMGR ;
<mem2>MESM
;
<mem3>ME

AT+CMGR(Read AT+CMGS=<index> <index> <mem1>
Message)
AT+CMGD(Delete AT+CMGD=<index> <index> <mem1>
Message)

GSM 07.05 SMS Block


AT Text AT Protocol Data Unit(PDU) Block
GSM PDU
Text
GSM Text PDU

2.1 Text

Text GSM
9600bps GSM
9600bsp 2

3 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

2.

AT 3 1 AT
GSM OK 3 ATZ
GSM 5 AT+CMGF=1
1 Text 0 PDU 7 8
AT
AT+CMGS=0920xxxxxx <cr> THIS IS SMS TEST <^Z>
0920xxxxxxTHIS IS SMS TEST
Ctrl-ZOK

4 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

3. Text

2.2 PDU

PDU Text
PDU AT AT+CMGF=0 PDU
SMS 4
AT+CMGS=27 27 PDU 27 bytes
PDU 1

4. PDU

5 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

2. PDU

Byte
0 00 SM-SC
1 11 11
2 00 TP
3 0A A1+9002665735=10 bytes

4 A1 0x81
0x91
0xA1
5~9 9002665735 0920667553
10 00
11 00
12 FF
13 10 16
14~27 5464720A4A4E41 THIS SMS
D3E614442D4EA9 TEST

PDU GSM 7 3
Hello 7 ASCII
H
ASCII 1001000e ASCII 1100101H
e H 11001000(0xC8)e
110010 0 00110010(0x32)He
C832 3 Hello C8329BFD06

3. Hello

H e l l o
7bits hex 0x48 0x65 0x6C 0x6C 0x6F
7bits binary Msb ---Lsb 1001000 1100101 1101100 1101100 1101111
8 bits 11001000 00110010 10011011 11111101 00000110
In Hex 0xC8 0x32 0x9B 0xFD 0x06

6 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

3. PIC_SEVER

3.1

PIC_SEVER RS-232 AT
PIC_SEVER

PIC_SERVER RS-232
5 RS-232 9PIN R-232 PIN2
PIN3 PIN5 PIC_SERVER PIN_C6
PIN_C7

PIN5
PIN2
R1/IN
PIN3 PIN3 R1/OUT PIN_C7
T1/OUT
PIN2
GND T1/ IN PIN_C6
PIN5
MAX232

PIC16F877
Mobile PIC_SERVER PIC16F4xx
RS-
RS-232 RS-
RS-232 PIC_SERVER

5.

6 PIC_SERVER C Text
5 PIC_SERVER PIN_C6 RS-232 PIN_C7
RS-232 Baud Rate 11520 14 AT
ATE0 Echo 16 Text 19
\x220920xxxxxx
22 23 Ctrl-Z 27~29
31 LCD

7 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

6.

3.2

PIC_SERVER
PIC_SERVER PIC_SERVER

7 PIC_SERVER PIC C 8
AT
8 18~24 27
AT AT+CPMS=ME, SM, ME

8 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

ME
SM Mobile Equipment SIM
ME(AT+CMGR)
SM ME

31~68 35
AT+CMGR=1(0x0A)(0x0D)
36

38 string+CMS
ERROR: 500 error
39 CCS
strncmp(string, door, 4)(string) error
4 LCD NO NEW SMS

+CMGR: REC UNREAD,+886920xxxxxx,,05/03/15,16:20:12:30

door

OK

2 (door) 48 49
(string) sentsent
door 4 LCD GET NEW SMS
PIC_SERVER beep
4
LCD INVALID SMS beep 55
63

9 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

Start

Set Mobile mode and


Message Storage Place
(AT+CPMS)

Have Message ? N
No New Message
(AT+CMGR)

N Invalid Message
Correct Message ?
Beep 1 time

Y
Get New Message Delete Message
Beep 2 times (AT+CMGD)

7. PIC_SERVER

10 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

8.
11 http://grc.yzu.edu.tw/
PIC_SERVER (13) PIC_SERVER

RS-232 87

John Uffenbeck, 1998. The 80x86 Family Design, Programming, and Interfacing,
Prentice-Hall, Inc.

www.usbdeveloper.com/GSMPage/gsmpage.htm

http://houghost.idv.tw/other/comp_dict/A/A0138.HTML

12 http://grc.yzu.edu.tw/

You might also like