{"id":15197196,"url":"https://github.com/fredericklussier/lifepo4weredpy","last_synced_at":"2026-03-04T20:32:12.169Z","repository":{"id":57438677,"uuid":"105763536","full_name":"fredericklussier/Lifepo4weredPy","owner":"fredericklussier","description":"Wrapper to enable lifepo4wered SO library using Python.","archived":false,"fork":false,"pushed_at":"2017-10-12T12:05:32.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-14T23:38:19.377Z","etag":null,"topics":["lifepo4wered","python","python3","raspberry-pi","raspberry-pi-zero","raspberrypi","wrapper"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fredericklussier.png","metadata":{"files":{"readme":"readme.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-04T12:05:53.000Z","updated_at":"2017-10-11T22:41:24.000Z","dependencies_parsed_at":"2022-09-08T07:10:22.966Z","dependency_job_id":null,"html_url":"https://github.com/fredericklussier/Lifepo4weredPy","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredericklussier%2FLifepo4weredPy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredericklussier%2FLifepo4weredPy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredericklussier%2FLifepo4weredPy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fredericklussier%2FLifepo4weredPy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fredericklussier","download_url":"https://codeload.github.com/fredericklussier/Lifepo4weredPy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241577727,"owners_count":19985048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lifepo4wered","python","python3","raspberry-pi","raspberry-pi-zero","raspberrypi","wrapper"],"created_at":"2024-09-28T00:44:51.447Z","updated_at":"2026-03-04T20:32:11.212Z","avatar_url":"https://github.com/fredericklussier.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"lifepo4weredPy\n=====================\n\n.. image:: https://travis-ci.org/fredericklussier/Lifepo4weredPy.svg?branch=master\n    :target: https://travis-ci.org/fredericklussier/Lifepo4weredPy\n\n.. image:: https://coveralls.io/repos/github/fredericklussier/Lifepo4weredPy/badge.svg?branch=master\n    :target: https://coveralls.io/github/fredericklussier/Lifepo4weredPy?branch=master\n\n.. image:: https://badge.fury.io/py/lifepo4weredPy.svg\n    :target: https://badge.fury.io/py/lifepo4weredPy\n\nA wrapper to enable lifepo4wered SO library to Python.\nreference: http://lifepo4wered.com/lifepo4wered-pi3.html\n\nUsing the Raspbery Pi zero in many projects, I found this product\nvery usefull. So to help my python colleagues, I design this. \n\nYou can find here the documentation of the lifepo4wered product:\nhttp://lifepo4wered.com/files/LiFePO4wered-Pi3-Product-Brief.pdf.\n\nStatus\n------\nIn development.\n\nInstallation\n------------\nIf you want to use this wrapper, you need:\n\n* a lifepo4wered-pi3 as well as a Raspeberry Pi ;-)\n* the lifepo4wered driver (http://lifepo4wered.com/lifepo4wered-pi3.html)\n* a variable of environment path that return access to the lifepo4wered driver\n\n    the best way is to set the LD_LIBRARY_PATH:\n    \n.. code-block:: batch\n\n    echo \"export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/custom/path/\" \u003e\u003e ~/.bashrc\n\nSo to install this wrapper, use:\n\n.. code-block:: batch\n\n    pip install lifepo4weredPy\n\n\nTo dowload and install the LiFePO4wered-Pi drivers and CLI applications,\nplease read https://github.com/xorbit/LiFePO4wered-Pi.\n\n\nUsage\n-----\n\n.. code-block:: python\n\n    import lifepo4weredPy\n    baterryVoltage = lifepo4weredPy.read(lifepo4weredPy.variablesEnum.VBAT)\n\nDetail\n------\n\nRead\n~~~~\nTo read data from the lifepo4wered.\n\n.. code-block:: python\n\n    read(variable)\n\n* variable (lifepo4weredEnum): The information to read.\n* return (int): the information.\n* raise (ValueError): if information is not a lifepo4weredEnum member.\n* raise (RuntimeError): if the information is not read access.\n\n.. code-block:: python\n\n    import lifepo4weredPy\n    baterryVoltage = lifepo4weredPy.read(lifepo4weredPy.variablesEnum.VBAT)\n\nWrite\n~~~~~\nTo write data to the lifepo4wered.\n\n.. code-block:: python\n\n    write(variable, value)\n\n* variable (lifepo4weredEnum): The information name to write.\n* value (int): the value to write.\n* return (int): the written value.\n* raise (ValueError): if information is not a lifepo4weredEnum member.\n* raise (RuntimeError): if the information is not read access.\n* raise (TypeError): if value is not an integer.\n\n.. code-block:: python\n\n    import lifepo4weredPy\n    baterryVoltage = lifepo4weredPy.write(\n        lifepo4weredPy.variablesEnum.LED_STATE, lifepo4weredPy.LED_STATE_PULSING)\n\ncanRead\n~~~~~~~\nMention if the program is allowed to read the information.\n\n.. code-block:: python\n\n    canRead(variable)\n\n* variable (lifepo4weredEnum): The information name.\n* return (bool): True if you can read, otherwise False.\n* raise (ValueError): if information is not a lifepo4weredEnum member.\n\n.. code-block:: python\n\n    import lifepo4weredPy\n    if lifepo4weredPy.canRead(lifepo4weredPy.variablesEnum.LED_STATE):\n        do()\n\ncanWrite\n~~~~~~~~\nMore important, this function mention if the program is allowed to write the information.\n\n.. code-block:: python\n\n    canWrite(variable)\n\n* variable (lifepo4weredEnum): The information name.\n* return (bool): True if you can write, otherwise False.\n* raise (ValueError): if information is not a lifepo4weredEnum member.\n\n.. code-block:: python\n\n    import lifepo4weredPy\n    if import lifepo4weredPy.canWrite(lifepo4weredPy.variablesEnum.LED_STATE):\n        do()\n\n\nlifepo4wered variables\n~~~~~~~~~~~~~~~~~~~~~~\nlist of elements accessible.\nplease read section Low level I2C register specification\n of http://lifepo4wered.com/files/LiFePO4wered-Pi3-Product-Brief.pdf\n\n.. code-block:: python\n\n    class variablesEnum(Enum):\n        I2C_REG_VER = 0\n        I2C_ADDRESS = 1\n        LED_STATE = 2\n        TOUCH_STATE = 3\n        TOUCH_CAP_CYCLES = 4\n        TOUCH_THRESHOLD = 5\n        TOUCH_HYSTERESIS = 6\n        DCO_RSEL = 7\n        DCO_DCOMOD = 8\n        VIN = 9\n        VBAT = 10\n        VOUT = 11\n        VBAT_MIN = 12 \n        VBAT_SHDN = 13\n        VBAT_BOOT = 14\n        VOUT_MAX = 15\n        VIN_THRESHOLD = 16\n        VOFFSET_ADC = 17\n        AUTO_BOOT = 18\n        WAKE_TIME = 19\n        SHDN_DELAY = 20\n        AUTO_SHDN_TIME = 21\n        PI_RUNNING = 22\n        CFG_WRITE = 23\n\nlifepo4wered defines\n~~~~~~~~~~~~~~~~~~~~\nlist of defines used in lifepo4wered operations.\nplease read section Low level I2C register specification\n of http://lifepo4wered.com/files/LiFePO4wered-Pi3-Product-Brief.pdf\n\n.. code-block:: python\n\n    # Register access masks\n    ACCESS_READ = 0x01\n    ACCESS_WRITE = 0x02\n\n    # Touch states and masks\n    TOUCH_INACTIVE = 0x00\n    TOUCH_START = 0x03\n    TOUCH_STOP = 0x0C\n    TOUCH_HELD = 0x0F\n    TOUCH_ACTIVE_MASK = 0x03\n    TOUCH_MASK  = 0x0F\n\n    # LED states when Pi on\n    LED_STATE_OFF = 0x00\n    LED_STATE_ON = 0x01\n    LED_STATE_PULSING = 0x02\n    LED_STATE_FLASHING = 0x03\n\n    # Auto boot settings\n    AUTO_BOOT_OFF = 0x00\n    AUTO_BOOT_VBAT = 0x01\n    AUTO_BOOT_VBAT_SMART = 0x02\n    AUTO_BOOT_VIN = 0x03\n    AUTO_BOOT_VIN_SMART = 0x04\n\nLicense\n-------\nDistributed under the MIT license: https://opensource.org/licenses/MIT\n\nCopyright (c) 2017 Frédérick Lussier (www.linkedin.com/in/frederick-lussier-757b849)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredericklussier%2Flifepo4weredpy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffredericklussier%2Flifepo4weredpy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffredericklussier%2Flifepo4weredpy/lists"}