13 Replies Latest reply: Jun 28, 2014 6:01 AM by acpie360 RSS

Question Regarding TM-SMS

Pouyan Vatanpour Newbie
Visibility: Open to anyone

Dear All,

I am kind of a newbie in M2M world, but I am very interested in that topic. I would like to know, Is it possible to have/create a device which I can put a SIM card in it and when an special event happens , send a SMS (a notification) to my cell phone?

- Do I need to program the SIM card to send an SMS to my cellphone number? (HOW)?

I saw some commercial that there was a device(with SIM card inside) checks the temperature of a room and if the temperature goes beyond some level , the device send a text to a cell phone. The part that I don't understand was, how the device was programmed? Is there any special language (like JMS or C++)?

 

Thanks

Pouyan

  • Re: Question Regarding TM-SMS
    alpercelk Newbie

    Hello Pouyan,

     

    I just wanted to let you know that you can use Tele2 SIM cards and SIM management platform to control and manage your SIMs.

     

    You can contact me when you are ready to make a test with our M2M SIM cards & platform.

     

    Thanks

    Alper Celik

    www.m2m.tele2.com

  • Re: Question Regarding TM-SMS
    Cryptoman Novice

    Hi Pouyan,

     

    Yes, building a device as such is possible.

     

    Most GSM modules have digital I/O that will allow it to interface many different sensors (such as temperature, humidity, vibration etc). These modules also have a small program memory that will allow a user to write small applications (such as the one you have mentioned) in Java. This application can be flashed to the GSM module directly. The advantage of that approach is that you would need minimal electronics around the GSM modem to get it all working.

     

    An alternative approach is to use an external microcontroller (MCU) that interfaces to the GSM module via RS232. The MCU will connect to sensors to program them and to take measurements periodically. When predefined alarm conditions are met, the MCU will send AT commands to the GSM module to send SMS to any number. I have developed applications that are much more sophisticated than this one (with multiple RF sources in the same enclosure) and got them to work very reliably. I can say that AT command interface is powerful and reliable enough for many applications. The downside of the latter approach is you need to build a bit more hardware. The plus side is this approach is more scalable and gives you much more programming space to accommodate later expansions (that are unforeseeable today). Also, with an MCU, you can use C, C++ and other languages depending on the support available.

     

    I know it is also possible to program SIM cards to run special applications on but I never implemented one and therefore cannot be of assistance in that domain. I think the GSM module also needs to support SIM card programming for this strategy to work and not all devices will support this feature.

    • Re: Re: Question Regarding TM-SMS
      Pouyan Vatanpour Newbie

      Thank you so much for your great explanation. I think for start I have to lean more about GSM Module and AT Command and learn how to write a code in C/C++ or Java (I know both of them as I am programmer) for GSM Module. Do you know any site that I can use to learn these stuff

  • Re: Question Regarding TM-SMS
    acpie360 Newbie

    My question is related to what the OP was asking. Suppose I go to a wireless store, say T-Mobile, and buy a SIM card and plug it into my embedded device that communicates a GPRS modem using the AT command set, do I have to know what the APN is from the SIM provider?

    • Re: Question Regarding TM-SMS
      Cryptoman Novice

      @acpie360

       

      Yes, you need to know the APN before you can perform packet communication. The provider I was in touch with used the following strings as the APN: "mgb" and "internet". It was not a number as such but without specifying this I was unable to connect to any server on the internet.

      • Re: Re: Question Regarding TM-SMS

        Thank you. I also got answer from the modem maker's tech support. What he told me is that if I omit the APN field in the +CGDCONT command, it may not work reliably. With the SIM I have from T-Mobile, I can omit the APN or put anything in the field and be able to connect to the cell network.

        • Re: Re: Question Regarding TM-SMS
          Cryptoman Novice

          @Alan

           

          Some operators simply leave the APN field blank and therefore it is possible to ignore it at the application side too. However, because this is not always the case, it's always good to check with the operator first.

          • Re: Re: Question Regarding TM-SMS
            acpie360 Newbie

            Thanks again. Do you happen to know if there is a limit for the maximum number of characters allowed in an APN? Is there a standard or some sort of governing body that defines an APN?

            • Re: Re: Question Regarding TM-SMS
              Cryptoman Novice

              @acpie360

               

              Have a look at the following for the structure of Access Point Name (APN). There is a clear description there.

               

              Access Point Name - Wikipedia, the free encyclopedia

              • Re: Re: Question Regarding TM-SMS
                acpie360 Newbie

                Thanks for taking time on this subject. I read the article in Wikipedia before but didn't think it actually answered my key question about the maximum size (number of characters) allowed in an Access Point Name. However, the useful link in the Wikipedia page took me to the 3GPP's official site and I was able to extract this information from one of their published documents, which states:


                "An APN consisting of both the Network Identifier and Operator Identifier corresponds to a DNS name of a GGSN and has a maximum length of 100 octets."


                In reality, I don't quite believe an actual network provider would have such a long name, after all APN is about "humanly readable". I am developing embedded firmware on a small microcontroller that talks to a GPRS modem. The limited GUI ability on my device certainly puts restriction on the number of characters that the end user is allowed to enter. This is what I am struggling to determine.


                • Re: Re: Question Regarding TM-SMS
                  Cryptoman Novice

                  @acpie360

                   

                  I see the problem you are facing. In order to provide full support as per the standard, you need to allocate 100 octets for the APN field in your application to be safe. I do agree that hardly any operator will allocate a 100 octet APN in practice but this does not guarantee that none of the operators will.

                   

                  If your application has limitations on the maximum APN length that the user can enter, you will be running the risk of not being able to use some operators' networks in the future (although this is a slim chance as mentioned above)

                   

                  If you are confident that your application is likely to use only one operator at all times, it will be safer to allocate the APN length according to that operator's field length (or better still allocate as much as your application will allow you to even if it exceeds the operators current field length) However, if you are planning to use your application globally on all operators' networks in the future, then I suggest you allocate 100 octet field in your design.

                  • Re: Re: Question Regarding TM-SMS
                    acpie360 Newbie

                    My modem maker told me that the maximum number of characters for the network ID portion of APN is 63. 100 characters are simply too long to even fit my LCD screen so I ended up limiting the overall length to 64 (63+null terminator) for a standard C string buffer. Valid characters are 0-9, a-z, dot and hyphen. The end user has to use up/down/left/right/plus/minus keys to enter his APN string. Suck for him but hopefully he only needs to do it once.

                     

                    Thanks for all the help. Greatly appreciated.

  • Re: Question Regarding TM-SMS
    Tony Yang Apprentice

    Hi Pouyan

     

    Most GPRS modem are using AT commands to send SMS, you need to develop a small program to make the modem run these commands. The commands are simple.

     

    AT+CMGF=1<cr>                                          // Set ASCII mode

    OK

     

    AT+CMGS=”18612345678”<cr>                     //Set destination number

    >Hello→                                                     // Input message,  ”→” means Ctrl+Z(0X1A)

    +CMGSnnn                                             // message stamp

    OK


                                    

    Shenzhen Yinghua Technology Co.,Ltd

        ---Manufacturer of GPRS/CDMA/3G/4G LTE Modem and Router

    Http://www.yinghuatn.com

    Tel:+86-755-36690123 Fax:+86-755-36690121

    Email: service@yinghuatn.com

    Skype: jim2085