Intermittent logging failures

I’m using the Durandal on beta and the log file doesn’t always work. Sometimes it doesn’t show up at all, sometimes the file shows up but is 0 bytes, and other times it actually works. It doesn’t appear to be the SD card, because I’ve had this problem on multiple SD cards and the pixhawk4 running stable doesn’t seem have this issue on the same card. The only hint I have of what’s going on is that when I run the “sd_bench -r 50” test, it tells me there is a write error, but it does this when it is working too.

What should I try?

I’m going to ping @bkueng here.

Yes there were issues with the SD card. They should be resolved with https://github.com/PX4/Firmware/pull/14592.
Can you try with latest master and check if you still have issues?

It’s always tough to tell with intermittent problems, but it works so far. I’ll post again if it stops. Thanks!

Unfortunately, it did not stay working.

I did a bit more testing to see if I could nail down the failure pattern a bit. Here’s what I found.

  1. Logging seems to consistently work iff sd_bench works
  2. When sd_bench fails, it first fails with a write error, and subsequent attempts return a failure to read the benchmark file. When inspecting the sd card with a pc afterwards, there is a benchmark.tmp file on it.
  3. Rebooting sometimes fixes it and sometimes breaks it, but a repeating tests back to back tend to give the same results until it is rebooted. However, this doesn’t seem to hold over longer time periods, and/or actual flights, and “restart until it works, then fly” still yielded no log at the end of the flight.

@david_s5 fyi, can you have a look?

I have the same issue here: Logging on SD card error

Some things that I noticed:

  • After every boot, there is a new sessxxx folder, with a 0 byte log file, just as @Jimmy_Hynes mentioned. These files are dated to be created on 1st January 2000. The correct log files and folders are dated correctly.
  • When logging and sd_bench is not working, I went to fs/microsd folder in the nsh shell, and tried to list its content with ls, but it showed nothing. (So the new folders and files are just visible on the computer. Also, mkdir failed, but I think it is basically the same problem as the original error.)

Hi, I am having the same issues on Durandal. I am also experiencing issues in communication via the Telem ports. Has anyone had a similar behaviour?

Hi, I am having the same issue, did you find a solution?