2014-06-13 61 views
1

我正在从ITEADSTUDIO购买的3G GPRS屏蔽。它有一个SIM5216 WCDMA模块。Arduino 3G GPRS屏蔽不工作

我有上盾以下限制现在

  • 我怎么知道,盾已成功连接到网络提供商?
  • 如何调用3G护盾上的AT命令?
  • 如何从3G GPRS屏蔽发送短信?

请为我提供上述约束的解决方案。

预先感谢您

回答

0

首先,根据您的文章的风格,我只是想提醒你,周围有google搜索了地狱,你的盾牌和敲打你的头靠在墙上没办法为了弄清楚如何使用你刚买的东西。在接下来的文章中,我将写出所有问题的答案,这将给你一个良好的开端,但是你仍然必须从你不了解的所有东西中去找出地狱,尝试一切,直到..forever。

如果您还没有得到一些Arduino的练习,请阅读“arduino入门”。

1.)您可以做几个测试。 Here是一个带AT命令的教程,您可以使用它来编程屏蔽。我建议上传一个“AT命令的串行中继”到你的arduino板上,然后尝试从你的arduino发送或接收文本消息。这是我使用的串行中继。请注意,代码原样不会与您的屏蔽一起工作,因为tx/rx引脚的设置不同。 (在我的屏蔽--seeteudio GPRS 2.0上,tx和rx引脚设置在引脚7和8上。在您的屏幕上,they are set up on 1-6。)幸运的是,屏蔽上的引脚设置可能允许您使用GSM库示例随Arduino IED一起提供。

//Serial Relay - Arduino will patch a 
//serial link between the computer and the GPRS Shield 
//at 19200 bps 8-N-1 
//Computer is connected to Hardware UART 
//GPRS Shield is connected to the Software UART 

#include <SoftwareSerial.h> 

SoftwareSerial GPRS(7, 8); 
unsigned char buffer[64]; // buffer array for data recieve over serial port 
int count=0;  // counter for buffer array 
void setup() 
{ 
    GPRS.begin(19200);    // the GPRS baud rate 
    Serial.begin(19200);    // the Serial port of Arduino baud rate. 

} 

void loop() 
{ 
    if (GPRS.available())    // if date is comming from softwareserial port ==> data is comming from gprs shield 
    { 
    while(GPRS.available())   // reading data into char array 
    { 
     buffer[count++]=GPRS.read();  // writing data into array 
     if(count == 64)break; 
    } 
    Serial.write(buffer,count);   // if no data transmission ends, write buffer to hardware serial port 
    clearBufferArray();    // call clearBufferArray function to clear the storaged data from the array 
    count = 0;      // set counter of while loop to zero 


    } 
    if (Serial.available())   // if data is available on hardwareserial port ==> data is comming from PC or notebook 
    GPRS.write(Serial.read());  // write it to the GPRS shield 
} 
void clearBufferArray()    // function to clear buffer array 
{ 
    for (int i=0; i<count;i++) 
    { buffer[i]=NULL;}     // clear all index of array with command NULL 
} 

2)上传的串行继电器(用于发送AT直接从您的键盘命令)或将其嵌入到你的Arduino的代码,因为他们在GSM例子做。要使用串行继电器,请阅读this关于终端基础知识的文章。 (对sparkfun.com非常熟悉,这是一个很棒的网站,也包括instructables和adafruit)。

3.)您的ide上的GSM库中有一个示例代码,它应该适用于您的屏蔽。或者,您可以使用终端中的命令完成串行中继设置。这样做的命令应该在我给你答案1的链接中。

还有一个想法让我想起了一段时间:确保你有适合你的sim卡的数据计划和相应的APN。我使用了ATT gophone,所以apn是wap.cingular。

祝你好运。

相关问题