HTTPREAD 缺少 Arduino 和 SIM900 的字符 [英] HTTPREAD missing characters with Arduino and SIM900

查看:23
本文介绍了HTTPREAD 缺少 Arduino 和 SIM900 的字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 Arduino 中使用 SIM900 模块,尽管它返回了正确数量的预期字符,但它缺少字符.我在 AT+SAPBR=1,1 和 AT+HTTPINIT 上有错误,所以我不确定这是否是原因.我也不知道如何解决这些问题.

I am using a SIM900 module with my Arduino and it is missing characters although it is returning the right number of characters expected. I have ERROR on AT+SAPBR=1,1 and AT+HTTPINIT so I am not sure if this is the reason for it. Im not sure how to fix these issues either.

AT+CGATT?

+CGATT: 1

OK
AT+CGATT=1

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

OK
AT+SAPBR=3,1,"APN","mobile.o2.co.uk"

OK
AT+SAPBR=1,1

ERROR
AT+HTTPINIT

ERROR
AT+HTTPPARA="URL","http://www.xxxxxxxxxxx.com/temp/"

OK
AT+HTTPACTION=0

OK

+HTTPACTION:1,200,56
AT+HTTPREAD

+HTTPREAD:56
{"type":"dOK

我的读取字符的函数:

void whileAvailable() {
  char data;
  while (SIM900.available()) {
    data=SIM900.read();
    if (data>0) Serial.print(data);
  }
}

我相信该函数可以很好地读取字符,但是我不确定为什么它无法找到其余的字符

I believe the function is reading characters fine however I am not sure why it is failing the find the rest of the characters

推荐答案

需要关闭AT+SAPBR和AT+HTTPINIT模式

You need to shut down AT+SAPBR and AT+HTTPINIT modes

试试这个:AT+SAPBR=0,1

Try this : AT+SAPBR=0,1

       AT+HTTPTERM

这篇关于HTTPREAD 缺少 Arduino 和 SIM900 的字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆