Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users

    Recently Saved Module Script Lost If Hub Loses Power

    Flic Hub SDK
    2
    2
    40
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • pico
      pico last edited by

      I've got a Flic Hub LR on firmware 4.6.0. I've noticed if I reboot the hub within a couple minutes after saving a module file I've just edited that the file can be completely empty or incomplete after the reboot.

      But, if I reboot 10min or more after saving, the files are intact. I haven't noticed the same issue with a module's datastore.db contents which seem to stay intact even when edited shortly before the reboot.

      Is there some delay before a saved script file is flushed to storage?

      1 Reply Last reply Reply Quote 0
      • Emil
        Emil FlicTeam last edited by Emil

        With reboot, you mean abruptly unplug the power and insert it again?

        Yes, this is handled by the Linux kernel, which buffers writes for some time. By buffering writes, wear on the flash is reduced, which has a limited number of write / erase cycles.

        Using the data store module, data is safe however since fsync is used. A journal is also used for pending writes. We believe the data consistency of such data is important to be tolerant from power outages.

        1 Reply Last reply Reply Quote 0
        • First post
          Last post