Search our blog!

Wednesday, April 14, 2010

Checking if the AT Commands Required for Sending, Receiving and Reading SMS Messages are Supported


The next thing to do is to check if the AT commands required for sending, receiving and reading SMS messages are supported by the mobile phone or GSM/GPRS modem. As pointed out earlier in this SMS tutorial, you can check if a certain AT command is supported by performing a test operation. Simply execute an AT command with "=?" attached at its end. For example, "AT+CMGS=?".

Before we begin the check, let's go through an overview of the AT commands that are required for sending, receiving and reading SMS messages. You will learn which AT commands should be checked and get a general idea about when these AT commands should be used.


Overview of the AT Commands Required


For Sending SMS Messages

To send SMS messages via AT commands, the GSM/GPRS modem or mobile phone has to support either +CMGS (command name in text: Send Message) or +CMSS (command name in text: Send Message from Storage). You may also find +CMGW (command name in text: Write Message to Memory) and +CMGD (command name in text: Delete Message) useful, since they are sometimes used together with +CMSS. +CMSS is used to send an SMS message located in the message storage area. If an SMS message does not exist in the message storage area, you must first use the AT command +CMGW to write the SMS message to the message storage area before you can use the AT command +CMSS to send the SMS message to the SMSC. After message submission, you may use the AT command +CMGD to delete the SMS message to free some space from the message storage area.


For Receiving and Reading SMS Messages


To receive and read SMS messages via AT commands, the GSM/GPRS modem or mobile phone has to support the AT command +CNMI (command name in text: New Message Indications to TE. TE stands for Terminal Equipment, which is the equipment that controls the GSM/GPRS modem or mobile phone. For example, a PC / computer), +CMGL (command name in text: List Messages), or +CMGR (command name in text: Read Messages).

The AT command +CNMI is used to specify how newly arrived SMS messages should be handled. You can tell the GSM/GPRS modem or mobile phone either to forward newly arrived SMS messages directly to the PC, or to save them in message storage and then notify the PC about their locations in message storage.

The AT command +CMGL is used to read all SMS messages that have a certain status (e.g. "received unread", "received read", etc) from the message storage area, while the AT command +CMGR is used to read the SMS message saved at a certain location of the message storage area.


Beginning the Check


Now that you've learned the AT commands required for outbound and inbound SMS messaging are +CMGS, +CMSS, +CNMI, +CMGL and +CMGR. You can begin the check by performing a test operation with each of the AT commands. For example, you can execute the command line "AT+CMGS=?" to check whether +CMGS is supported, like this:

AT+CMGS=?

OK

The final result code "OK" indicates the AT command +CMGS is supported. If the GSM/GPRS modem or mobile phone returns the final result code "ERROR", it means the command is not supported.

A quicker way is to copy and paste the following command line to the terminal program and execute it:

AT+CMGS=?;+CMSS=?;+CNMI=?;+CMGL=?;+CMGR=?

As an example, here shows the response returned from my Nokia 6021 to HyperTerminal after the execution of above command line:

AT+CMGS=?;+CMSS=?;+CNMI=?;+CMGL=?;+CMGR=?

+CNMI: (0-2),(0-3),(0,2,3),(0-2),(0,1)

+CMGL: (0-4)

OK

The return of the final result code "OK" indicates all AT commands under test are supported. If the final result code "ERROR" is returned, it means one or more AT commands are not supported.

Monday, November 30, 2009

Monitor Battery Voltages and Temperatures with the NetGuardian 216

Monitor battery voltage and temperature with the NetGuardian 216




How This Application Works:

Equipment Used:

NetGuardian 216

Temperature Sensor

Battery


This application features a single NetGuardian 216 along with the Temperature Sensor with Probe. The NetGuardian 216 will use the Temperature Sensor with Probe to monitor your large scale batteries. It will be able to report alarms via SNMP over IP to your SNMP Manager.

The NetGuardian 216 comes equipped with 16 discrete alarm inputs, 2 analog alarm inputs, and 2 control relay outputs. The discrete alarms are items such as door alarms, equipment alarms and other ON/OFF events. The discrete alarms are "software reversible" to support both N/O and N/C alarm wiring. The

NetGuardian 216's 2 analog inputs can be used for measuring such critical events as temperature, voltage and battery. We also have a line of sensors which can be used with the NetGuardian 832A and can be included upon your request.

The NetGuardian 216 will provide complete coverage and control of your smaller remote sites with easy installation and configuration. It can report alarms via SNMP to any SNMP manager, or DCPx over either UDP or TCP to the T/Mon (DPS Master Station). The reachthrough serial port on the NG216 provides you the ability to access a remote serial device via LAN (a.k.a. terminal server). The

NetGuardian 216 also features a realtime clock, so the NetGuardian 216 clock maintains the current date and time during a power failure. Each time an alarm occurs, a time-date stamp will be included in the SNMP/DCPx trap. Also, the NetGuardian 216 comes a with a free, easy to use, Windows based (T/NG216) utility for configuration, monitoring and diagnostic functions.