Hallo
Ziel:
Das SIM7600 soll auf der SD Karte eine MP3 Datei laden um diese dann in einem Anruf ab zu spielen.
Problem:
Laut dem [Dokument](https://simcom.ee/documents/SIM7600E/SIM7500_SIM7600 Series_AT Command Manual _V1.10.pdf) (seite 256) ist die SD Karte, mit der Bezeichnung "D:" zu finden. Ein wechsel dahin gelingt aber nicht :
AT+FSCD=D:
ERROR
#include <SD.h>
//#include <M5Stack.h>
#include <M5Core2.h>
#define TINY_GSM_MODEM_SIM7600
#define SerialMon Serial
#define SerialAT Serial2
#define TINY_GSM_DEBUG SerialMon
#define GSM_PIN ""
#include <TinyGsmClient.h>
#define GSM_AUTOBAUD_MIN 115200
#define GSM_AUTOBAUD_MAX 115200
#if TINY_GSM_TEST_GPRS && not defined TINY_GSM_MODEM_HAS_GPRS
#undef TINY_GSM_TEST_GPRS
#undef TINY_GSM_TEST_WIFI
#define TINY_GSM_TEST_GPRS false
#define TINY_GSM_TEST_WIFI true
#endif
#if TINY_GSM_TEST_WIFI && not defined TINY_GSM_MODEM_HAS_WIFI
#undef TINY_GSM_USE_GPRS
#undef TINY_GSM_USE_WIFI
#define TINY_GSM_USE_GPRS true
#define TINY_GSM_USE_WIFI false
#endif
#define DUMP_AT_COMMANDS
#ifdef DUMP_AT_COMMANDS
#include <StreamDebugger.h>
StreamDebugger debugger(SerialAT, SerialMon);
TinyGsm modem(debugger);
#else
TinyGsm modem(SerialAT);
#endif
const int chipSelect = 4;
void init_sd(){
//SD Card ini
M5.Lcd.println(F("Initializing SD card..."));
//SPI();
if (!SD.begin(chipSelect))
{
M5.Lcd.fillScreen(RED);
M5.Lcd.println(F(">>>>SD card ERROR"));
M5.Lcd.println(F("Programm STOP!"));
while (true);
}
File root = SD.open("/");
if (!root || !root.isDirectory())
{
M5.Lcd.fillScreen(RED);
M5.Lcd.println(F("Failed to open directory"));
M5.Lcd.println(F("Programm STOP!"));
while (true)
;
}
root.close();
M5.Lcd.println(F("DONE"));
}
// debug zweck
#define MY_LTE
#define MY_SD
////////////////////////////////////////////////////////////////
void setup()
{
M5.begin();
M5.Lcd.fillScreen(WHITE);
SerialMon.println("tester");
M5.Lcd.setCursor(0, 10);
M5.Lcd.setTextColor(BLACK);
M5.Lcd.setTextSize(2);
#ifdef MY_SD
init_sd();
#endif
#ifdef MY_LTE
SerialMon.println("Init Modem");
pinMode(5, OUTPUT);
digitalWrite(5, HIGH);
delay(5000);
digitalWrite(5, LOW);
delay(1300);
digitalWrite(5, HIGH);
delay(6000);
TinyGsmAutoBaud(SerialAT, GSM_AUTOBAUD_MIN, GSM_AUTOBAUD_MAX);
//M5.Lcd.println(F("Initializing modem..."));
if (!modem.restart())
{
M5.Lcd.fillScreen(RED);
SerialMon.println(F("Failed to Start Modem"));
SerialMon.println(F("Programm STOP!"));
while(true);
}
SerialMon.println("Done!");
//LTE init ende
#endif
}
void loop()
{
M5.update();
if(M5.BtnA.wasReleased()){
SerialMon.println(">>>>>>>>A<<<<<<<<");
modem.sendAT("\r\n");
modem.waitResponse();
SerialMon.println("---------------------------------");
}
if(M5.BtnB.wasReleased()){
SerialMon.println(">>>>>>>>B<<<<<<<<");
bool res = false;
//SerialMon.println(modem.getSignalQuality());
modem.sendAT("+FSCD=F:\r\n");
modem.waitResponse();
sleep(2);
modem.sendAT(F("+FSLS=0\r\n"));
int a = modem.waitResponse();
SerialMon.println(a);
SerialMon.println("---------------------------------");
sleep(2);
modem.sendAT("+FSCD=B:\r\n");
modem.waitResponse();
sleep(2);
modem.sendAT(F("+FSLS=0\r\n"));
a = modem.waitResponse();
SerialMon.println(a);
SerialMon.println("---------------------------------");
sleep(2);
modem.sendAT("+FSCD=C:\r\n");
modem.waitResponse();
sleep(2);
modem.sendAT(F("+FSLS=0\r\n"));
a = modem.waitResponse();
SerialMon.println(a);
SerialMon.println("---------------------------------");
sleep(2);
modem.sendAT("+FSCD=D:\r\n");
modem.waitResponse();
sleep(2);
modem.sendAT(F("+FSLS=0\r\n"));
a = modem.waitResponse();
SerialMon.println(a);
SerialMon.println("---------------------------------");
}
if(M5.BtnC.wasReleased()){
SerialMon.println(">>>>>>>>C<<<<<<<<");
//at+ccmxplay="E:/ring.mp3",0,255
modem.sendAT(F("+FSLS=0\r\n"));
int a = modem.waitResponse();
SerialMon.println(a);
}
}
Die Kommunikation mit dem SIM Moudl funktioniert.
Weis jemand wie das SIM7600 Modul zugriff auf die SD Karte bekommen kann?