Flic Home

    Community

    • Login
    • Search
    • Popular
    • Users

    Programming strategies vs Battery life

    Developers
    2
    3
    664
    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.
    • martinm
      martinm last edited by

      I'm using the python library to write a gateway between Flic buttons and some Yoctopuce products. It worked well so far, but I'm a bit worried about something: I added button battery monitoring and noticed that batteries level is dropping quite fast, at this rate, batteries won't last more than a few weeks.

      So my question is: are there some programming strategies that will suck less energy than others? I found some mentions of active and passive modes, but there is no reference to such modes in the python API.

      1 Reply Last reply Reply Quote 0
      • martinm
        martinm last edited by

        Ok, I assume that channel.auto_disconnect_time unit is seconds.

        But I think that I eventually found out what was draining the batteries, in the python scan wizard exemple in the is_private case, the scanner is never removed. I suspect this forces all the buttons to stay active if no-one press on the foreign button for 7 sec. Since I fixed that with a timeout, batteries are felling much better 🙂

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

          Passive mode is the way to go. It basically means setting the "auto disconnect timeout" to something other that infinity, for example 15 seconds. It means the button will disconnect 15 seconds after inactivity. When you later press it, it will connect again. This might result in slightly higher delay, so it's not good for games, but should be ok for light switches and similar.

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