0

changed the firmware on SIM900B

try to send get request http://dummy.restapiexample.com/api/v1/employee/1 AT+HTTPACTION=0returned +HTTPACTION:0,200,98

but, when I try to read (AT+HTTPREAD or AT+HTTPREAD=0,98)the response data I got broken response

expected result:

+HTTPREAD:98
{"id":"1","employee_name":"Shibani","employee_salary":"999","employee_age":"0","profile_image":""}

and actual results:

+HTTPREAD:98
{"id":"1","employee_name":"Shibani","employee_salary":"999","empe_"0"olme"

+HTTPREAD:98
{"id":"1","employee_name":"Shibani","employee_salary":"999","empe_"0"fea"}

+HTTPREAD:98
{"id":"1","employee_name":"Shibani","employee_salary":"999""pea:,piig"

+HTTPREAD:98
{"id":"1","employee_name":"Shibani","employee_salary":"999",moeg""reae}

my Arduino code looks like that

void setup() {
  Serial.begin(9600);
  mySerial.begin(57600);
  delay(5000);
  mySerial.println("AT");
  Serial.println("End of the setup");
}

void loop() {
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}
  • 1
    Edit the question : post your arduino code. Looks like a string overflow might be happening. – tavis Nov 24 '19 at 21:54
  • 1
    Maybe you're doing that silly "wait 5 seconds and assume there's a reply" thing I see all over the place. Or maybe you're using SoftwareSerial at 115200 baud... No one can know - unless you share your code... – Majenko Nov 24 '19 at 21:58
  • @Majenko, thanks, I've changed the baud to 9600 and it started work fine – JVic Nov 24 '19 at 22:22
2

Apparently you were running software serial at too high of a baud rate (57600) and bringing it down to 9600 fixed the issue.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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