Lua Storage.set()/storage.get() functions

Discussion in 'C-Bus Automation Controllers' started by Pie Boy, Jul 8, 2019.

  1. Pie Boy

    Pie Boy

    Joined:
    Nov 21, 2012
    Messages:
    249
    Likes Received:
    31
    Location:
    New Zealand
    Hi all,

    dose any one know what the limitations of the storage.set() / storage.get() functions are?

    There doesn’t seem to be any documentation on this

    Im trying to work out how much I can use before I break it... what is it’s capacity and where dose it actually store its information and how many times can this be stored/written

    And what happens on power fail/ reboot are these values kept or lost?
     
    Pie Boy, Jul 8, 2019
    #1
    Chris Peck likes this.
  2. Pie Boy

    Chris Peck

    Joined:
    Jun 1, 2018
    Messages:
    7
    Likes Received:
    0
    Same here. Are there better ways to transfer large amounts of data between modules? I’m worried about the read/write lifetime of the card.
     
    Chris Peck, Feb 9, 2020
    #2
  3. Pie Boy

    tassiebean

    Joined:
    Dec 24, 2018
    Messages:
    30
    Likes Received:
    6
    If it's only a little bit of data, I reckon it's best to use UserParameters. But, to your question... I understand that these storage functions keep the data in memory and it is only flushed to the SD card every 30 minutes (along with other housekeeping data). It is stored in redis.rdb, which you might be interested to know, gets backed up when you do a system backup.

    If the data you want to share actually never changes (i.e. is a dataset you simply want to be available to any script that wants it), it is best to create a Lua table in the User Library, which will need to be referenced at the start of any script that needs it, with the 'require' statement. But this is only helpful for an unchanging dataset.
     
    tassiebean, Feb 16, 2020
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.