Previously we released a Raspberry PI LCD Adapter Kit, which allows you to connect the LCD module of ITDB02-2.4E and ITDB02-2.8 directly to the Raspberry PI development board and provides a library example which is modified based on Henning's UTFT library. After the release, we received a lot of positive feedback which makes us very happy. Although this is only a quite small thing, not even to speak of technical difficulty, yet this gadget can actually bring convenience to many people.

According to the feedback received, many guys hope to add GSM / GPRS functions on the raspberry pie, which can be achieved with our SIM900 GSM / GPRM module. Therefore, now we would like to introduce a "Raspberry PI SIM900 GSM / GPRS Module Adapter Kit", with which you can connect SIM900 GSM / GPRS module directly to the Raspberry PI and break out pin headers from the pins, allowing you to continue to use other unoccupied pins on the Raspberry PI – SIM900 GSM / GPRS module only uses TX and RX pins on Raspberry PI.

As there is a free operation library for SIM900 GSM / GPRM module in Arduino, it is quite convenient to use, we only need just a few simple functions to let Arduino make calls or send SMS alerts. Now, in order to match the newly released adapter kit, our engineers migrated the  library from Arduino to Raspberry PI and deleted some. For specific functions and function prototypes, please refer to our library function manual.

Here we will briefly introduce Raspberry PI SIM900 GSM / GPRS Module Adapter Kit and how to use the library.

First is about hardware connection, link one end of cable directly to pin of Raspberry PI according to the following figure and another end to the adapter board, insert the adapter board directly into the pins of SIM900 GSM / GPRS module, thus connection is done.

Next, we need to make some modifications to the system configuration, because the UART that we will need to use in Raspberry PI is occupied then by the system as default, and we need to release it.

Browse to the file location:


Open and edit the file with administrator privileges:

$ sudo vi /boot/cmdline.txt

After opening, change the following contents:

dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait


dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait

The same way to modify / etc / inittab:

$ sudo vi /etc/inittab

Comment out or delete the following line (usually the last line):

# T0: 23: respawn :/ sbin / getty-L ttyAMA0 115200 vt100

Then save and exit, the modification is done. Next, download and unzip the SIM900 GSM / GRPS module operation library that we can provided. If the zipped folder is placed on desktop, enter into the folder:

cd /home/pi/Desktop/ITEADGSM

Install the library:

make install

Thus the library is installed. If you want to use the library later on, you only need to include GSM.h file in your project files and to add lITEADGSM parameters when compiling.
For example, to compile a sample file in the library folder on the desktop:

gcc GSMDemo.c -o GSMDemo -lITEADGSM

After compilation, you can run the program:

sudo./ GSMDemo

We will release this library to google code to facilitate updating to the latest version. If you encounter any problems during use, you can post questions on our forum, and we will try to help you fix them. If you have good suggestions, you can also send us feedback on the forum.

  ITEAD RPI SIM900 GSM Library (44.0 KiB, 4,107 hits)

Related article:


  1. gcc GSMDemo.c -o GSMDemo -IITEADGSM
    This code is not working in raspberry pi.
    is there any alternate solution for this.
    Please any body help me.

  2. Demo code compiled ok but when trying to run it all I got was a call number: 9 and kept going like that. Any ideeas on how to solve it?

    • Did you turn the module ON by pressing the power button 1 second ?
      I think there’s a problem with the interface board, It doesn’t turn the module on by Raspberry’s GPIO output as expected.

      I managed to get my board working by pressing the pwr button. I have done some test with AT command and let my board asside. Few weeks later, I wanted to continue my tests but my board refused to boot. Do someone know how to debug the board or flash the firmware ?

  3. One question, when you install and configure the gsm module in linux, you can access to the Internet since linux SO (navigator, apt-get and other applications) or only can connect through applications using the gsm library?

  4. Pingback: Raspberry and the remote controlled relay: a low-level approach (a.k.a. “AT modem commands: the usual suspects”). | ML's Garret Labs

  5. Hi,
    i solder pin4 (RI) of sim900 module out, to one of GPIO of RPi, then i find sim900 can NOT power on anymore.it is strange, any hints?
    i am sure there is no short cirsuit, because i measure arounding pins with meter. and i measure VCC 4.7v, pin1 (PERKEY) of sim900 is 2.98v, looks ok. and when pressing pwr button, pin 1 is poll down.

    thanks in advance, Leo

  6. Hi there, I got the unit working i.e. “./GSMDemo” returns:
    call number: 0
    no call
    call number: 1
    incoming voice call

    However, I have two questions:

    1) When I try to send an sms I get an error:
    error=SendSMS(“0027#########”, “test”)
    Any way to debug this?

    2) How can I connect to the internet via GPRS – I cannot find the code anywhere?


  7. I too would be very interested in some help finding out how to get this to connect to the internet. Any help with this would be greatly appreciated!

  8. Hey, Im trying to make my own c script thats dedicated to making outgoing calls. Ive tried passing a number directly to the function CallS, (ex. CallS (“+39123456789″).

    But no call is made as far as I know. Any suggestions on how to make a script dedicated to outgoing calls?

  9. Ok, so I got the code running. The Raspberry Pi is talking with the module, but it’s not recognizing whether or not the module is turned on. With Debug mode turned on, it reports that the module is on, regardless of whether it’s on or off.

  10. I have done the above steps till

    # T0: 23: respawn :/ sbin / getty-L ttyAMA0 115200 vt100

    Then save and exit, the modification is done.

    When I start to restart the raspberry pi model B, it can only bootup halfway. Can i know why is it so? Should I overwrite the 2 amended files?
    Am I able to surf net after doing all the steps as I need to use the GPS module (Adafruit Ultimate GPS Breakout (66 channel w/10 Hz updates) ) which is to link to the raspberry pi to get the GPS coordinates?
    From there, the raspberry pi will send an SMS to my mobile phone through SIM900 and let me check on google map.
    I am stuck now. Please help… Thank you.

  11. When running sudo./ GSMDemo I receive:

    call number: 9
    no response
    call number: 9
    no response

    Also, it seems I can’t send an AT command, simply just never responses.

    Any idea?

    • I did turn the module on, the status is green and the Net led is flashing once in every 3 seconds.
      Somehow just can’t communicate with it from the Raspberry

        • Zoltan,

          I’m having the exact same symptoms but there is no intermediate device. I have the pins connected directly to the RPi. I am powering it via USB, I’m wondering if that could be the issue. But yeah i get call number: 9
          no response

          also AT commands when I communicate via serial get no response

        • Did you ever figure out what was causing this issue? I’m having this exact same problem. When connected directly everything works but right now I’m wired up through another device (adafruit 2.8 capacitive touchscreen) as well. My module is on, the status is green and the Net led is flashing once every 3 seconds but it isn’t communicating for some reason.

          • I was daisy chaining off of my adafruit 2.8 capacitive touchscreen to my GSM addon card. An ‘S’ shaped ribbon extender cable (ribbon cable where the male end is facing the opposite direction of the female end) fixed my problem. I was also able to debug further issues using the minicom application.

  12. Hi, Thanks for the various contributions ; here’s mine:

    By calling the GSM module, I managed to get:

    call number: 1
    incoming voice call

    For this, I needed to add the PIN command in GSMDemo.c (before the loop “while(1)”):

    SendATCmdWaitResp(“AT+CPIN=1234″, 2000, 2000, “+CPIN:READY”, 10);

    Where 1234 is your PIN number.

    Hope this helps.

  13. Hi again,

    Several fixes:

    1. Bug fix in ChangeIToS (thanks to “king”):
    In GSM.c, replace the function with this quick fix:
    char String_Buffer[1024];
    char *ChangeIToS(int IntNU)
    char *String;
    String = String_Buffer;
    return String;

    2. To turn ON the module:
    In code GSM.c, function TurnOn:
    pinMode(GSM_ON, OUTPUT);
    pinMode(GSM_RESET, OUTPUT);

    3. Replace in the function TurnOn all tests, so as to begin with:
    if (AT_RESP_OK != SendATCmdWaitResp( …
    Excepted after: serialPuts(“AT+IPR=”); where you should write:
    if (AT_RESP_OK == SendATCmdWaitResp(

    4. A quick fix to send SMS, in function SendSMS in GSM.c, replace body with:

    if (CLS_FREE != GetCommLineStatus()) return (ret_val);
    ret_val = 0; // still not send
    SendATCmdWaitResp(“AT+CMGF=1″, 2000, 2000, “OK”, 10);
    sprintf(String_Buffer, “%s%s%s%s%c”, “AT+CMGS=\””, number_str, “\”\r”, message_str, 0x1A);
    SendATCmdWaitResp(String_Buffer, 2000, 2000, “OK”, 10);
    return (ret_val);

    The command “AT+CMGS=”number” is included in the header of the SMS; need to investigate why.
    Feedback is welcome.


    • AT+CMGF=1 is necessary to set sms text mode. This code will send a correct SMS (no AT+CMGS=”number” in the header)

      char SendSMS(char *number_str, char *message_str).
      char ret_val = -1;
      if (CLS_FREE != GetCommLineStatus()) return (ret_val);
      ret_val = 0; // still not send
      SendATCmdWaitResp(“AT+CMGF=1″, 500, 50, “OK”, 5);
      sprintf(String_Buffer, “%s%s%s”, “AT+CMGS=\””, number_str, “\”\r”);
      SendATCmdWaitResp(String_Buffer, 500, 50, “>”, 5);
      sprintf(String_Buffer, “%s%c”, message_str, 0x1A);
      ret_val=SendATCmdWaitResp(String_Buffer, 500, 50, “OK”, 5);
      return (ret_val);

  14. In fix #4, not tested yet, but the following line:
    SendATCmdWaitResp(“AT+CMGF=1″, 2000, 2000, “OK”, 10);
    Is probably not necessary, and would explain why the commande AT+CMGS is included in the header.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>