Efficient data storage on Ruuvitag #7237
Replies: 1 comment
-
Posted at 2018-07-24 by @gfwilliams The issue is that Normal arrays let you do all that stuff, but then you pay for that flexibility with inefficient storage. So, the solution is either to keep an index in the array and move around (shown on that Data Collection page), or to actually move all elements of the array backwards each time, and shove your data onto the end.
Also, since you have an array of bytes you can't just push the object At that point, Posted at 2018-07-24 by Melonator Thanks a lot, that really helps! Posted at 2018-07-30 by Melonator On another slightly related track, Once I get values and store them to the RuuviTag, is there a way to move them to the internal storage of the raspberry pie? Or does the Espruino IDE have the capability to store data locally? Posted at 2018-07-31 by @gfwilliams There's nothing built-in. For simple things I'd write a function on the RuuviTag that outputs a tab or comma-separated list, and then you just copy&paste. You could write some code on the Pi that connected, executed that command, waited for the result and then disconnected if you wanted to do it automatically. If you have the Pi running all the time and within radio range, you can advertise the data and then use https://github.com/espruino/EspruinoHub - that'll now log any data that is received automatically. Posted at 2018-07-31 by Melonator Cool. Thanks for the suggestions! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2018-07-23 by Melonator
Hey, I'm not sure if this is the right place to ask but I'm having a problem combining two Espruino/JavaScript concepts on my RuuviTag sensor beacon and I was wondering if anyone here had any insight into the matter.
Basically, I'm trying to use a variation of the program on this web page: [https://lab.ruuvi.com/temp-logger/]
But I'm trying to modify it so that I can store a lot more values by lowering the precision and storing values that take up less space in the RuuviTag memory.
For that purpose I found this Espruino method which supposedly lets you store sensor reading as 8 bit integers instead of 32 or 64 bit floats: [https://www.espruino.com/Data+Collection]
Here is what I have right now:
When I upload and run this code it says this over and over:
And when I type the getData() command into the left side while the program is running I get this:
Am I missing something about the code? Or is it harder than I think it is to log values that take up less space in the memory? I don't see any reason why the unshift function would not be found. If unshift won't work for this type of operation, is there something else that will?
Beta Was this translation helpful? Give feedback.
All reactions