What you're doing with storage.erase + .compact sounds fine to me. What errors are you getting?
I guess one issue is that compaction will take some time so might make you lose Bluetooth packets again - however I feel like you probably don't need to do except when you reset it/go to start recording. Normally I imagine you'll just be adding data.
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.
What you're doing with
storage.erase
+.compact
sounds fine to me. What errors are you getting?I guess one issue is that compaction will take some time so might make you lose Bluetooth packets again - however I feel like you probably don't need to do except when you reset it/go to start recording. Normally I imagine you'll just be adding data.