DFRobotUPS


NameDFRobotUPS JSON
Version 0.5.2 PyPI version JSON
download
home_pagehttps://github.com/mincebert/DFRobotUPS
SummaryDFRobotUPS module
upload_time2024-11-16 19:16:25
maintainerNone
docs_urlNone
authorRobert Franklin
requires_pythonNone
licenseNone
keywords dfrobot ups shutdown power raspberrypi pios
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            DFROBOTUPS MODULE
=================

It supports the DFRobotUPS HAT for the Raspberry Pi Zero (the more
sophisticated version for other Pis has not be checked nor tested) and
can retrieve information about the HAT itself, as well as dynamic data
for the current SoC (State of Charge) and cell voltage.

In addition, it can be run in a mode to poll the SoC and trigger a
shutdown command when it falls below a specified level.

This module contains can be used as a standalone utility or imported for
use in other scripts.

The module was developed and used under Python 3.9 on Raspberry PiOS
11.9 to support PiSCSI.

The information to write the module was taken from the DFRobotUPS wiki
at: https://wiki.dfrobot.com/UPS%20HAT%20for%20Raspberry%20Pi%20%20Zero%20%20SKU%3A%20DFR0528

Command line options
--------------------

The command line options listed with `--help` are shown below:

```
usage: DFRobotUPS [-h] [-s] [-f] [-p PERCENT] [-i INTERVAL] [-c CMD [ARG ...]]
                  [-a ADDR] [-b BUS] [-r RETRY] [-d] [-v]

optional arguments:
  -h, --help            show this help message and exit
  -s, --shutdown        run as a daemon and poll the battery SoC and initiate
                        system shutdown when level drops below the defined
                        level
  -f, --foreground      when running with the -s option, stay running in the
                        foreground - don't run in the background as a daemon
  -p PERCENT, --percent PERCENT
                        State of Charge (SoC) percentage at which to trigger
                        shutdown shutdown (min: 5, max: 95, default: 7)
  -i INTERVAL, --interval INTERVAL
                        number of seconds between polls of the battery SoC
                        (min: 1, max: 600, default: 60)
  -c CMD [ARG ...], --cmd CMD [ARG ...]
                        command to run to trigger shutdown (default:
                        /sbin/halt)
  -a ADDR, --addr ADDR  I2C address for UPS HAT; can be specified in hex as
                        0xNN (default: 0x10)
  -b BUS, --bus BUS     I2C SMBus number for UPS HAT (default: 1)
  -r RETRY, --retry RETRY
                        number of times to try connecting to the UPS HAT
                        (default: 10)
  -d, --debug           increase debugging level (max: 2, default: 0)
  -v, --version         show program's version number and exit

By default, the current charge status and battery voltage will be displayed
and the program will terminate. Using the -s option will cause the program to
daemonise and poll the charge level and run a shutdown command, when it drops
below a specified level.
```

Author
------

Robert Franklin <rcf@mince.net>, UK

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/mincebert/DFRobotUPS",
    "name": "DFRobotUPS",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "dfrobot ups shutdown power raspberrypi pios",
    "author": "Robert Franklin",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/5e/f2/ab91771f024cf73f3577924965ff351fa4001e7c27ea86af369682cc512b/dfrobotups-0.5.2.tar.gz",
    "platform": null,
    "description": "DFROBOTUPS MODULE\n=================\n\nIt supports the DFRobotUPS HAT for the Raspberry Pi Zero (the more\nsophisticated version for other Pis has not be checked nor tested) and\ncan retrieve information about the HAT itself, as well as dynamic data\nfor the current SoC (State of Charge) and cell voltage.\n\nIn addition, it can be run in a mode to poll the SoC and trigger a\nshutdown command when it falls below a specified level.\n\nThis module contains can be used as a standalone utility or imported for\nuse in other scripts.\n\nThe module was developed and used under Python 3.9 on Raspberry PiOS\n11.9 to support PiSCSI.\n\nThe information to write the module was taken from the DFRobotUPS wiki\nat: https://wiki.dfrobot.com/UPS%20HAT%20for%20Raspberry%20Pi%20%20Zero%20%20SKU%3A%20DFR0528\n\nCommand line options\n--------------------\n\nThe command line options listed with `--help` are shown below:\n\n```\nusage: DFRobotUPS [-h] [-s] [-f] [-p PERCENT] [-i INTERVAL] [-c CMD [ARG ...]]\n                  [-a ADDR] [-b BUS] [-r RETRY] [-d] [-v]\n\noptional arguments:\n  -h, --help            show this help message and exit\n  -s, --shutdown        run as a daemon and poll the battery SoC and initiate\n                        system shutdown when level drops below the defined\n                        level\n  -f, --foreground      when running with the -s option, stay running in the\n                        foreground - don't run in the background as a daemon\n  -p PERCENT, --percent PERCENT\n                        State of Charge (SoC) percentage at which to trigger\n                        shutdown shutdown (min: 5, max: 95, default: 7)\n  -i INTERVAL, --interval INTERVAL\n                        number of seconds between polls of the battery SoC\n                        (min: 1, max: 600, default: 60)\n  -c CMD [ARG ...], --cmd CMD [ARG ...]\n                        command to run to trigger shutdown (default:\n                        /sbin/halt)\n  -a ADDR, --addr ADDR  I2C address for UPS HAT; can be specified in hex as\n                        0xNN (default: 0x10)\n  -b BUS, --bus BUS     I2C SMBus number for UPS HAT (default: 1)\n  -r RETRY, --retry RETRY\n                        number of times to try connecting to the UPS HAT\n                        (default: 10)\n  -d, --debug           increase debugging level (max: 2, default: 0)\n  -v, --version         show program's version number and exit\n\nBy default, the current charge status and battery voltage will be displayed\nand the program will terminate. Using the -s option will cause the program to\ndaemonise and poll the charge level and run a shutdown command, when it drops\nbelow a specified level.\n```\n\nAuthor\n------\n\nRobert Franklin <rcf@mince.net>, UK\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "DFRobotUPS module",
    "version": "0.5.2",
    "project_urls": {
        "Bug Reports": "https://github.com/mincebert/DFRobotUPS/issues",
        "Homepage": "https://github.com/mincebert/DFRobotUPS",
        "Source": "https://github.com/mincebert/DFRobotUPS"
    },
    "split_keywords": [
        "dfrobot",
        "ups",
        "shutdown",
        "power",
        "raspberrypi",
        "pios"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "07071af5bfbdf4b17ec324ca8033b54deeed659b507b7992aaf698bbf0789880",
                "md5": "34b6980a08048fe222a106aa3b43e970",
                "sha256": "b80a5d1beadb95c1e1b284107c475ba0ba9632226e423dd9a8ca8225d67db2bf"
            },
            "downloads": -1,
            "filename": "DFRobotUPS-0.5.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "34b6980a08048fe222a106aa3b43e970",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 10176,
            "upload_time": "2024-11-16T19:16:24",
            "upload_time_iso_8601": "2024-11-16T19:16:24.677453Z",
            "url": "https://files.pythonhosted.org/packages/07/07/1af5bfbdf4b17ec324ca8033b54deeed659b507b7992aaf698bbf0789880/DFRobotUPS-0.5.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "5ef2ab91771f024cf73f3577924965ff351fa4001e7c27ea86af369682cc512b",
                "md5": "57933a385e58bcc682322f96dc052e26",
                "sha256": "05fabb2abeb099ba52f13e747950c432893c56633121a55ce4ae44d6c4f2e9a1"
            },
            "downloads": -1,
            "filename": "dfrobotups-0.5.2.tar.gz",
            "has_sig": false,
            "md5_digest": "57933a385e58bcc682322f96dc052e26",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 9550,
            "upload_time": "2024-11-16T19:16:25",
            "upload_time_iso_8601": "2024-11-16T19:16:25.878731Z",
            "url": "https://files.pythonhosted.org/packages/5e/f2/ab91771f024cf73f3577924965ff351fa4001e7c27ea86af369682cc512b/dfrobotups-0.5.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-16 19:16:25",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "mincebert",
    "github_project": "DFRobotUPS",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "dfrobotups"
}
        
Elapsed time: 0.35115s