GithubHelp home page GithubHelp logo

piups's Introduction

piups

(Rapsberry|Orange|..) Pi UPS

More info will follow shortly.

@see www.ibisek.com

Hardware installation instructions

TODO

Software installation instructions

  1. Install package dependencies:

    sudo apt-get install python3-smbus
    
  2. Enable I2C

    sudo raspi-config
    

    Go to "5 Interfacing Options" -> "I2C" -> select Yes

    and reboot.

  3. Get the control script from https://github.com/ibisek/piups

    git clone https://github.com/ibisek/piups.git
    cd piups
    

    or

    cd /opt
    mkdir piups
    cd piups
    wget https://raw.githubusercontent.com/ibisek/piups/master/autoShutdown.py
    wget https://raw.githubusercontent.com/ibisek/piups/master/autoShutdown.sh
    wget https://raw.githubusercontent.com/ibisek/piups/master/piups.py
    
  4. Test the UPS is connected and works fine:

    python3 piups.py status
    

    You should see some information like HW & SW versions, batery voltage and possibly others at this stage

  5. Add a user under which this script will run to sudoers to be able to shutdown the machine:

    sudo vim /etc/sudoers
    

    and add at the end of the file

    <your username> ALL=(ALL) NOPASSWD: /sbin/shutdown
    
  6. Configure your crontab

    crontab -e
    

    and append

    @reboot /usr/bin/python3 /path/to/piups.py start & >/ dev/null
    

Pi shutdown with UPS

Shutting down your pi correctly means executing

python3 piups.py halt

Calling halt/shutdown/poweroff/whateverelse will just shutdown your pi but not turn off the UPS. In such case the UPS will turn off after configured limits without power - either timeout or battery level - whichever comes first.

piups's People

Contributors

ibisek avatar

Stargazers

Artem Smirnov avatar Dhiru Kholia avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.