I am working on a project using pro mini 8MHz/3.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.
My board is Arduino Pro Mini (ATMega 328) 8MHz/3.3 V datasheet (DEV-11114) and Modem is home-made board with SIM7100 module, already test board and module work with all functions without any problem. I’ve added a schematic of the board to the question.
Here is SD Module, Pro Mini and SIM7100 pin layout
c:\data2.txt is: A1 to F0
A1A2A3A4A5A6A7A8A9A0B1B2B3B4B5B6B7B8B9B0C1C2C3C4C5C6C7C8C9C0D1D2D3D4D5D6D7D8D9D0E1E2E3E4E5E6E7E8E9E0F1F2F3F4F5F6F7F8F9F0
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>
SoftwareSerial simSerial(7, 6);
File myFile;
void setup() {
Serial.begin(9600);
while (!Serial) {
;
}
simSerial.begin(9600);
Serial.print("\nInitializing SD card...");
if (!SD.begin(10)) {
Serial.println("\nInitialization failed!");
while (1);
}
Serial.println("\nInitialization done.");
delay(8000); //For booting SIM7100
if (SD.exists("1.TXT")) SD.remove("1.TXT");
myFile = SD.open("1.txt", FILE_WRITE);
if (myFile) {
simSerial.println("AT+CFTRANTX=\"c:/data.txt\"");
while (simSerial.available() > 0) {
byte voc = simSerial.read();
myFile.write(voc);
}
myFile.close();
// Serial.println("\nClose done.");
} else {
// Serial.println("Error opening 1.txt");
}
// re-open the file for reading:
myFile = SD.open("1.txt");
if (myFile) {
Serial.println("1.txt:");
while (myFile.available()) {
Serial.print(myFile.read());
}
myFile.close();
Serial.println("\nReading SD Card done.");
} else {
Serial.println("Error opening 1.txt");
}
}
void loop() {
}
Here is test sketch for software & hardware serial.
SoftwareSerial mySerial(7,6); // RX, TX
void setup()
{
Serial.begin(9600);
while (!Serial) {
;
}
Serial.println("Hardware Serial port!");
mySerial.begin(9600);
mySerial.println("AT+CFTRANTX=\"c:/data.txt\"");
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}