1

I am a rookie to arduino. I am trying to access MQTT server using Sim800l coreboard GSM module with Adafruit Fona/Tinygsm library but failed.So I decided to check http GET/POST request with AT command first.In AT commands all the basic commands following www.exploreembedded.com/wiki/Setting_up_GPRS_with_SIM800L works fine but whenever I make a GET request by "AT+CIPSTART=" module restart itself.by AT commandsI also tried seeduino library GPRS_HTTP example, it gives me "error:CIPSTART" and restarts module.Though this code worked one time only,this is the code

#include <gprs.h>
#include <SoftwareSerial.h>

char http_cmd[] = "GET /media/uploads/mbed_official/hello.txt 
HTTP/1.0\r\n\r\n";
char buffer[512];

GPRS gprs;

void setup() {
Serial.begin(9600);
while(!Serial);
Serial.println("GPRS - HTTP Connection Test...");  
gprs.preInit();
while(0 != gprs.init()) {
 delay(1000);
 Serial.println("init error");
}  
while(!gprs.join("gpinternet")) {  //change "cmnet" to your own APN
  Serial.println("gprs join network error");
  delay(2000);
}
// successful DHCP
Serial.print("IP Address is ");
Serial.println(gprs.getIPAddress());

Serial.println("Init success, start to connect mbed.org...");

if(0 == gprs.connectTCP("mbed.org", 80)) {
  Serial.println("connect mbed.org success");
}else{
  Serial.println("connect error");
  while(1);
}

Serial.println("waiting to fetch...");
if(0 == gprs.sendTCPData(http_cmd))
{      
gprs.serialDebug();
}

//  gprs.closeTCP();
//  gprs.shutTCP();
//  Serial.println("close");  
}

void loop() {    

}

also tried this commands and module got restarted after AT+HTTPACTION=0 this last command enter image description here

module power and sim configure are fine as far I know,please help me find out what am I doing wrong?Sorry for making this long.please ask me if I couldn't make the question clear.TIA

  • How exactly are you powering the SIM800? – Majenko Sep 17 '17 at 12:58
  • I have connected a buck booster with arduino 5V pin and got 4V for SIM800l as it works between 3.6-4.2 . also while using AT+CIICR or AT+SAPBR =1,1 command, module blinks continuously until making a GET request I don't know if it is normal or not and then restarts. – Kamrul Haasan Sep 17 '17 at 15:23
  • it can make calls ,send text ,shows network status. doesn't restart then. – Kamrul Haasan Sep 17 '17 at 15:26
2

I get it now , a stable power source is the answer. arduino with usb can give right amount of Volts but it lacks stable power(amps i guess) while making a TCP connection, that's why module keep restarting.Although it works fine with call, text etc. powering arduino with an AC adapter solves my problem ,now it can connect to mqtt too.Thanks

| improve this answer | |

Not the answer you're looking for? Browse other questions tagged or ask your own question.