AT Command

Description

AT+CFSWFILE command is used to write data in to a file in the Simcom modules.


Support

Simcom Module Tutorial

Examples

KeywordsAT+CFSWFILE syntax, examples, parameters, error, input, response.

Try the below script in the AT Command Tester tool

//Script: at+cfswfile
//The AT commands in this script are applicable for Simcom modules only
//Check SIMCOM Module AT Command documentaiton

//Get the support for the commands
AT+CFSWFILE=?

//Wait
WAIT=1

//Allocate the data buffer
AT+CFSINIT

//Write to a file
//1st parameter - index > 0 -/custapp/ 1-/fota/ 2-/datatx/ 3 -/customer/
//2nd parameter - FILE NAME
//3RD parameter - Mode 0 -> overwrite 1->append
//4th parameter - File size
//5th parameter - input time
//6th parameter - len_filename
AT+CFSWFILE=0,"myfile.txt",0,12,10000

//Write data for the FILE, length should match file size paramter above
my file data

//Wait
WAIT=2

//Write to the end of the FILE
AT+CFSWFILE=0,"myfile.txt",1,10,10000

//Write data for the FILE, length should match file size paramter above
add at end

//Wait
WAIT=2

//Get the txt file size
AT+CFSGFIS=0,"myfile.txt"

Output of the above script in the AT Command Tester tool

AT+CFSWFILE=?

+CFSWFILE: (0-3),50,(0-1),(1-10240),(100-10000)

OK
AT+CFSINIT

OK
AT+CFSWFILE=0,"myfile.txt",0,12,10000

DOWNLOAD

OK
AT+CFSWFILE=0,"myfile.txt",1,10,10000

DOWNLOAD

OK
AT+CFSGFIS=0,"myfile.txt"

+CFSGFIS: 22

OK