GithubHelp home page GithubHelp logo

upsv3's People

Contributors

yoyojacky avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

upsv3's Issues

demo.py error on RPI4 with Bullseye

I could not get the demo.py to run on my Raspberry Pi 4 running the new/latest Bullseye distribution of Raspbian. I was receiving the error "RuntimeError: Could not determine default I2C bus for platform.".

I traced it down to some code in /usr/local/lib/python3.9/dist-packages/Adafruit_GPIO/I2C.py

I commented out line 63:
#raise RuntimeError('Could not determine default I2C bus for platform.')

and instead put in new code under the final "else" condition:
return 1

This fixed the issue and I was able to retrieve stats using demo.py

[EP-0118 UPS] Main power cuts off to battery

Hey! I've bought an UPS SKU: EP-0118 and i've been trying it out. I found an issue that i did not like whatsoever...i usually restart my pi at 4am so i dont know if this issue stems from this.

First time testing the UPS with an official PSU for Rpi 3B (around 2.1A). After the first boot, everything was smooth (first 12 or so hours). Today, out of nowhere, when i woke up at 7.30am the Pi was completely off, despite having 2x Sony VTC6 batteries fully charged.
I don't know why, there wasn't a power off during the night since my other Rpi's were still functioning well and checking the logs, i can confirm that a power outage was not the issue.

So, in short, somehow during the night, the main power cut off and the batteries kicked in and stayed in battery mode until the energy of the batteries was depleted. I would like to know why.

I noticed one thing, in the morning, when i spotted the issue, clicked the power on button and the battery was full (according to the leds) but after 10s it went off. i tried a couple of times and the behaviour was the same. But after i unplugged, waited 5seconds and replugged, the led indicators suddenly showed it was depleted. This was strange...

Any way i can troubleshoot this issue?
THanks in advance!

Does not recover if batteries are fully discharged

after the battery fully depleted, and the power back on, the board wont turn on automatically

the button is needed to be pressed to turn on the ups.
is there any way around to turn on the board after the power back on?

Unable to communicate with UPS

Hi,

Ran the script with my geeekpi ups.. I have ensured I2C is enabled...
Any suggestions or anything else I am missing? Running Rasbian
pi@raspberrypi:~/upsv3 $ sudo python3 demo.py
Traceback (most recent call last):
File "demo.py", line 20, in
read()
File "demo.py", line 10, in read
ina.configure()
File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 175, in configure
self._max_expected_amps)
File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 305, in _calibrate
self._calibration_register(calibration)
File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 351, in _calibration_register
self.__write_register(self.__REG_CALIBRATION, register_value)
File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 383, in __write_register
self._i2c.writeList(register, register_bytes)
File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/I2C.py", line 127, in writeList
self._bus.write_i2c_block_data(self._address, register, data)
File "/usr/local/lib/python3.7/dist-packages/Adafruit_PureIO/smbus.py", line 364, in write_i2c_block_data
self._device.write(data)
OSError: [Errno 121] Remote I/O error

18650 batteries ??

Bought a UPS (With RTC & Coulometer) For Raspberry Pi SKU: EP-0118, and I know it needs 18650 batteries.
18650 batteries come in two types, flat top (unprotected) and Button top (protected).
The protected version is bigger than the unprotected version, so which one should I buy and use ??

Thanks and regards

Willem

EP-0118 to Home Assistant integration

Tell me, is it possible to integrate the readings from the board into the smart home system Home Asssistant?
Something like this:

readvol.py

# IMPORT THE LIBERARY.
from ina219 import INA219
from ina219 import DeviceRangeError
SHUNT_OHMS = 0.05


def read():
    """Define method to read information from coulometer."""
    ina = INA219(SHUNT_OHMS)
    ina.configure()
    print("%.3f" % ina.voltage())

if __name__ == "__main__":
    read()

configuration.yaml in Home Asssistant

# Raspberry UPS HAT Battery
  - platform: command_line
    name: UPS_HAT_Battery
    command: "python3 /home/homeassistant/.homeassistant/python_scripts/readvol.py"
    unit_of_measurement: "V"
    value_template: "{{ value | round(2) }}"
    scan_interval: 60

Or is there a ready-made integration through HACS?

Is it possible to turn off the UPS board with `shutdown now`

Hello,

I was wondering if it was possible to add a turn off function with I2C to the UPS board when calling shutdown now or something similar on a terminal.

Is it possible that UPS board will be connect to this signal turn off and be on again pushing the on button ?

Thanks for all the work ๐Ÿ‘

0.0 for all readings

If I run the code from the demo.py file, it returns 0.0 for all readings. What can I do?

from ina219 import INA219, DeviceRangeError
SHUNT_OHMS = 0.05
"""Define method to read information from coulometer."""
ina = INA219(SHUNT_OHMS, busnum=1, address=0x40)
ina.configure()
voltage_v = ina.voltage()
current_mA = ina.current()
power_mW = ina.power()
shunt_voltage_mV = ina.shunt_voltage()

I can see the UPS detected at 0x40 from the Raspberrypi with i2cdetect -y 1
Thanks for the help

Read line voltage / charge status?

Hi, I'm guessing this UPS only has one INA219, i.e. it is not possible to read the input voltage on the UPS?
I would like to do that in order to trigger a graceful-shutdown script after X number of minutes, that is unless there is a way to intrepret the numbers from the internal INA219 as to if a power drop event has happened.

I guess one could manually add one on the charger side of the UPS? If anybody has any notes on that, I'm all ears.
On that note, can anyone explain what the "repair board" does exactly? And if one should add a second INA129, should it be placed before or after the repair board?

bad hardware

I bought one of these to test for a project where we need 15 UPS for raspberry pi 4s. It lasted about 2hrs before it stopped working. Wont supply more than 1.6v to the pi when it's connected up, but 5.2v at the pins with the pi disconnected. Going off the lack of response to other issues raised here I'd say not worth the time and money.

RTC and Low voltage auto shutdown

Hi,

  1. We don't know anything about the RTC. Can you please provide code to program it for date and time?

  2. Can you please provide a script for auto shutdown (software) when low power?

For example, the X728 (competing UPS hardware) already have extensive software writeup to use the new hardware for software voltage-based shutdown, programming of RTC module, battery voltage and percentage reading, AC power loss detection etc. Just wondering if we can have something similar for the UPS V3?
https://github.com/geekworm-com/x728/blob/master/x728.sh
https://raspberrypiwiki.com/index.php?title=X728-Software&mobileaction=toggle_view_desktop

Thanks! Hardware is all there, just need the software side of things

Firmware update UPS has stopped working

Hello.
I had to update the firmware because my motherboard suffered from turning off after about 24 hours. For this purpose, I purchased the NU-Link programmer. I made the updates today according to the PDF instructions. Everything ended correctly

The system does not seem to be working. There is no reaction after installing the batteries. I press the switch, the charge indicator shows for a moment that the batteries are fully charged, but the power to the Raspberry is not turned on (the RPI POWER LED is off). Repeated presses also activate the indicator. Holding the key down also activates the indicator momentarily. After connecting the charger, the status indicator "fills up" and only the last LED flashes (batteries full). I tried to program the system for a few hours, but without success. Is the firmware file correct?

image

David

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.