Skip to content

Access library, command line tool and daemon for the LiFePO4wered/Pi module

License

Notifications You must be signed in to change notification settings

evertide/LiFePO4wered-Pi

 
 

Repository files navigation

LiFePO4wered-Pi

Access library, command line tool and daemon for the LiFePO4wered/Pi module

Installation

Starting from a fresh Raspbian Jessie Lite image (tested with 2016-02-09 version), first install build-essential and git:

sudo apt-get -y install build-essential git

In a directory where you keep source code, clone the LiFePO4wered-Pi repository from GitHub:

git clone https://github.com/xorbit/LiFePO4wered-Pi.git

Get in to the source code directory:

cd LiFePO4wered-Pi/

Build the code:

./build.py

And install it:

sudo ./INSTALL.sh

That's it! You may need to restart for some configuration changes to take effect.

CLI

The lifepo4wered-cli tool provides convenient access to the LiFePO4wered/Pi's I2C registers. Run it without parameters to get help information:

lifepo4wered-cli

To get the current battery voltage in millivolts, try:

lifepo4wered-cli get vbat

To set the wake up time to an hour, run:

lifepo4wered-cli set wake_time 60

To set the auto-boot flag to make the Pi run whenever there is power to do so, run:

lifepo4wered-cli set auto_boot 1

To make this change permanent by saving it to flash, run:

lifepo4wered-cli set cfg_write 0x46

The 0x46 value is a magic key to allow config flash writes.

Adjusting some of the register values can cause problems such as not being able to turn on the system using the touch button. To prevent permanently bricking the LiFePO4wered/Pi, always test your changes thoroughly before writing them to flash. If you made a change that makes your LiFePO4wered/Pi not work correctly, and it is not written to flash, you can undo it by unplugging the LiFePO4wered/Pi and removing the LiFePO4 cell from the battery holder for a couple of seconds.

Check out the product brief for the LiFePO4wered/Pi and LiFePO4wered/Pi3 for a complete list of registers and options available in each product.

About

Access library, command line tool and daemon for the LiFePO4wered/Pi module

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 68.6%
  • C 27.8%
  • JavaScript 2.5%
  • Shell 1.1%