hi, I tried and worked perfect. but i would like to understand how as I need to make some changes on it, for instead be sure to flush the file when/before to reboot/deepsleep-.
Also I would like to name the file adding a _YYMMDDHHMMSS ending, or just pass a name as a additional parameter.
You may use all date and time variable (google strftime function ), just avoid slashes and backslashes, semicolon and other special symbols in file name.
Tony, 2022/08/04 10:10
Hey there,
Just for the people that are interested for creating separate log files for each time the device reboots / deepsleeps, I have made the following alteration that keeps the logfiles from being overwritten every reboot/deepsleep. Notice that this solution does not need any time keeping (and therefore an internet connection to synchronize time). I hope that it helps anyone facing debugging issues on long running devices where serial connections over longer periods do not make sense. Cheers.
Discussion
hi, I tried and worked perfect. but i would like to understand how as I need to make some changes on it, for instead be sure to flush the file when/before to reboot/deepsleep-.
Also I would like to name the file adding a _YYMMDDHHMMSS ending, or just pass a name as a additional parameter.
I was reading about io.IOBase for an ESP32 https://docs.micropython.org/en/latest/library/uos.html?highlight=iobase and at https://pydocs2cn.readthedocs.io/projects/pydocs2cn/en/latest/library/io.html.
any hint?
You may give filename custom name based on date via following name:
You may use all date and time variable (google strftime function ), just avoid slashes and backslashes, semicolon and other special symbols in file name.
Hey there,
Just for the people that are interested for creating separate log files for each time the device reboots / deepsleeps, I have made the following alteration that keeps the logfiles from being overwritten every reboot/deepsleep. Notice that this solution does not need any time keeping (and therefore an internet connection to synchronize time). I hope that it helps anyone facing debugging issues on long running devices where serial connections over longer periods do not make sense. Cheers.
https://pastebin.com/cFgnvYqi