OpenLog icon indicating copy to clipboard operation
OpenLog copied to clipboard

impossible continuous log

Open jorgemarmo opened this issue 4 years ago • 0 comments

Subject of the issue

I cannot get continuous log with openlog. I get a bunch of small log files. more details bellow. I've seen this is kind of a common problem... but I have not being able to get a solution #183

Your workbench

  • What platform are you using? I'm using a nano as the door controller of a chicken coop, and I need to log some information. I read and send via serial (using std arduino libraries) every 500ms (2 per sec). At the beginning I had every 250ms without the delay after very "print" and same behaviour the file contents were also similar, then I tried with 250ms and the added delays... here bellow some lines of my code, full code is available upon request (and promise that you won't make fun of it)

[edit2] The "nano" I'm using is a chinese clone with the CH340 chip... Might this be related? in the "code" here bellow, all the "*" are making italic... [edit2 end]

......
const unsigned long plotinterval=500UL;
......
Serial.begin(9600);
....... 
if ( (monit) && (millis() - previousMillis > plotinterval) )
	{
    previousMillis=millis();
 Serial.print(lumiere);  delay(15); Serial.print(F(", ")); delay(15);
    Serial.print(lim);      delay(15); Serial.print(F(", ")); delay(15);
    Serial.print(digitalRead(pin_ferme)*110); delay(15); Serial.print(F(", ")); delay(15);
    Serial.print(digitalRead(pin_ouvert)*120);  delay(15); Serial.print(F(", ")); delay(15);
    Serial.print(etat*130); delay(15); Serial.print(F(", ")); delay(15);
    Serial.print(etatporte*140); delay(15); Serial.print(F(", ")); delay(15);
    Serial.print(readVcc()/10); delay(15); Serial.print(F("\n"));
//readVcc is a function that returns long; all the others are int
  • What version of the device are you using? Is there a firmware version? I just burned Openlog (std version) I had to put “Arduino Pro or Pro Mini 5V/16MHz w/ ATmega328” "Arduino UNO" didn't worked. from CoolTerm
12<~>?OpenLog v4.2
Basic commands:
new <file>..: Creates <file>
append <file>..: Appends text to end of <file>
md <directory>..: Creates a <directory>
ls...: Shows the content of the current directory..
read <file> <start> <length> <type>: Outputs <length> bytes of <file> to the terminal starting at <start>. Omit <start> and <length> to read whole file. <type> 1 prints in ASCII, 2 in HEX.
size <file>..: Write size of <file> to terminal
disk...: Shows card information
reset...: Causes unit to reset, uses parameters in config file
set...: Menu to configure system mode
baud...: Menu to configure baud rate
  • How is the device wired to your platform? right now no sensors are connected, everything is on a breadboard with jumper cables I've plugged Tx, Vcc, Gnd and Tx, Vcc, Gnd-BLK same result.

  • How is everything being powered? for the moment via USB and the openlog powered by the Vin pin of the nano

  • Are there any additional details that may help us help you? no that I can think of... ah!, I've tried this with: 16Gb SanDisk class 10 A1... the same but in 32Gb, and a class10 samsung 32Gb (sorry I have not other cards) all formatted on Win10 as fat32 (volume name "SD") I don't know if this is normal, but both LEDs blink, I don't know if the STATUS2 led is supposed to blink... but I get something like 5 STATUS1 blinks, and 1 STATUS2 blink... kind of like every time STATUS1 blinks it creates a new logfile?

[edit 1]

  • I forgot to say what was "for me" the LED names, I just followed https://learn.sparkfun.com/tutorials/openlog-hookup-guide
  • I compiled this version, (the one I'm using) following this https://github.com/sparkfun/OpenLog/wiki/Flashing-Firmware but for the SdFat library I had to use not the current BETA version https://github.com/greiman/SdFat-beta , nor the version 2 release https://github.com/greiman/SdFat but the old 1.1.4 release https://github.com/greiman/SdFat/releases/tag/1.1.4 which seems the last rom the v1 with the newer versions I got a compiler error no matching function for call to 'SdFat32::chdir(const char [2], bool)' And googling it I found I had to use SdFat v1 https://github.com/greiman/SdFat/issues/222

[edit 1 end]

Steps to reproduce

Tell us how to reproduce this issue. Please post stripped down example code demonstrating your issue to a gist. done

Expected behavior

a single log file per "startup" with a bunch of data in it

Actual behavior

I get many log files, not bigger than 1k with about 4 lines on each, some drops at the begging and the end of the file. example of what I get on the SDcard SDcontentExmpl.zip

jorgemarmo avatar Feb 03 '21 17:02 jorgemarmo