Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http GET don't work after sleep #9

Open
jaka87 opened this issue Feb 16, 2019 · 3 comments
Open

http GET don't work after sleep #9

jaka87 opened this issue Feb 16, 2019 · 3 comments

Comments

@jaka87
Copy link

jaka87 commented Feb 16, 2019

Im scratching my head for few days with this one. When i do GET request it works but when I put module to sleep and then do request it doesn't.

Here is my code:

#include <BareBoneSim800.h>

BareBoneSim800 sim800("internet.bob.si");  //to declare the library with an APN
const char resource[] = "m2msupport.net/m2msupport/test.php";

 const int port = 80;

void setup() {
  Serial.begin(9600);
  sim800.begin();
  while(!Serial);

  Serial.println("Testing GSM module For GPRS Connectivity");
  delay(8000); // this delay is necessary, it helps the device to be ready and connect to a network

  Serial.println("Should be ready by now");
    bool deviceAttached = sim800.isAttached();
  if (deviceAttached)
    Serial.println("Device is Attached");
  else
    Serial.println("Not Attached");

}

void loop() {
  sim800.disableSleep();
  sim800.setFullMode();

// Connecting the the GPRS APN Network
 Serial.println(" Connecting to APN");
 bool netConnect = sim800.gprsConnect();
 if(netConnect)
  Serial.println("Connected to Network");
 else
  Serial.println("An Error Occured");

  if(netConnect)
  {    
    Serial.println("Making HTTP Get Request");
    String result = sim800.sendHTTPData(resource);
    Serial.println("Received Info: ");
    Serial.println(result);
  
  }
    
    sim800.closeHTTP(); // disconnect from server
    sim800.gprsDisconnect();

    bool sleepActivated = sim800.enterSleepMode();    
      if(sleepActivated)
        {    
         Serial.println("zzzzZZZZZZzzzzz"); 
         delay(5000); 
      }
  }  

this is debug for first request

AT+CSCLK=0

OK

AT+CFUN=1

OK

AT+CFUN=1

OK

 Connecting to APN
AT+CIPSHUT

SHUT OK

AT+CGATT=0

OK

AT+SAPBR=0,1

ERROR

AT+SAPBR=3,1,"CONTYPE","GPRS"

OK

AT+SAPBR=3,1,"APN","internet.bob.si"

OK

AT+SAPBR=3,1,"USER",""

OK

AT+SAPBR=3,1,"PWD",""

OK

AT+SAPBR=1,1


OK

AT+CGATT=1

OK

AT+CIPMUX=0

OK

AT+CSTT="internet.bob.si","",""

OK

AT+CIICR

OK

AT+CIFSR

100.65.40.9

Connected to Network
Making HTTP Get Request
AT+HTTPINIT

OK

AT+HTTPPARA="CID",1

OK

AT+HTTPPARA="URL",m2msupport.net/m2msupport/test.php

OK

AT+HTTPACTION=0

OK


+HTTPACTION: 0,200,4

AT+HTTPREAD

+HTTPREAD: 4
test
OK

Received Info: 
AT+HTTPREAD

+HTTPREAD: 4
test
OK

AT+HTTPTERM

OK

AT+CIPSHUT

SHUT OK

AT+CGATT=0

+SAPBR 1: DEACT

OK

AT+SAPBR=0,1

ERROR

AT+CFUN=0

+CPIN: NOT READY

OK

AT+CSCLK=2

OK

zzzzZZZZZZzzzzz

here is the second one

AT+CSCLK=0


OK

AT+CFUN=1


+CPIN: READY

OK


SMS Ready


Call Ready

AT+CFUN=1


OK

 Connecting to APN
AT+CIPSHUT


SHUT OK

AT+CGATT=0


OK

AT+SAPBR=0,1


ERROR

AT+SAPBR=3,1,"CONTYPE","GPRS"


OK

AT+SAPBR=3,1,"APN","internet.bob.si"


OK

AT+SAPBR=3,1,"USER",""


OK

AT+SAPBR=3,1,"PWD",""


OK

AT+SAPBR=1,1



OK

AT+CGATT=1


OK

AT+CIPMUX=0


OK

AT+CSTT="internet.bob.si","",""


OK

AT+CIICR


OK

AT+CIFSR


100.67.23.115

Connected to Network
Making HTTP Get Request
AT+HTTPINIT


OK

AT+HTTPPARA="CID",
Received Info: 

AT+HTTPTERM


OK

AT+CIPSHUT


SHUT 
AT+CFUN=0


+SAPBR

OK

FF


AT+CSCLK=0


OK

AT+CFUN=1


+CPIN:

SMS Ready


Call Ready

Any idea how to fix it ?

@kortos
Copy link

kortos commented Mar 30, 2019

I have the same problem, did you found a solution for the problem?

@jaka87
Copy link
Author

jaka87 commented Mar 31, 2019

I have not. Instead I'm now using https://github.com/carrascoacd/ArduinoSIM800L which is better suited for my needs (post request) and does not have this error.

@thehapyone
Copy link
Owner

I will release an update to fix this issue very soon. Just order for the hardware kit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants