I am working on a project using pro mini 3v and SIM7100, I want to know how can I used AT+CFTRANTX command. I am try to read file from EFS and write to SD card via Serial port. I have get some data in SD but is junk.
c:\data.txt is 1 to 100
12345678901112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
Any help would be appropriated.
The code that I am using, I tried it with every possible baud rate:
#include <SPI.h>
#include <SD.h>
#include <SoftwareSerial.h>
#define SD_ChipSelectPin 10
SoftwareSerial sdSerial(0, 1); // RX, TX
File reciveFile;
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
sdSerial.begin(9600);
SD.begin(SD_ChipSelectPin);
if (!SD.begin(SD_ChipSelectPin)) {
return;
}
delay(10000);
Serial.flush(); // Flush buffer
if (SD.exists(“1.TXT”)) SD.remove(“1.TXT”);
reciveFile = SD.open(“1.TXT”, FILE_WRITE);
if (reciveFile) {
Serial.println(“AT+CFTRANTX=“c:/data.txt”\r”);
int8_t i = 0;
while (sdSerial.available() > 0) {
char recFile = sdSerial.read();
if (i >= 0) reciveFile.print(recFile);
i++;
}
reciveFile.close();
} else {
Serial.println(“Error create file”);
}
}
void loop()
{
}