Description
This is a loose idea for now, but I will dump what we have so far, so it can be further discussed.
The crux is to have either a pseudo-file, or a whole fake filesystem on the CircuitPython's USB MSC disk, to make available dynamically-generated status information from the running CircuitPython.
It would replace the boot_out.txt
file, but because it's not physically written to the flash and does not wear the flash storage or consume extra space on the device, it could contain a variety of additional information, such as the last exception traceback, the current IP address of the device, a URL for the web interface, even things like the contents of the NVRAM or amount of free memory.
Personally, I'm particularly interested in putting the exception traceback in it, because that would greatly ease the support and debugging, without having to teach people how to use the serial console. We could simply ask them to upload the file, and we would have all the information we need for debugging: the exact version and the exception.
There are several ways we could go about implementing it. With the pseudo-file approach, we could have a file created, that points to some non-existent or reserved blocks for its content, and then have a special case for retrieving the contents of those blocks, generating them dynamically instead of reading them from the flash. With the filesystem approach, we could have a second partition in the partition table, and a whole fake filesystem, possibly with different files containing different pieces of information. In either case, the data would be read-only and dynamically generated.
Editors like Mu or Thonny, and plugins for IDEs could also check those files for status, errors and such.