StorageFiles are not well suited for writing binary data, \xFF is used to detect the end of those and can not be used inside them. Flash is dangerous to use and you could easily overwrite your bootloader or destroy the file system created by the Storage module.
I think you would be best off with using Storage.write/read with allocating a whole day/week at once and use offsets for writing data points. For reading you can either use Storage.read which returns memory-mapped strings which is light in RAM use or if your data is actually binary encoded and not easily parsed as string use Storage.readArrayBuffer which can be wrapped into one of the array types and used for easier parsing.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
StorageFiles are not well suited for writing binary data,
\xFF
is used to detect the end of those and can not be used inside them.Flash
is dangerous to use and you could easily overwrite your bootloader or destroy the file system created by theStorage
module.I think you would be best off with using
Storage.write
/read
with allocating a whole day/week at once and use offsets for writing data points. For reading you can either useStorage.read
which returns memory-mapped strings which is light in RAM use or if your data is actually binary encoded and not easily parsed as string useStorage.readArrayBuffer
which can be wrapped into one of the array types and used for easier parsing.