Hi,
I can't write a string to sd card, after I've send something via sigfox.
I'm using the Standard SD.h from arduino and the standard Sigfox.h libs.
This is my code (shorted):
void loop() {
// init sd
if (!SD.begin(sd_cs_pin)) {
if(debug)
Serial.println("[main::setup()] [Error] initializing SD Card.");
return;
} else {
if(debug)
Serial.println("[main::setup()] [Success] SD successfully initialized.");
}
// write string
File dataFile = SD.open("daten.txt", FILE_WRITE);
dataFile.println("some useful string");
dataFile.close();
// send sigfox message
SigFox.begin();
delay(100);
msg.battery = battery;
// Clears all pending interrupts
SigFox.status();
delay(1);
SigFox.beginPacket();
SigFox.write((uint8_t*)&msg, 12);
int status = SigFox.endPacket();
// go to standby
LowPower.sleep(15 * 60 * 1000);
}
This code works perfectly only once. After the MCU wakes up, it prints no string to the SD but sending of Sigfox message is successful. What am I doing Wrong? Owns Sigfox after Init the SPI exclusively?
Chip-Select Pin of the SD is D5.
One more question: How is the code executed after waking up from standby? does the void loop() continue? Or starts the whole program at the setup() like after reset? The strange thing is, after reseting manually, the writing to the SD works again, but only until it goes to standby.
Please help me, I'm working on this several hours.
Many Thanks!