OpenLog Questions

I'm trying to log data to OpenLog (SparkFun OpenLog - DEV-13712 - SparkFun Electronics). I can get the data going to the device, and it logs to the default file(s). But I need to change the filenames.

The docs say to send a Ctrl-Z (ASCII 26), and then the command "new myfile.txt". But it doesn't say if anything is needed to put it back into logging mode with that file. I tried the following commands:

    logger.print(0x1A,BYTE);
    logger.print("new "); logger.println("myfile.txt");

Once that is hit, all logging stops. Soooo, I've obviously done something wrong. (btw, the "logger" variable has been set up via NewSoftSerial. Things work fine until I try to set the filename...)

Any thoughts/tips? Thanks.

Solved this.

You need to send the CTRL-Z, followed by the "new myfile" command, and THEN follow up with the "append myfile" command. But even then that will not quite work directly. You have to add some delay for the commands to process. I don't know where the magic number is for the delay yet, but I'm currently using 200 ms with success.

I've blogged about this to hopefully help others out. Details at http://grover.open2space.com/node/278