Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenLog only functions after arduino reset #236

Open
Rob-Fox opened this issue Aug 23, 2020 · 0 comments
Open

OpenLog only functions after arduino reset #236

Rob-Fox opened this issue Aug 23, 2020 · 0 comments

Comments

@Rob-Fox
Copy link

Rob-Fox commented Aug 23, 2020

I have a SparkFun OpenLog that I am trying to use to log data. The OpenLog's config is: 57600,36,3,2,1,1,0. Starting in command mode it should immediately accept my command to: OpenLog.print("append ");OpenLog.print(date);OpenLog.println(".csv\r"); but this only functions if the Arduino board has been powered on and then had the reset button pressed. If the reset button is not pressed then no file is created.

I am using a Sainsmart Nano V3.0 (arduino nano with ATmega328p old bootloader).
The device is powered, I am using a library called AltSoftSerial which means the OpenLog TX is connected to arduino pin 8 and RX is connected to arduino pin 9.

OpenLog reports: OpenLog v4.2

Currently the OpenLog is being powered via the Arduino board which is receiving power from its Mini-usb cable.

#include <AltSoftSerial.h>

AltSoftSerial OpenLog;

unsigned long date = 16082020;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(57600);
  OpenLog.begin(57600);
  OpenLog.print("append ");OpenLog.print(date);OpenLog.println(".csv\r");
}
int count = 0;
void loop() {
  Serial.println("Hello");
  if(count < 10){
    Serial.println(count);
    OpenLog.print("This Text goes into the log");OpenLog.print(count);OpenLog.print("\r");
    count++;
  }
  delay(1000);
}

All I have to do is run this code to get the issue. On cold-boot it does nothing, but after reset (from built in reset button) code behaves as expected the first time, The second time the words "append" the unsigned long "date" and ".csv" are written into the logfile rather than being used as a file name (which suggests to me that the soft reset performed by using the hardware button does not remove power from the OpenLog).

Expected Behavior:
On cold boot a log file is made that is named "date".csv (or if it already exists it continues to be appended to). 10 lines are written to this file, containing "This Text goes into the log#".

Actual Behavior:
No log file is created, as such no text is written. If log file already exists, no text is written.

@Rob-Fox Rob-Fox changed the title OpenLog only functions after arduino restart OpenLog only functions after arduino reset Aug 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant