Arduino 3G shield using SoftwareSerial to control
On the 3G shield, by default the power pin is on D8 and reset pin is on D9. Make it HIGH then it works.
if you want to play this 3G shield using SoftwareSerial on Arduino,
Try this code:
/* Change UART control ports from Tx0 / Rx1 to Tx2 / Rx3 using SoftwareSerial
And reserve Tx0 / Rx1 for debugging */ #include <SoftwareSerial.h> #define rxPin 6
#define txPin 7 #define power_pin 8
#define reset_pin 9 SoftwareSerial mySerial(rxPin, txPin); // RX, TX char AtCommand[] = "ATI\r";
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin();
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT); // power on 3G module automatically
pinMode(power_pin, OUTPUT);
digitalWrite(power_pin, HIGH); delay(); Serial.println(AtCommand); // set the data rate for the SoftwareSerial port
mySerial.begin();
mySerial.println(AtCommand);
//mySerial.write(AtCommand);
} void loop() // run over and over
{
if (mySerial.available())
{
Serial.write(mySerial.read());
}
if (Serial.available())
{
mySerial.write(Serial.read());
}
}
if you play with this 3G shield, and you want to enable power at the setup, and change the baud rate from 115200 to 9600 on your arduino when communicating with chip SIM5126E.
Try this code:
/* Change UART control ports from Tx0 / Rx1 to Tx2 / Rx3 using SoftwareSerial
And reserve Tx0 / Rx1 for debugging */
#include <SoftwareSerial.h> #define rxPin 6
#define txPin 7
#define baudrate 9600 #define power_pin 8
#define reset_pin 9 SoftwareSerial mySerial(rxPin, txPin); // RX, TX char AtCommand[] = "ATI\r";
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(baudrate);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT); Serial.println(AtCommand); // set the data rate for the SoftwareSerial port
Serial.println("wait 5s for modem to wake up"); // power on 3G module automatically
pinMode(power_pin, OUTPUT);
digitalWrite(power_pin, HIGH); delay();
mySerial.begin();
mySerial.println("AT+IPR=9600\r\n"); // chnage baudrate to 9600 baud Serial.println("Changing baudrate");
mySerial.begin(baudrate);
mySerial.println(AtCommand);
} void loop() // run over and over
{
if (mySerial.available())
{
Serial.write(mySerial.read());
}
if (Serial.available())
{
mySerial.write(Serial.read());
}
}
Arduino 3G shield using SoftwareSerial to control的更多相关文章
- Arduino 3g shield using GSM bought from ITead
This is an old arduino 3G module bought half years ago. Its wiki: http://wiki.iteadstudio.com/ITEAD_ ...
- Arduino UNO开发板、Arduino CNC Shield V3.0扩展板、A4988驱动板、grbl固件使用教程
前言 CNC Shield V3.0可用作雕刻机,3D打印机等的驱动扩展板,板上一共有4路步进电机驱动模块的插槽,可驱动4路不进电机,而每一路步进电机都只需要2个IO口,也就是说,6个IO口就可以很好 ...
- Welcome to LED Control Wiki
About this project This project was developed after I had to find out that controlling my RGB ambien ...
- 一百元的智能家居——Asp.Net Mvc Api+讯飞语音+Android+Arduino
大半夜的,先说些废话提提神 如今智能家居已经不再停留在概念阶段,高大上的科技公司都已经推出了自己的部分或全套的智能家居解决方案,不过就目前的现状而言,大多还停留在展厅阶段,还没有广泛的推广起来,有人说 ...
- Arduino 学习
Arduino 背景可以参考官方网站www.arduino.cc 先看一个最简单的示例程序: 打开 Arduino IDE , 选择菜单:文件 -> 示例 -> 01.Basics -&g ...
- Arduino Nano + WIZ550io = 简易上网
我爱Arduino Nano – 这是一个非常好外形小巧却功能齐全的Arduino Uno.然而.当我去将它连接到互联网,全部的干净利落小巧也消失在大尺寸的以太网盾底下了. 只是,我近期发现了一个更好 ...
- 用Arduino做一个可视化网络威胁级别指示器!
在当今世界,网络监控器是非常重要的.互联网是个可怕的地方.人们已经采取措施以提高警戒----他们安装了入侵检测系统(IDS)比如SNORT. 通过把可视化部分从电脑中移出来,我们想让它更容易去观察.一 ...
- Arduino 网络时钟client
升级! 添加了12h/24h 的开关,还有标准/ 夏令时开关!见步骤7 & 步骤8. 你是否曾想要一个和办公室时间来源全然准确的表? 这就有一个网络的办公时间server,你能够根据它并同步你 ...
- 为什么Arduino独占鳌头并站稳脚跟?
出处: http://bbs.dfrobot.com.cn/thread-793-1-1.html 为什么Arduino独占鳌头并站稳脚跟? 每个月,我都会在<Make>杂志上发表几篇社论 ...
随机推荐
- RF1001: 各浏览器对 '@font-face' 规则支持的字体格式不同,IE 支持 EOT 字体,Firefox Safari Opera 支持 TrueType 等字体
http://w3help.org/zh-cn/causes/RF1001 http://blog.csdn.net/agileclipse/article/details/12450949 http ...
- finally 对 return 值没有影响
public int gettest(ref int i, ref int k) { int j = 0; try { return i / j; } catch (Exception Ex) { k ...
- CRUD功能的JqGrid表格
CRUD功能的JqGrid表格 之前的项目也曾用过JgGrid对它的基本功能也是略有了解,网上有个国外的开源的项目,但是不适合个人的风格,所以花了3天空余的时间封装了下JqGrid,也算是参加开发工作 ...
- Web API-路由(一)
这一篇文章描述了ASP.NET API如何将HTTP请求路由到控制器. 如果你熟悉ASP.NET MVC,Web API路由和MVC路由非常相似,主要的不同地方是Web API使用HTTP方法,而不是 ...
- post与get,这两人到底神马区别??
甲曰:“1. GET使用URL或Cookie传参.而POST将数据放在BODY中. 2. GET的URL会有长度上的限制,则POST的数据则可以非常大. 3. POST比GET安全,因为数据在地址栏上 ...
- unity多边形uv地图
我曾经写过一篇文章,不规则图形uv地图.(http://blog.csdn.net/itolfn/article/details/17240131)我用三角算法.但是,这种方法已经不完全,有一个指明: ...
- WCF服务上应用protobuf
WCF服务上应用protobuf Web api 主要功能: 支持基于Http verb (GET, POST, PUT, DELETE)的CRUD (create, retrieve, updat ...
- jquery的使用 关于 option ,append,attr,val()等的使用
//遍历option和添加.移除option function changeShipMethod(shipping){ var len = $("select[@name=ISHIPTYPE ...
- C# 解析bt种子
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.C ...
- [译]Java垃圾回收是如何工作的
说明:这篇文章来翻译来自于Javapapers 的How Java Garbage Collection Works 这部分教程是为了理解Java垃圾回收的基础以及它是如何工作的.这是垃圾回收系列教程 ...