Difference between revisions of "Quad-band GPRS/GSM Shield for Arduino"
(→Usage) |
M2msupport (talk | contribs) (→Second Tutorial) |
||
Line 117: | Line 117: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
+ | |||
+ | '''AT Command Tester Application''' | ||
+ | |||
+ | [http://m2msupport.net/m2msupport/module-tester/ AT Command Tester] is a free online tool test [http://m2msupport.net/m2msupport/software-and-at-commands-for-m2m-modules/ AT Commands] and other modem functionalities of [http://m2msupport.net/m2msupport/category/devices/gprs-modem/ 2G modules] (GPRS/EDGE) , [http://m2msupport.net/m2msupport/category/devices/gprs-modem/ 3G Modules] (HSDPA/EVDO) and [http://m2msupport.net/m2msupport/search-page/?Max!Download!Speed=100%20Mbps 4G Modules] (LTE).AT Command Tester tool connects to the modem port of the device and can test various modem functions such as getting [http://m2msupport.net/m2msupport/at-commands-to-get-device-information/ device information], [http://m2msupport.net/m2msupport/data-call-at-commands-to-set-up-gprsedgeumtslte-data-call/ gprs data call], [http://m2msupport.net/m2msupport/voice-call-at-commands-to-set-up-voice-call/ voice call],[http://m2msupport.net/m2msupport/at-command-for-http-functions-for-remote-server-data-access/ http access], [http://m2msupport.net/m2msupport/signal-quality/ checking signal condition], [http://m2msupport.net/m2msupport/network-registration/ network registration], [http://m2msupport.net/m2msupport/sms-at-commands/ SMS functions], [http://m2msupport.net/m2msupport/sim-at-commands-for-sim-presense-and-status/ SIM access], [http://m2msupport.net/m2msupport/sim-phonebook-at-commands/ phonebook functions] etc. | ||
+ | |||
+ | In the 'Port Configuration' section of the tool, users can search for available ports using the 'Find Ports' button. Then using the 'Connect' button, users can connect to the modem port of the device. | ||
+ | |||
+ | In the 'Command Mode' tab of AT Command Tester, single AT commands can be sent. The drop down list provides AT command description and examples. Users can modify the default command settings. | ||
+ | |||
+ | [[File:M2m img1.PNG]] | ||
+ | |||
+ | |||
+ | Under the 'Script Mode' tab, multiple AT commands can be sent at a time. Users can add descriptive comments and save the script on their local machine. | ||
+ | |||
+ | [[File:Script mode.PNG]] | ||
+ | |||
+ | Data Call | ||
+ | |||
+ | To make a data call with the modem, you need to connect to the APN of the carrier network. The carrier APN and other required information are stored in the SIM card and are referred as PDP contexts. Typically multiple PDP contexts are stored in the SIM for different call types. With the AT Command Tester you can edit/add/delete PDP contexts in a easy to use user interface. | ||
+ | |||
+ | [[Image:Datacall.PNG]] | ||
+ | |||
+ | |||
+ | <br>Typical call setup sequence, | ||
+ | |||
+ | [http://m2msupport.net/m2msupport/atcgdcont-define-pdp-context/ AT+CGDCONT?] | ||
+ | |||
+ | +CGDCONT: 1,"IP","epc.tmobile.com","0.0.0.0",0,0<br>+CGDCONT: 2,"IP","test5","0.0.0.0",0,0<br>+CGDCONT: 3,"IP","","0.0.0.0",0,0 | ||
+ | |||
+ | OK<br>Checking registration status... | ||
+ | |||
+ | [http://m2msupport.net/m2msupport/atcreg-network-registration/ AT+CREG?] | ||
+ | |||
+ | +CREG: 0,1 | ||
+ | |||
+ | OK<br>The device is registered in home network. | ||
+ | |||
+ | Checking if device is already connected... | ||
+ | |||
+ | [http://m2msupport.net/m2msupport/atcgact-pdp-context-activate-or-deactivate/ AT+CGACT?] | ||
+ | |||
+ | +CGACT: 1,0<br>+CGACT: 2,0<br>+CGACT: 3,0 | ||
+ | |||
+ | OK<br>[http://m2msupport.net/m2msupport/atcmee-report-mobile-termination-error/ AT+CMEE=1] | ||
+ | |||
+ | OK<br>Attaching to network...<br>AT+CGATT=1 | ||
+ | |||
+ | OK | ||
+ | |||
+ | Connecting... | ||
+ | |||
+ | [http://m2msupport.net/m2msupport/atcgact-pdp-context-activate-or-deactivate/ AT+CGACT=1, 1] | ||
+ | |||
+ | OK<br>Connect Sucessful | ||
+ | |||
+ | <br> '''SMS''' | ||
+ | |||
+ | The SMS tab of the 'AT Command Tester' tool provides the interfaces to send SMS messages. You can also list/view/delete SMS messages stored on the SIM. | ||
+ | |||
+ | [[Image:Sms.PNG]] <br> General sequence for sending SMS message, | ||
+ | |||
+ | Checking registration status... | ||
+ | |||
+ | [http://m2msupport.net/m2msupport/atcreg-network-registration/ AT+CREG?] | ||
+ | |||
+ | +CREG: 0,1 | ||
+ | |||
+ | OK<br>The device is registered in home network. | ||
+ | |||
+ | AT+CMGS="858XXXXXXX" | ||
+ | |||
+ | > Test Message with AT Command Tester� | ||
+ | |||
+ | +CMGS: 19 | ||
+ | |||
+ | OK<br>SMS Send successful | ||
+ | |||
+ | '''Network Selection''' - This tab allows the user to manually select available networks. Modems are typically set for automatic network selection. 'Find Networks' button will command the modem to scan for available networks. | ||
+ | |||
+ | [[Image:Network selection.PNG]] | ||
+ | |||
+ | <br> | ||
+ | |||
+ | AT+COPS command will initiate network scan in the modem, | ||
+ | |||
+ | Finding Networks. Please wait.. | ||
+ | |||
+ | [http://m2msupport.net/m2msupport/atcops-plmn-selection/ AT+COPS=?] | ||
+ | |||
+ | +COPS: (2,"T-Mobile","T-Mobile","310260"),(1,"AT&T","AT&T","310410"),,(0,1,4),(0,1,2) | ||
+ | |||
+ | OK<br>Networks found | ||
+ | |||
+ | <br> | ||
+ | |||
+ | '''Phonebook'''<br> | ||
+ | |||
+ | With the 'Phone Book' tab, you can add/delete/read phone book entries stored on the SIM, | ||
+ | |||
+ | [[Image:Phone book.PNG]] | ||
+ | |||
+ | Getting phonebook entries.. | ||
+ | |||
+ | [http://m2msupport.net/m2msupport/atcpbr-read-phonebook-entries/ AT+CPBR=1,99] | ||
+ | |||
+ | +CPBR: 1,"*233",129,"Refill Now" | ||
+ | |||
+ | +CPBR: 2,"#999#",255,"Check Balance" | ||
+ | |||
+ | +CPBR: 3,"8878878878",129,"Test" | ||
+ | |||
+ | OK<br> | ||
== FAQ == | == FAQ == |
Revision as of 13:28, 29 March 2013
Contents
Introduction
Model:Arduino_SM5100_1
Features
Application Ideas
Cautions
Schematic
Specification
Pin definition and Rating
Mechanic Dimensions
Usage
This tutorial covers the GPRS/GSM SM5100B Shield: http://www.cutedigi.com/arduino-shields/quad-band-gprsgsm-shield-for-arduino-cellular-module-included.html
The shield must be powered by a wall adapter with 12V, 1A.
Hardware Jumpers Explain:
- J1 and J2 are used to choose how RX/TX of SM5100B is going to connected to Arduino.
- RX/TX is the RX/TX of SM5100B module.
- MTX/MRX is the TX/RX of Atmega328.
- D3 and D2 are the I/O of Atmega328 if soft serial is used.
First Tutorial
- RX jump to MRX, TX jump to MTX, and remove the atmega328P from arduino.
By doing this, we can directly monitor serial port output using the USB port. The default baud rate of SM5100B is 115200.
- Install X-CTU serial terminal console X-CTU.
- Change communication band to 7 if you are in North America. Refer to change communication band
If you see +SIND: 8, it means that it's not registered on the network:
It could be: SIM card issue, card is not active, or the contact to the SIM socket is not good antenna cable connection issue
Second Tutorial
Now we are going to use atmega328P's UART to talk to USB, and soft serial of atmega328P to talk to Sm5100B.
Before we do that, we have to change SMB5100's data rate to 9600 as soft serial can't go to 119200. In first tutorial setup, do: AT+IPR=9600 to set the baud rate to 9600.
Now set the jumper RX to D3, and TX to D2. SO that atmega328P's UART to talk to USB and soft serial of atmega328P to talk to SM5100B:
<syntaxhighlight lang="c">
/* SparkFun Cellular Shield - Pass-Through Sample Sketch SparkFun Electronics Written by Ryan Owens CC by v3.0 3/8/10 Thanks to Ryan Owens and Sparkfun for sketch */
- include <NewSoftSerial.h> //Include the NewSoftSerial library to send serial commands to the cellular module.
- include <string.h> //Used for string manipulations
char incoming_char=0; //Will hold the incoming character from the Serial Port. NewSoftSerial cell(2,3); //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin. void setup() {
//Initialize serial ports for communication.
Serial.begin(9600); cell.begin(9600); Serial.println("Starting SM5100B Communication..."); } void loop() { //If a character comes in from the cellular module... if(cell.available() >0) { incoming_char=cell.read(); //Get the character from the cellular serial port. Serial.print(incoming_char); //Print the incoming character to the terminal. } //If a character is coming from the terminal to the Arduino... if(Serial.available() >0) { incoming_char=Serial.read(); //Get the character coming from the terminal cell.print(incoming_char); //Send the character to the cellular module. } }
</syntaxhighlight>
AT Command Tester Application
AT Command Tester is a free online tool test AT Commands and other modem functionalities of 2G modules (GPRS/EDGE) , 3G Modules (HSDPA/EVDO) and 4G Modules (LTE).AT Command Tester tool connects to the modem port of the device and can test various modem functions such as getting device information, gprs data call, voice call,http access, checking signal condition, network registration, SMS functions, SIM access, phonebook functions etc.
In the 'Port Configuration' section of the tool, users can search for available ports using the 'Find Ports' button. Then using the 'Connect' button, users can connect to the modem port of the device.
In the 'Command Mode' tab of AT Command Tester, single AT commands can be sent. The drop down list provides AT command description and examples. Users can modify the default command settings.
Under the 'Script Mode' tab, multiple AT commands can be sent at a time. Users can add descriptive comments and save the script on their local machine.
Data Call
To make a data call with the modem, you need to connect to the APN of the carrier network. The carrier APN and other required information are stored in the SIM card and are referred as PDP contexts. Typically multiple PDP contexts are stored in the SIM for different call types. With the AT Command Tester you can edit/add/delete PDP contexts in a easy to use user interface.
Typical call setup sequence,
+CGDCONT: 1,"IP","epc.tmobile.com","0.0.0.0",0,0
+CGDCONT: 2,"IP","test5","0.0.0.0",0,0
+CGDCONT: 3,"IP","","0.0.0.0",0,0
OK
Checking registration status...
+CREG: 0,1
OK
The device is registered in home network.
Checking if device is already connected...
+CGACT: 1,0
+CGACT: 2,0
+CGACT: 3,0
OK
Attaching to network...
AT+CGATT=1
OK
Connecting...
OK
Connect Sucessful
SMS
The SMS tab of the 'AT Command Tester' tool provides the interfaces to send SMS messages. You can also list/view/delete SMS messages stored on the SIM.
General sequence for sending SMS message,
Checking registration status...
+CREG: 0,1
OK
The device is registered in home network.
AT+CMGS="858XXXXXXX"
> Test Message with AT Command Tester�
+CMGS: 19
OK
SMS Send successful
Network Selection - This tab allows the user to manually select available networks. Modems are typically set for automatic network selection. 'Find Networks' button will command the modem to scan for available networks.
AT+COPS command will initiate network scan in the modem,
Finding Networks. Please wait..
+COPS: (2,"T-Mobile","T-Mobile","310260"),(1,"AT&T","AT&T","310410"),,(0,1,4),(0,1,2)
OK
Networks found
Phonebook
With the 'Phone Book' tab, you can add/delete/read phone book entries stored on the SIM,
Getting phonebook entries..
+CPBR: 1,"*233",129,"Refill Now"
+CPBR: 2,"#999#",255,"Check Balance"
+CPBR: 3,"8878878878",129,"Test"
OK
FAQ
Please list your question here:
Support
If you have questions or other better design ideas, you can go to our forum to discuss or creat a ticket for your issue at linksprite support.
Resources
How to buy
See Also
Other related products and resources.
Licensing
This documentation is licensed under the Creative Commons Attribution-ShareAlike License 3.0 Source code and libraries are licensed under GPL/LGPL, see source code files for details.