GithubHelp home page GithubHelp logo

seeed-studio / gprs_shield_suli Goto Github PK

View Code? Open in Web Editor NEW
48.0 36.0 40.0 52 KB

GPRS Shield based on SIM900

Home Page: http://www.seeedstudio.com/depot/GPRS-Shield-V20-p-1379.html?cPath=19_20

License: MIT License

C++ 91.98% C 8.02%

gprs_shield_suli's Introduction

GPRS Shield Suli Build Status

GPRS Shield V3.0

GPRS Shield provide you a way to DIY your own mobile phone. You can use your GRPS Shield to dial a phone number or send a text message to your friend. Besides these, you can use it to access the network and view web pages. For more information, you can visit our Wiki Page

Features

  • Compatible with standard Arduino and Arduino Mega
  • Selectable interface between hardware serial port and software serial port
  • Selectable interface between hardware serial port and software serial port
  • Support TCP/UDP protocols
  • Full control via AT commands set: Standard - GSM 07.07 & 07.05 and Enhanced - SIMCOM AT Commands
  • 2-in-1 headset jack
  • Convenient external SIM card holder
  • Low power consumption: 1.5mA(sleep mode)
  • 3V CR1220 Battery Holder Connetor

Applications

  • Call up and answer Call
  • Send SMS and read SMS
  • AT Command Test
  • TCP Connection Test

Getting Started

Make sure that three libraries (GPRS_Shield_Suli —— GPRS Module Library, SoftwareSerial —— we use software serial to communicate with GPRS module, Suli_Arduino—— the Seeed Unified Libray interface) have been in your libraries folder. Then you can have a test with the sketches in example folder.

  • GPRS_Serial_Debug —— test GPRS module with AT commands.
  • GPRS_CallUp —— give a call to someone.
  • GPRS_SendSMS —— send a message to someone.
  • GPRS_LoopHandle —— answer the call & read the message.
  • GPRS_TCPConnection —— build a TCP connection and read the content from the specified website.

This software is written by lawliet zou () for Seeed Technology Inc. and is licensed under The MIT License. Check License.txt/LICENSE for the details of MIT license.

Contributing to this software is warmly welcomed. You can do this basically by
forking, committing modifications and then pulling requests (follow the links above
for operating guide). Adding change log and your contact into file header is encouraged.
Thanks for your contribution.

Seeed is a hardware innovation platform for makers to grow inspirations into differentiating products. By working closely with technology providers of all scale, Seeed provides accessible technologies with quality, speed and supply chain knowledge. When prototypes are ready to iterate, Seeed helps productize 1 to 1,000 pcs using in-house engineering, supply chain management and agile manufacture forces. Seeed also team up with incubators, Chinese tech ecosystem, investors and distribution channels to portal Maker startups beyond.

Analytics

gprs_shield_suli's People

Contributors

killingjacky avatar lanselambor avatar lawliet004 avatar pillar1989 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gprs_shield_suli's Issues

GPRS Shield V2 with Arduino MEGA 2560

Hi,

I tried your GPRS Shield V2 with my Arduino Uno by using your example TCP Connection which worked perfectly. But when I put my Arduino MEGA 2560 instead of the UNO, the Arduino is not able to join the network (error: "GPRS Join network error.").
Could you help me with this compatibility issue please ?

Thank you in advance.

Marc

Send SMS example not working

Hello,
I'm new to this, I have a v2 of the GPRS shield. The Shield works with the serial example on the Wiki page so the board works and so does the SIM card.
I installed the library. open up the Send SMS example, and change the number. This is where things get a little weird.
I upload the sketch, with the modem off power up then turn on the modem and wait for the green light to blink once every 3 seconds. Then open the Arduino serial monitor and get the message

init error

If I power off the modem with the Arduino serial monitor still open it will say

gprs init success
start to send message..

and nothing happens.

suggestions?
Thanks,
J

GSM recieving problem

Hi,

thanks for this great library.

I have found an issue in GPRS_LoopHandle example.

I'm not using your official shield, but a third party SIM900 shield.

It's about finding CMTI text in uart.

If you don't config your SIM900 with 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), you could not recieve CMTI text in uart.

We have two possible solution (I prefer b) solution)

a. Always config with this AT command: CNMI
b.Change the library with a function like: isSMSpresent that will return the index of the first unread SMS

Here is the code from SIM900.h library:

char SMSGSM::IsSMSPresent(byte required_status)
{
char ret_val = -1;
char *p_char;
byte status;

 if (CLS_FREE != gsm.GetCommLineStatus()) return (ret_val);
 gsm.SetCommLineStatus(CLS_ATCMD);
 ret_val = 0; // still not present

 switch (required_status) {
 case SMS_UNREAD:
      gsm.SimpleWriteln(F("AT+CMGL=\"REC UNREAD\""));
      break;
 case SMS_READ:
      gsm.SimpleWriteln(F("AT+CMGL=\"REC READ\""));
      break;
 case SMS_ALL:
      gsm.SimpleWriteln(F("AT+CMGL=\"ALL\""));
      break;
 }

 // 5 sec. for initial comm tmout
 // and max. 1500 msec. for inter character timeout
 gsm.RxInit(5000, 1500);
 // wait response is finished
 do {
      if (gsm.IsStringReceived("OK")) {
           // perfect - we have some response, but what:

           // there is either NO SMS:
           // <CR><LF>OK<CR><LF>

           // or there is at least 1 SMS
           // +CMGL: <index>,<stat>,<oa/da>,,[,<tooa/toda>,<length>]
           // <CR><LF> <data> <CR><LF>OK<CR><LF>
           status = RX_FINISHED;
           break; // so finish receiving immediately and let's go to
           // to check response
      }
      status = gsm.IsRxFinished();
 } while (status == RX_NOT_FINISHED);




 switch (status) {
 case RX_TMOUT_ERR:
      // response was not received in specific time
      ret_val = -2;
      break;

 case RX_FINISHED:
      // something was received but what was received?
      // ---------------------------------------------
      if(gsm.IsStringReceived("+CMGL:")) {
           // there is some SMS with status => get its position
           // response is:
           // +CMGL: <index>,<stat>,<oa/da>,,[,<tooa/toda>,<length>]
           // <CR><LF> <data> <CR><LF>OK<CR><LF>
           p_char = strchr((char *)gsm.comm_buf,':');
           if (p_char != NULL) {
                ret_val = atoi(p_char+1);
           }
      } else {
           // other response like OK or ERROR
           ret_val = 0;
      }

      // here we have gsm.WaitResp() just for generation tmout 20msec. in case OK was detected
      // not due to receiving
      gsm.WaitResp(20, 20);
      break;
 }

 gsm.SetCommLineStatus(CLS_FREE);
 return (ret_val);

}

Could you update your library with a similar function ?

May be your function could return both index and total number of UNREAD sms

Hope your answer.

Best regards,

GPRS init

Hi,

I saw your sendSMS function and was wondering if your initialization condition is false or not. Here is your code :

`
void setup() {

Serial.begin(9600);

while (0 != gprsTest.init()) {
    delay(1000);

    Serial.print("init error\r\n");

}

Serial.println("gprs init success");

Serial.println("start to send message ...");

gprsTest.sendSMS(PHONE_NUMBER, MESSAGE); //define phone number and text

}
`

I see here that your condition is waiting for a 0, or a false in the gprs.init() method.
But if we go to your GPRS_Shield_Arduino.cpp file, we see that the function returns true if everything went well. Why do you wait for a false to say if the initialization was successful ? Here is the code :

`
int GPRS::init(void) {
if (0 != sim900_check_with_cmd("AT\r\n", "OK\r\n", CMD)) {
return false;

}

if (0 != sim900_check_with_cmd("AT+CFUN=1\r\n", "OK\r\n", CMD)) {
    return false;

}

if (0 != checkSIMStatus()) {
    return false;

}

return true;

}
`

Is there anything I have misunderstood ?

Best regards.

Why funtions are int and not char ?

Why functions returns ints and not chars ? It is because this library is for several platforms and not all of them work with bytes/chars ?

wait_readable is not waiting - mistake in code

in "sim900_wait_readable"

instead of :
while((unsigned long) (millis() - timerStart) > wait_time * 1000UL)

should be

while((unsigned long) (millis() - timerStart) < wait_time * 1000UL)

(the comparison is the wrong way so it never waits ....)

SMS works fine, but can't open TCP/IP connection

I have a SIM from an att gophone hotspot. It's data only. I'm sure there is data available, but no voice and messaging. I've gotten the modem to work, but I can't get the tcp connection example to work. I've tried replacing the apn name "cmnet" with both "wap.cingular" and "isp.cingular," but I haven't had any luck. Can you recommend any next steps?

Turning this into a WiFi Hot Spot

Any ideas on how to do this? Going to start playing with your TCP connection example.

Want to create a group of HUZZAH ESP 8266 Chips talking over a single GSM "Hub"

New to GitHub so "should" have some of m source files up for you to take a look at the Huzzah code if you're interested.

Cheers!

sim900_read_buffer, Suli not quickly enough ?

Is sim900_read_buffer funtion you have an strange comment:

Anyway, Suli is not quickly enough to fetch data from buffer, so
we have to fetch our data like this.

It is inside an ´#if false #else #endif`.

But why you can use the first part if it is used in sim900_wait_for_resp function ???

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.