Some of my notes in case useful:
I am running some preliminary tests on the V2 EVB for use in a datalogger which will FTP the data to a server.
I am using a 2.5A 9V PSU with the Arduino connected directly and the GSM board connected via an LM2596 based DC-DC converter set with its output at 4.8V. The negative side of the supply seems to run straight through this so the GSM ground is common to the Arduino Nano ground.
The GSM TX and RX are connected to two digital pins on the arduino, I am keping D0 and D1 free so using the SoftwareSerial library to communicate on two other pins.
I'm using a GiffGaff sim card (UK).
Initial testing is with a simple sketch that echoes anything received from the serial monitor in the IDE to the GSM card and vice versa:
#include <SoftwareSerial.h>
SoftwareSerial gsm(2,3); //receive pin from GSM, Transmit pin to GSM
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
gsm.begin(4800);
}
void loop() {
if(gsm.available())
{
Serial.println(gsm.readString());
}
if(Serial.available())
{
gsm.println(Serial.readString());
}
}
SMS successfully sent using by sending
AT+CMFG=1
then
AT+CMGS=...
command (complete this command with the phone number to receive the message in double quotes, a carriage return, the message text, then terminate with ASCII character 26 (note: I downloaded Serial Monitor Deluxe to send non-printing ascii(26) to terminate the message).
File list and file transmit over FTP successful using the following commands:
Prepare for FTP:
Set full functionality (this parameter can be read using AT+CFUN?)
AT+CFUN=1
Start GPRS service
AT+CGATT=1
Set GPRS as service type
AT+SAPBR=3,1,"CONTYPE","GPRS"
Set APN for GiffGaff
AT+SAPBR=3,1,"APN","giffgaff.com"
Set username for GiffGaff
AT+SAPBR=3,1,"USER","giffgaff"
(note: Password parameter "PWD" is blank for GiffGaff so not set)
Start session (first argument) using profile number 1 (second argument)
AT+SAPBR=1,1
(To end session send AT+SAPBR=0,1)
Sets profile for FTP session to that set up above.
AT+FTPCID=1
FTP server IP address or domain name
AT+FTPSERV="web-ftp.ex.ac.uk"
Server username
AT+FTPUN="xxxxx"
Server password
AT+FTPPW="xxxxxx"
(Can also set ftpport (defaults to to 21), ftpmode (defaults to passive), ftptype (defaults to to binary ), ftpputopt (defaults to STOR , can be set to APPE for append) etc)
Read server file list:
Set server path
AT+FTPGETPATH="/services.exeter.ac.uk/utilities/test/"
Start FTP list session. Should get response +FTPLIST: 1,1. Other values of last parameter denote an error, e.g. 64 for timeout. Error codes as documented for PUT and GEP operations
AT+FTPLIST=1
Request the listing, last value is number of bytes to read. Modem responds AT+FTPLIST=2,n where n is the length of the data that will actually be returned (data may be shorter than requested length). If data followed by +FTPLIST: 1,1this indicates more data remains to transfer: send AT+FTPLIST=2,1460 again to request more data or AT+FTPLIST=1,0 to quit retrieving further data.
AT+FTPLIST=2,1460
Transmit file
Set destimation path, note trailing / or everything after last / is added to start of filename
AT+FTPPUTPATH="/services.exeter.ac.uk/utilities/test/"
Destination file, if ftpputopt set to STOR file must not exist
AT+FTPPUTNAME="MODLOG.CFG"
Extended put mode off, Only set if changing from 1, 0 should be default setting , can be checked with AT+FTPEXTPUT?
AT+FTPEXTPUT=0
Start file writing operation. Will return +FTPPUT:1,1,1360 if writing is possible Last parameter is maximum length of data that can be written at one time (in bytes). Response +FTPPUT:1,n is an error response (n=61 to 86, e.g. 64 Timeout, 66 not allowed (e.g. if FTPEXTPUT=1), 77 Operate error (e.g. destination file already exists).
AT+FTPPUT=1
Write data, second parameter is length of data to write. Then send that many bytes of data. To send more data, repeat. To exit dat awrite mode, send AT+FTPPUT=2,0. Response +FTPPUT:1,0 indicates data transfer complete.
AT+FTPPUT=2,1360
Other Commands:
AT+FTPSTATE
Returns whether a PUT, GET, DELE, SIZE etc session is ongoing, returns +FTPSTATE:1 if a session ongoing or +FTPSTATE:0 if idle.
To read a file from the server, Use FTPSIZE to find out size of a file, then FTPGET to read it in a similar manner to FTPPUT.
Resetting the GSM:
Could be useful if you get stuck in a read or write operation, or to reset to a known state. Connect the GSM RST pin to an output on the Arduino. Set this pin High. Set the pin low for 100ms to reset the GSM.
Indicator lights:
Ring LED normally lit when power applied to board, off when incoming call detected, flashes if input voltage too low and board will reset.
Net LED flashes fast when searching for a network, flashes slow when registered to network.
VDD Pin: Sets the logic level for the Tx and Rx pins. If 5V logic (e.g. Arduino Nano) this can be left disconnected.