{"id":61654,"date":"2025-06-10T15:29:55","date_gmt":"2025-06-10T19:29:55","guid":{"rendered":"https:\/\/www.engineersgarage.com\/?p=61654"},"modified":"2025-06-11T12:02:55","modified_gmt":"2025-06-11T16:02:55","slug":"articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands","status":"publish","type":"post","link":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/","title":{"rendered":"RPi Python Programming 21: The SIM900A AT commands"},"content":{"rendered":"<p class=\"ai-optimize-6 ai-optimize-introduction\"><span data-preserver-spaces=\"true\">In the <a href=\"https:\/\/www.engineersgarage.com\/microcontroller-projects\/articles-raspberry-pi-sim900a-gsm-gprs-modem-interfacing\/\"><strong>previous tutorial<\/strong><\/a>, we covered how to interface a SIM900A GSM-GPRS modem with Raspberry Pi, Arduino, and desktop computers. SIM900A can communicate data with the controlling device over the universal asynchronous receiver\/transmitter (<\/span><a class=\"_e75a791d-denali-editor-page-rtfLink\" href=\"https:\/\/www.engineersgarage.com\/raspberrypi\/raspberry-pi-serial-communication-uart-protocol-ttl-port-usb-serial-boards\/\" target=\"_blank\" rel=\"noopener noreferrer\"><span data-preserver-spaces=\"true\"><strong>UART<\/strong><\/span><\/a><span data-preserver-spaces=\"true\">), I2C, or SPI protocol.\u00a0<\/span><\/p>\n<p class=\"ai-optimize-7\"><span data-preserver-spaces=\"true\">The modem is a piece of mobile equipment with an IMEI number that\u2019s capable of all cellular operations (voice calls, SMS, MMS, faxes, and the Internet). It \u201cunderstands\u201d AT commands, and can be configured and operated by passing these commands to it.<\/span><\/p>\n<p class=\"ai-optimize-8\"><span data-preserver-spaces=\"true\">There was a time when mobile phones (such as Nokia handsets) were built by directly interfacing a display screen, keypad, speakers, microphone, and battery system to such modems. Now, smartphones are built using high-end processors that run complex mobile operating systems (iOS, Android, Windows).\u00a0<\/span><\/p>\n<p class=\"ai-optimize-9\"><span data-preserver-spaces=\"true\">A mobile-platform processor is interfaced with the following to build a full-fledged portable computer that\u2019s a smartphone.:\u00a0<\/span><\/p>\n<ul>\n<li class=\"ai-optimize-10\"><span data-preserver-spaces=\"true\">RAM<\/span><\/li>\n<li class=\"ai-optimize-11\"><span data-preserver-spaces=\"true\">ROM<\/span><\/li>\n<li class=\"ai-optimize-12\"><span data-preserver-spaces=\"true\">A touchscreen<\/span><\/li>\n<li class=\"ai-optimize-13\"><span data-preserver-spaces=\"true\">A dedicated graphic processing unit (GPU)<\/span><\/li>\n<li class=\"ai-optimize-14\"><span data-preserver-spaces=\"true\">Microphone and speakers<\/span><\/li>\n<li class=\"ai-optimize-15\"><span data-preserver-spaces=\"true\">Camera and sensors<\/span><\/li>\n<li class=\"ai-optimize-16\"><span data-preserver-spaces=\"true\">A neural processing unit (NPU) for artificial intelligence<\/span><\/li>\n<li class=\"ai-optimize-17\"><span data-preserver-spaces=\"true\">A battery system and a wireless modem, such as a 4G\/5G modem. (Even in smartphones, there is the wireless modem that renders complete cellular solution.)\u00a0<\/span><\/li>\n<\/ul>\n<p class=\"ai-optimize-18\"><span data-preserver-spaces=\"true\">Wireless modems talk over the AT commands, which are an abbreviation for \u201cattention.\u201d These commands serve as instructions that control the wireless modem. Wireless modules, like SIM900A, are essentially mobile equipment with console access.\u00a0<\/span><\/p>\n<p class=\"ai-optimize-19\"><span data-preserver-spaces=\"true\">The console communicates and responds to the AT commands, which may be exchanged with a modem using the\u00a0<\/span><strong><a class=\"_e75a791d-denali-editor-page-rtfLink\" href=\"https:\/\/www.engineersgarage.com\/microcontroller-projects\/articles-raspberry-pi-serial-communication-uart-protocol-serial-linux-devices\/\" target=\"_blank\" rel=\"noopener noreferrer\">serial (UART), I2C, or SPI interface<\/a><\/strong><span data-preserver-spaces=\"true\">. The controlling device can be any microcontroller or computer. Much like in the previous tutorial \u2014 where we discussed how to interface SIM900A with\u00a0<\/span><strong><a class=\"_e75a791d-denali-editor-page-rtfLink\" href=\"https:\/\/www.engineersgarage.com\/raspberrypi\/rpi-python-programming-04-setting-up-raspberry-pi-linux-computer\/\" target=\"_blank\" rel=\"noopener noreferrer\">Raspberry Pi<\/a><\/strong><span data-preserver-spaces=\"true\">, Arduino, or other microcontrollers, including desktop computers using USB-serial boards \u2014 the modem can also be controlled by all these devices.\u00a0<\/span><\/p>\n<p class=\"ai-optimize-20\"><strong><span data-preserver-spaces=\"true\">Understanding the AT commands<br \/>\n<\/span><\/strong><span data-preserver-spaces=\"true\">The AT commands are instructions for a wireless modem. The basic AT commands are a subset of the Hayes command. There are also AT commands that are implemented in compliance with the cellular solution (such as GSM-GPRS, GSM-GPRS+GNSS, WCDMA\/HSPA\/HSPA+, 4G\/LTE, and CAT\/NB-IoT).\u00a0<\/span><\/p>\n<p class=\"ai-optimize-21\"><span data-preserver-spaces=\"true\">The modem manufacturer may also implement a subset of the AT commands on a particular modem. For example, the way, basic, and extended AT commands that are implemented on a modem may differ from one vendor to another.\u00a0<\/span><\/p>\n<p class=\"ai-optimize-22\"><span data-preserver-spaces=\"true\">Each modem has and responds to its own instruction set. The AT commands are the same for a wireless or phone modem. Similar to a processor that receives instructions and outputs results over parallel ports (or, in some cases, over serial ports), a modem receives commands and responds to them over standard serial interfaces (such as the UART, SPI, and I2C).\u00a0<\/span><\/p>\n<p class=\"ai-optimize-23\"><span data-preserver-spaces=\"true\">The SIM900A modem supports the AT commands in compliance with:\u00a0<\/span><\/p>\n<ul>\n<li class=\"ai-optimize-24\"><span data-preserver-spaces=\"true\">The ITU-T (the International Telecommunication Union, Telecommunication sector)<\/span><\/li>\n<li class=\"ai-optimize-25\"><span data-preserver-spaces=\"true\">The V.25TER document<\/span><\/li>\n<li class=\"ai-optimize-26\"><span data-preserver-spaces=\"true\">The ETSI GSM07.07 (i.e. the ETSI standard AT command is set for GSM mobile equipment)<\/span><\/li>\n<li class=\"ai-optimize-27\"><span data-preserver-spaces=\"true\">The ETSI GSM07.05 (i.e. the ETSI standard is for short message service or SMS)<\/span><\/li>\n<li class=\"ai-optimize-28\"><span data-preserver-spaces=\"true\">Cell broadcast service (or CBS)<\/span><\/li>\n<\/ul>\n<p class=\"ai-optimize-29\"><span data-preserver-spaces=\"true\">It also implements the AT commands for the SIM application toolkit, GPRS support, TCP\/IP application toolkit, and the IP, HTTP, and FTP applications \u2014 and has additional AT commands implemented by its vender SIMCOM.\u00a0<\/span><\/p>\n<p class=\"ai-optimize-30\"><span data-preserver-spaces=\"true\">However, the modem may not support all of the AT commands under the ITU-T and ETSI specifications and only a subset of them. The supported AT commands can be used to configure a modem and access services, such as voice calls, SMS, MMS, faxes, and data link over the TCP\/IP, IP, HTTP, and FTP protocols.\u00a0 \u00a0<\/span><\/p>\n<p class=\"ai-optimize-31\"><strong><span data-preserver-spaces=\"true\">The types of AT commands<\/span><\/strong><span data-preserver-spaces=\"true\"><br \/>\n<\/span>The basic AT commands are a subset of the Hayes Commands. The others are called extended AT commands.<\/p>\n<p class=\"ai-optimize-32\">There are four types of basic AT commands:<\/p>\n<p class=\"ai-optimize-33\"><strong>1. Test commands:<\/strong>\u00a0used to test the compatibility of a command with a modem and to confirm if a command has been implemented or is supported by the modem. The modem may respond with an OK or a supported configuration of the command in response to the test command. These commands are in a format AT+&lt;x&gt;=? where &lt;x&gt; is the command.<\/p>\n<p class=\"ai-optimize-34\"><strong>2. Read commands:<\/strong>\u00a0used to know the mobile phone or modem settings. These commands are in a format AT+&lt;x&gt;? where &lt;x&gt; is the command.<\/p>\n<p class=\"ai-optimize-35\"><strong>3. Set commands:<\/strong>\u00a0used to modify the mobile phone or modem settings. These commands include parameters that must be set to change a particular phone\/modem setting. They\u2019re in the format AT+&lt;x&gt;=&lt;n&gt; where &lt;x&gt; is the command and &lt;n&gt; are the optional arguments. If the arguments are not passed in the command, the modem assumes the default mode.<\/p>\n<p class=\"ai-optimize-36\"><strong>4. Execution commands:<\/strong>\u00a0used for executing a cellular operation, such as to make or answer a voice call, read, send, or delete an SMS, etc. These commands are in a format AT+&lt;x&gt; where &lt;x&gt; is the command.<\/p>\n<p class=\"ai-optimize-37\"><strong>The AT commands\u2019 syntax<\/strong><br \/>\nAll of the AT commands begin with the prefix \u201cAT\u201d or \u201cat,\u201d and ends with a command-line enter &lt;CR&gt;. This is why these commands are called AT commands.<\/p>\n<p class=\"ai-optimize-38\">The modem response comes in the format of &lt;CR&gt;&lt;LF&gt;&lt;Response&gt;&lt;CR&gt;&lt;LF&gt;.<\/p>\n<p class=\"ai-optimize-39\">The AT commands of the SIM900A can be divided into three subsets:<\/p>\n<p class=\"ai-optimize-40\"><strong>1. Basic syntax:<\/strong>\u00a0are in the format &#8220;AT&lt;x&gt;&lt;n&gt;&#8221; where &lt;x&gt; is the command and &lt;n&gt; is the optional arguments. If the arguments are not passed, the default arguments are automatically used by the modem.<\/p>\n<p class=\"ai-optimize-41\"><strong>2. S parameter syntax:<\/strong>\u00a0are in a format &#8220;ATS&lt;n&gt;=&lt;m&gt;&#8221; where &lt;n&gt; is index of S register to set and &lt;m&gt; is value to assign to it. The &lt;m&gt; is optional and if value is not passed, default values are assumed by modem.<\/p>\n<p class=\"ai-optimize-42\"><strong>3. Extended syntax:<\/strong>\u00a0are syntax for extended AT commands. The syntax for test, read, set, and execution commands are mentioned above.<\/p>\n<p class=\"ai-optimize-43\">Therefore, the basic commands use a basic or an S parameter syntax and the extended AT commands use a different syntax, according to their type.<\/p>\n<p class=\"ai-optimize-44\">The command-line buffer of the SIM900 modem can accept a maximum of 556 characters. It\u2019s possible to pass a single or multiple commands in a line. If the line exceeds 556 characters, however, none of the commands will execute and the modem will return &#8220;ERROR.&#8221;<\/p>\n<p class=\"ai-optimize-45\">If a single command is passed in a line, another command cannot be passed until the response from modem is received. If multiple commands are passed in a line, the \u201cAT\u201d or \u201cat\u201d must be prefixed at the beginning of the line.<\/p>\n<p class=\"ai-optimize-46\">The basic and s-parameter syntax commands shouldn\u2019t be delimited but all extended AT commands must be delimited by a semicolon (;) on the line. The line must also end with the command-line enter &lt;CR&gt; to pass all of the commands to the modem.<\/p>\n<p class=\"ai-optimize-47\">The SIM900 AT commands default to the IRA character set. The other character-sets supported by the SIM900 modem includes:<\/p>\n<ul>\n<li class=\"ai-optimize-48\">GSM format<\/li>\n<li class=\"ai-optimize-49\">UCS2<\/li>\n<li class=\"ai-optimize-50\">HEX<\/li>\n<li class=\"ai-optimize-51\">PCCP<\/li>\n<li class=\"ai-optimize-52\">PCDN<\/li>\n<li class=\"ai-optimize-53\">8859-1<\/li>\n<\/ul>\n<p class=\"ai-optimize-54\">The character set affects the SMS, SMS cell broadcast messages, phonebook entries, and the SIM application toolkit alpha strings. The character set in use by the modem can be interrogated using the AT command &#8220;AT+CSCS.&#8221;<\/p>\n<p class=\"ai-optimize-55\"><strong>The AT commands list<br \/>\n<\/strong>The SIM900 modem supports the following basic AT commands:<\/p>\n<p class=\"ai-optimize-56\"><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Chart-1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-61668 size-full\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Chart-1.jpg\" alt=\"\" width=\"547\" height=\"1456\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Chart-1.jpg 547w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Chart-1-113x300.jpg 113w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Chart-1-385x1024.jpg 385w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Chart-1-89x238.jpg 89w\" sizes=\"auto, (max-width: 547px) 100vw, 547px\" \/><\/a><\/p>\n<p class=\"ai-optimize-57\"><span data-preserver-spaces=\"true\">This list is relatively short and only presents a few of the more common commands. The SIM900 modem supports hundreds of AT commands as per different specifications.\u00a0<\/span><\/p>\n<p class=\"ai-optimize-58\"><strong><span data-preserver-spaces=\"true\">The AT commands for voice calls\u00a0<\/span><\/strong><span data-preserver-spaces=\"true\"><br \/>\n<\/span><span data-preserver-spaces=\"true\">These AT commands are useful to make and receive voice calls using a SIM900 modem:<\/span><\/p>\n<p class=\"ai-optimize-59\"><strong><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table-2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-61655\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table-2-300x72.jpg\" alt=\"\" width=\"700\" height=\"168\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table-2-300x72.jpg 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table-2-768x185.jpg 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table-2-368x88.jpg 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table-2.jpg 936w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a>The AT commands for SMS messages<\/strong><br \/>\nThese AT commands are useful to make and receive SMS messages using a SIM900 modem:<\/p>\n<p class=\"ai-optimize-60\"><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-61656\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table3-300x97.jpg\" alt=\"\" width=\"698\" height=\"225\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table3-300x97.jpg 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table3-768x249.jpg 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table3-368x119.jpg 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table3.jpg 936w\" sizes=\"auto, (max-width: 698px) 100vw, 698px\" \/><\/a><\/p>\n<p class=\"ai-optimize-61\"><strong><span data-preserver-spaces=\"true\">The AT commands for data link over an HTTP protocol<\/span><\/strong><span data-preserver-spaces=\"true\"><br \/>\n<\/span><span data-preserver-spaces=\"true\">On an HTTP protocol, data can be communicated using two methods:<\/span><\/p>\n<p class=\"ai-optimize-62\"><span data-preserver-spaces=\"true\"><strong>1. GET method \u2013<\/strong> used to get data from the server<br \/>\n<\/span><span data-preserver-spaces=\"true\"><strong>2. POST method \u2013<\/strong> used to post data to the server\u00a0<\/span><\/p>\n<p class=\"ai-optimize-63\"><span data-preserver-spaces=\"true\">But first, the modem must connect to a GPRS by configuring a bearer profile.\u00a0<\/span><\/p>\n<p class=\"ai-optimize-64\"><span data-preserver-spaces=\"true\">These AT commands can help:\u00a0<\/span><\/p>\n<p class=\"ai-optimize-65\"><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table4.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-61657\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table4-300x83.jpg\" alt=\"\" width=\"699\" height=\"193\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table4-300x83.jpg 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table4-768x213.jpg 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table4-368x102.jpg 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table4.jpg 936w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/a><\/p>\n<p class=\"ai-optimize-66\">These AT commands are useful in getting data from the server using the HTTP GET method:<\/p>\n<p class=\"ai-optimize-67\"><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table5.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-61658\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table5-300x105.jpg\" alt=\"\" width=\"700\" height=\"245\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table5-300x105.jpg 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table5-768x270.jpg 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table5-368x129.jpg 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Table5.jpg 936w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/a><\/p>\n<p class=\"ai-optimize-68\">These AT commands are useful in getting data from the server using the HTTP GET method:<\/p>\n<p class=\"ai-optimize-69\"><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.38.44-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-61660\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.38.44-PM-300x172.png\" alt=\"\" width=\"699\" height=\"400\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.38.44-PM-300x172.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.38.44-PM-768x440.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.38.44-PM-368x211.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.38.44-PM.png 934w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/a><\/p>\n<p class=\"ai-optimize-70\"><strong>The AT commands for a data link over the TCP\/IP protocol<br \/>\n<\/strong>The SIM900 modem also supports a data link over the TCP\/IP protocol. The modem can connect over the TCP\/IP protocol in two modes:<\/p>\n<p class=\"ai-optimize-71\"><strong>1. Single-connection mode \u2013<\/strong> only one connection can be established<br \/>\n<strong>2. Multi-connection mode \u2013<\/strong> a maximum of eight connections can be established<\/p>\n<p class=\"ai-optimize-72\">The TCP\/IP application can also have two modes: transparent and non-transparent. In multi-connection mode, the SIM900A works only in a non-transparent application mode.<\/p>\n<p class=\"ai-optimize-73\">These AT commands are useful for communication as TCP client by the modem to a server:<\/p>\n<p class=\"ai-optimize-74\"><a href=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.41.26-PM.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-61661\" src=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.41.26-PM-300x120.png\" alt=\"\" width=\"699\" height=\"281\" srcset=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.41.26-PM-300x120.png 300w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.41.26-PM-768x308.png 768w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.41.26-PM-368x148.png 368w, https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Screen-Shot-2020-08-03-at-3.41.26-PM.png 935w\" sizes=\"auto, (max-width: 699px) 100vw, 699px\" \/><\/a><\/p>\n<p class=\"ai-optimize-75\"><strong><span data-preserver-spaces=\"true\">How to send AT commands from a user-program<\/span><\/strong><span data-preserver-spaces=\"true\"><br \/>\n<\/span><span data-preserver-spaces=\"true\">The AT commands can be sent to a wireless modem via a user program, such as Python script and as bytes. A programming language may use an escape sequence for the command-line enter.<\/span><\/p>\n<p class=\"ai-optimize-76\"><span data-preserver-spaces=\"true\">For example, in Python3, the command-line enter can be passed serially using a carriage return, for which &#8216;\\r&#8217; is the escape sequence. In Python2, for the command-line enter, the &#8216;\\r\\n&#8217; is the escape sequence.<\/span><\/p>\n<p class=\"ai-optimize-77\"><span data-preserver-spaces=\"true\">In a user-program, the string manipulation functions can be used to properly encode and decode the AT commands and their responses. String manipulation functions are particularly useful when characters, such as CTRL+Z (substitute), must be passed along the AT command.\u00a0<\/span><\/p>\n<p class=\"ai-optimize-78\"><span data-preserver-spaces=\"true\">For example, in Python3, the str.encode() function can be used to encode the AT commands in a script (user-program). CTRL+Z can be passed using the char() function with 26 as the argument \u2014 such as char(26) or char(0x1A).\u00a0 \u00a0<\/span><\/p>\n<p class=\"ai-optimize-79\"><em>In the <a href=\"https:\/\/www.engineersgarage.com\/microcontroller-projects\/articles-raspberry-pi-sim900a-gsm-gprs-modem-voice-call-sms\/\" target=\"_blank\" rel=\"noopener noreferrer\">next tutorial,<\/a> we\u2019ll learn how to make and receive calls, and how to send and receive SMS on Raspberry Pi and a desktop computer by using the SIM900A modem.\u00a0<\/em><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the previous tutorial, we covered how to interface a SIM900A GSM-GPRS modem with Raspberry Pi, Arduino, and desktop computers. SIM900A can communicate data with the controlling device over the universal asynchronous receiver\/transmitter (UART), I2C, or SPI protocol.\u00a0 The modem is a piece of mobile equipment with an IMEI number that\u2019s capable of all cellular&hellip;<\/p>\n","protected":false},"author":387,"featured_media":61663,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_genesis_hide_title":false,"_genesis_hide_breadcrumbs":false,"_genesis_hide_singular_image":false,"_genesis_hide_footer_widgets":false,"_genesis_custom_body_class":"","_genesis_custom_post_class":"","_genesis_layout":"","footnotes":""},"categories":[1853,3993],"tags":[1724],"class_list":{"2":"type-post","10":"entry","11":"has-post-thumbnail"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.2 (Yoast SEO v25.2) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>RPi Python Programming 21: The SIM900A AT commands<\/title>\n<meta name=\"description\" content=\"The AT commands are instructions for a wireless modem.This tutorial covers AT commands that are supported by a SIM900 GSM-GPRS modem.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"RPi Python Programming 21: The SIM900A AT commands\" \/>\n<meta property=\"og:description\" content=\"The AT commands are instructions for a wireless modem.This tutorial covers AT commands that are supported by a SIM900 GSM-GPRS modem.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/\" \/>\n<meta property=\"og:site_name\" content=\"Engineers Garage\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/engineersgarage\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"940\" \/>\n\t<meta property=\"og:image:height\" content=\"552\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Nikhil Agnihotri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:site\" content=\"@EngineersGarage\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nikhil Agnihotri\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/\"},\"author\":{\"name\":\"Nikhil Agnihotri\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\"},\"headline\":\"RPi Python Programming 21: The SIM900A AT commands\",\"datePublished\":\"2025-06-10T19:29:55+00:00\",\"dateModified\":\"2025-06-11T16:02:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/\"},\"wordCount\":1707,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg\",\"keywords\":[\"raspberrypi\"],\"articleSection\":[\"Featured Contributions\",\"Raspberry pi\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/\",\"url\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/\",\"name\":\"RPi Python Programming 21: The SIM900A AT commands\",\"isPartOf\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg\",\"datePublished\":\"2025-06-10T19:29:55+00:00\",\"dateModified\":\"2025-06-11T16:02:55+00:00\",\"description\":\"The AT commands are instructions for a wireless modem.This tutorial covers AT commands that are supported by a SIM900 GSM-GPRS modem.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#primaryimage\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg\",\"width\":940,\"height\":552},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.engineersgarage.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"RPi Python Programming 21: The SIM900A AT commands\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.engineersgarage.com\/#website\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"name\":\"Engineers Garage\",\"description\":\"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News\",\"publisher\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.engineersgarage.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.engineersgarage.com\/#organization\",\"name\":\"Engineer's Garage - WTWH Media\",\"url\":\"https:\/\/www.engineersgarage.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"contentUrl\":\"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png\",\"width\":372,\"height\":52,\"caption\":\"Engineer's Garage - WTWH Media\"},\"image\":{\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/engineersgarage\",\"https:\/\/x.com\/EngineersGarage\",\"https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6\",\"name\":\"Nikhil Agnihotri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g\",\"caption\":\"Nikhil Agnihotri\"},\"url\":\"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"RPi Python Programming 21: The SIM900A AT commands","description":"The AT commands are instructions for a wireless modem.This tutorial covers AT commands that are supported by a SIM900 GSM-GPRS modem.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/","og_locale":"en_US","og_type":"article","og_title":"RPi Python Programming 21: The SIM900A AT commands","og_description":"The AT commands are instructions for a wireless modem.This tutorial covers AT commands that are supported by a SIM900 GSM-GPRS modem.","og_url":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/","og_site_name":"Engineers Garage","article_publisher":"https:\/\/www.facebook.com\/engineersgarage","og_image":[{"width":940,"height":552,"url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg","type":"image\/jpeg"}],"author":"Nikhil Agnihotri","twitter_card":"summary_large_image","twitter_creator":"@EngineersGarage","twitter_site":"@EngineersGarage","twitter_misc":{"Written by":"Nikhil Agnihotri","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#article","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/"},"author":{"name":"Nikhil Agnihotri","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6"},"headline":"RPi Python Programming 21: The SIM900A AT commands","datePublished":"2025-06-10T19:29:55+00:00","dateModified":"2025-06-11T16:02:55+00:00","mainEntityOfPage":{"@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/"},"wordCount":1707,"commentCount":0,"publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"image":{"@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg","keywords":["raspberrypi"],"articleSection":["Featured Contributions","Raspberry pi"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/","url":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/","name":"RPi Python Programming 21: The SIM900A AT commands","isPartOf":{"@id":"https:\/\/www.engineersgarage.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#primaryimage"},"image":{"@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#primaryimage"},"thumbnailUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg","datePublished":"2025-06-10T19:29:55+00:00","dateModified":"2025-06-11T16:02:55+00:00","description":"The AT commands are instructions for a wireless modem.This tutorial covers AT commands that are supported by a SIM900 GSM-GPRS modem.","breadcrumb":{"@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#primaryimage","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg","width":940,"height":552},{"@type":"BreadcrumbList","@id":"https:\/\/www.engineersgarage.com\/articles-raspberry-pi-sim900a-gsm-gprs-modem-at-commands\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.engineersgarage.com\/"},{"@type":"ListItem","position":2,"name":"RPi Python Programming 21: The SIM900A AT commands"}]},{"@type":"WebSite","@id":"https:\/\/www.engineersgarage.com\/#website","url":"https:\/\/www.engineersgarage.com\/","name":"Engineers Garage","description":"Electronic Projects, Electrical Engineering Resources, Makers Articles and Product News","publisher":{"@id":"https:\/\/www.engineersgarage.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.engineersgarage.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.engineersgarage.com\/#organization","name":"Engineer's Garage - WTWH Media","url":"https:\/\/www.engineersgarage.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","contentUrl":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2019\/08\/EGlogo.png","width":372,"height":52,"caption":"Engineer's Garage - WTWH Media"},"image":{"@id":"https:\/\/www.engineersgarage.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/engineersgarage","https:\/\/x.com\/EngineersGarage","https:\/\/www.youtube.com\/channel\/UC0VITh11JSYk-UW7toLebUw"]},{"@type":"Person","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/3c71105e3b40a1fd12c79c15602914b6","name":"Nikhil Agnihotri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.engineersgarage.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/d26b31563fa36169891c8c7d312e9b33de8a0e3da1340ec14ef2de84d5c43497?s=96&r=g","caption":"Nikhil Agnihotri"},"url":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"}]}},"featured_image_src":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg","featured_image_src_square":"https:\/\/www.engineersgarage.com\/wp-content\/uploads\/2020\/08\/Rotator.jpg","author_info":{"display_name":"Nikhil Agnihotri","author_link":"https:\/\/www.engineersgarage.com\/author\/nikhil-agnihotri\/"},"_links":{"self":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/61654","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/users\/387"}],"replies":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/comments?post=61654"}],"version-history":[{"count":0,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/posts\/61654\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media\/61663"}],"wp:attachment":[{"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/media?parent=61654"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/categories?post=61654"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.engineersgarage.com\/wp-json\/wp\/v2\/tags?post=61654"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}