9.5 Text MessagingSome phones and modems let you send a text message via Short Message Service (SMS) using AT commands. To find out whether your device supports this (nearly all GSM devices do), connect with Kermit, as shown in Example 9-1, and issue the query AT+CSMS=0 (the three columns indicate whether the device is capable of receiving messages, sending messages, or sending broadcast messages): AT+CSMS=0 If your cell phone supports this capability, you can work with text messages using AT commands. You can list your text messages with AT+CMGL=4 (the 4 indicates all messages: use 0 for unread, 1 for read, 2 for unsent, and 3 for sent messages) and read a message with AT+CMGR=MESSAGE_NUMBER: AT+CMGL=4 However, you'll want to put the phone into text mode, so the responses that you receive are human-readable. Use AT+CMGF=1 for this, and try reading the message again: AT+CMGF=1 You can send a message with AT+CMGS="PHONE_NUMBER" (but make sure you've set responses to be human-readable with AT+CMGF=1). You'll be prompted for the message; type it and press Ctrl-Z when you are finished: AT+CMGF=1 You can also use the gsmsendsms utility from gsmlib (http://www.pxh.de/fs/gsmlib/indexl) to send the message: bjepson@debian:~$ gsmsendsms -d /dev/ttyUSB0 4015559000 "Hello, World" |