Userware/Stdout FILE in TC65i | Telit Cinterion IoT Developer Community
December 2, 2015 - 11:19am, 2340 views
I want to do a log to a File in my TC65i module.
I used the following AT Command to do it:
AT^SCFG="Userware/Stdout","FILE",65535,"a:/LOG.TXT","secure".Also I tried buffered argument instead of secure.
The module writes to log.txt.0 and log.txt.1 files correctly, but I have a problem, if the module shuts down or resets by a power supply problem, these files are truncated and they are empty.
My intentions are configure the module with AT^SCFG="Userware/Stdout","USB" before execute "System.out.print" when java program starts again, I would like to have log.txt.0 and log.txt.1 with all the before restart information but both files are truncated.
Is possible to do it? or otherwise the module cant do it. I dont know if i have to configure something more.
Thanks in advance.
The system writes to two files alternately. When the power is cut off some of the data may be truncated.
Buffered mode should be faster but more data can be lost in case of hard reset. Secure mode should be safer but slower.
Are the both files empty in your case? At least one should rather not be. Does it happen each time?
When the module starts again you are unable to restore the system out data that have not been saved to files.
Redirecting to USB will only cause the new data to be printed to USB.
Thanks for you response.
Yes,all the ***** the files are truncated when the module starts again.
I did a test, if I access into the module's flash memory (with MES) before the module starts again both files have data. When the java program starts again the module truncates both files, and I dont know why.
The only way to keep both files with data is execute AT^SCFG="Userware/Stdout","USB" before module restarts (obviously this is imposible if the power supply is cut off). I realized that if the module starts configured as "Userware/Stdout","FILE", it truncates them. has it any sense?
Miguel A. Vázquez
So if I understand you well the files are not truncated when the module starts but when the application starts.
In that case the files would also be cleared after the normal application shutdown and restart.
So I think that we should consider this as normal and intended behaviour.
I you hadn't copied the files because the module was in the field they would have been overwritten anyway after the application restart when the power is back for example.
For this module there is a little program provided that is installed with other software and is able to switch off the autostart easily. I think that this would be helpful here to copy the log files before the application starts.
Do you have some special use case for this file logging?
As this module is not developed any more this behaviour is probably also not going to be changed.
I dont have any special use case for this file logging.
I know the software to swith off the autostart. I will try it.