Go Down

Topic: SD Card Issues after Sigfox (Read 1 time) previous topic - next topic

rrunner88

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):

Code: [Select]
   

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!

stefanocazzella

Hi rrunner88,

probably you have the same problem described here

Quote
When Serial connection is made via MKRFOX1200's USB port, LowPower library messes up with USB and Serial USB therefore SIGFOXCLASS:send will never return and your code will get stuck at Sigfox.endPacket().
I hope it may help you

Stefano

josef.baier@eydolon.com

Hi rrunner88,

I face the same problem. As soon as I start the Sigfox module the sd-card cannot be handled any more. In my case the sd-card stops working as soon as I start the Sigfox-module once - independent of the fact if I sent messages or not.
Did you already find a solution?

br

Go Up