[Solved] PX4 cannot open logger_topics.txt

Hello. I try to log some uORB topict to SD card. When I insert card to slot, and turn on, microSD checks with OK. PARAMS, DATAMAN and LOG-directory are created well. Also, I create etc/logging/logger_topics.txt file. But logger dont create any ULOG file. I discovered code and saw, that hardware even cannot open file: (inside this)
int ntopics = add_topics_from_file(PX4_STORAGEDIR "/etc/logging/logger_topics.txt");

And:
fp = fopen(fname, "r"); returns with error. Platform simply cannot open file and get needed topics. ULOG file dont created too. But PARAM, DATAMAN and LOG dir was created with OK
Any ideas??
Thanks

Usually you need to arm and disarm to create a log, unless you change this param to what you need:
https://dev.px4.io/en/advanced/parameter_reference.html#SDLOG_MODE

Thanks. LOG file created correctly, but main issue still not resolved. Program cannot found file

etc/logging/logger_topics.txt
Inside function int Logger::add_topics_from_file(const char *fname)
. fopen-function returns fail. ‘Cannot open file’
But this file exists. I also experimented with custom file in root directory. And… I also cannot open it. That is very strange

I suspect the path is wrong, can you output exactly what the path is and can you check in nsh> using ls if this path actually exists?

Yes. It seems that path is invalid. In User Guide i read that I need etc/logging/logger_topics.txt.
But with ls I see next
nsh> ls
/fs:
microsd/
nsh> cd microsd
nsh> ls
/fs/microsd:
DATAMAN
PARAMS
LOG/
ETC/
FTEST.TXT
nsh> cd etc
nsh> ls
/fs/microsd/etc:
LOGGING/
nsh> cd logging
nsh> ls
/fs/microsd/etc/logging:
LOGGER~1.TXT

As I understood, driver get path default in fs/microsd - path. But in /fs/microsd/etc/logging: I suddenly see LOGGER~1.TXT (not logger_topics.txt, that I created on SD).
Is it right?

Can you try to rename that file? And is your SD card correctly FAT32 formatted?

Thanks! I changed
add_topics_from_file(PX4_STORAGEDIR "/etc/logging/logger_topics.txt");
to
add_topics_from_file(PX4_STORAGEDIR "/etc/logging/logger~1.txt");
and now it works fine.
But it’s strange, as guide says to create logger_topics.txt. I cannot suggest why this file looks with another name (logger~1.txt instead logger_topics.txt)

It would work on an a decent operating system which does not truncate filenames like this :smile:.

Thanks for sharing, glad you got it to work.