Thanks for posting the code up - I don't see anything that could cause an issue in there at all, it looks really neat.
Only thing I'd say is I guess it's for testing, but:
//Record sensor data and dump in file when buffer exceeds 96 entries for 24/hr
function fillLog() {
// ...
if (Object.keys(currentLog).length < 5) {
Unless I am misunderstanding, it's writing every time there are 5 log entries, and it's being called every 2 seconds so it'll be writing a new log file every 10 seconds...
It's basically behaving like I'm pressing the button during startup while I'm not doing that and it's out of the case
Let me know how you get on, but is it possible that you were just accidentally pressing the button? It's actually really easy to do - I've done it plenty of times and I know others have too.
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.
Thanks for posting the code up - I don't see anything that could cause an issue in there at all, it looks really neat.
Only thing I'd say is I guess it's for testing, but:
Unless I am misunderstanding, it's writing every time there are 5 log entries, and it's being called every 2 seconds so it'll be writing a new log file every 10 seconds...
Let me know how you get on, but is it possible that you were just accidentally pressing the button? It's actually really easy to do - I've done it plenty of times and I know others have too.