Core Electronics Forum

OpenLog help - escaping Command Mode, other

First time user of the OpenLog, brilliant concept but I’m having problems getting my head around the basic Command structure. End use will be logging serial traffic in bursts of 15 bytes every minute generated by a PIC acquiring the data and I’d like to start a new directory each day and navigate accordingly all under control of the remote PIC.

For initial testing I’m using a terminal on the PC direct to the OL via a USB to TTL (3v3 Tx, Rx) adapter and have no trouble seeing any typed characters appear in the Log*.txt files, also have no problem accessing Command Mode and identifying the various results. The problem I have is how to escape CM on the fly and return to normal logging after changing to a newly made directory such that further logs appear in that directory?

If I issue a reset from CM the OL effectively reboots and continues to log in the root.

I’m thinking there’s something basic I’m missing but all the docs I’ve read don’t touch on it. Any help appreciated.

Bill in Perth

1 Like

I just had a skim through the code

Try x it seems to be an exit command, but it might only be exit from a sub menu.

It seems all the commands are identified with the PSTR() function. I couldn’t see anything that actually exits out of command mode, but in principle you should be able to add a small function that breaks out of command mode and jumps back to new log mode. However, I think they intend you to just restart it, as it loads all the appropriate configurations on startup by reading config.txt into eeprom I believe.

You can trigger a restart with the reset command.

1 Like

Hi Oliver,

Thanks for the effort, still nothing from the Forum - makes me wonder how many users of OpenLog are out there and even then how many actually use sub directories…

The ‘x’ does escape but, as you mentioned, it is from a sub menu (the Set command menu). I’m using V4.2 OL firmware.

I reiterate my confusion there is quite a bit about making, changing to and removing directories on the Wiki but nothing on how to log to a sub - what’s the point of having subs if you cannot log to them? My guess is you CD under command mode, exit (how?) thereafter logging resumes in that directory.

I have my doubts about the documentation as well. Some of the links were met with a 404 message and other information mentions only 2 subs are allowed with more requiring a code change and firmware reflashing via my pet hate Arduino’s. Yesterday, using a PIC with adequate pauses between commands to be sure, I managed to write 45 subs after which the generated directory names became corrupted. Also inspection of the written SD card shows filenames as I named them, lowercase and all.

It’s not a big deal if I can’t log to specific dirs, I can achieve a new daily filename by jumping into command mode at midnight and issuing a ‘reset’ which then reverts the OL back to default logging with a new file. This way 1 minute data will occupy each log file with 1440*15 byte entries. Yes it does get me out of Command Mode but at the expense of a new file and still in the root.

Still, it would be nice to put the problem to bed…

Bill in Perth


Here’s a comment from 2013 - seems to align with my understanding of the code.

There’s only three ways out of command mode:

  1. Reset
  2. Send a write file command
  3. Send an append file command

Definitely shouldn’t be too difficult to modify the code to suit your purposes though.

Maybe also try the Sparkfun forums, or making an Issue on the Github repo - that way you’ll be able to get in touch directly with the guys that wrote the code.