Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All provided installation scripts fail with ina219.DeviceRangeError: Current out of range (overflow), for gain 0.32V, device limit reached #98

Open
wojciechczyz opened this issue Feb 25, 2022 · 4 comments

Comments

@wojciechczyz
Copy link

Traceback (most recent call last):
File "/home/pi/bin/upsPlus.py", line 41, in
batt_power = ina_batt.power()
File "/home/pi/.local/lib/python3.9/site-packages/ina219.py", line 204, in power
self._handle_current_overflow()
File "/home/pi/.local/lib/python3.9/site-packages/ina219.py", line 246, in _handle_current_overflow
self._increase_gain()
File "/home/pi/.local/lib/python3.9/site-packages/ina219.py", line 271, in _increase_gain
raise DeviceRangeError(self.__GAIN_VOLTS[gain], True)
ina219.DeviceRangeError: Current out of range (overflow), for gain 0.32V, device limit reached
UPS Plus Installation is Incomplete! ... failed!
Please visit wiki for more information:.

I have upgraded firmware to latest version via OTA, yet all scripts fail for example:

pi@raspberrypi:~ $ curl -Lso- https://raw.githubusercontent.com/geeekpi/upsplus/main/install.sh | bash
Welcome to 52Pi Technology UPS Plus auto-install Program!.
More information please visit here:.
-----------------------------------------------------.
https://wiki.52pi.com/index.php/UPS_Plus_SKU:_EP-0136.
-----------------------------------------------------.
Start the configuration environment check....
Network status is ok....
Start the software check....
git has been installed..
pi-ina219 library has been installed.
Installing smbus2 library....
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: smbus in ./.local/lib/python3.9/site-packages (1.1.post2)
Requirement already satisfied: smbus2 in ./.local/lib/python3.9/site-packages (0.4.1)
smbus2 Installation successful..
create /home/pi/bin directory....
Create python3 script in location: /home/pi/bin/upsPlus.py Successful.
Create UPS Plus IoT customer service python script successful.
Add into general crontab list..
crontab has been created successful!.

------Current information of the detected Raspberry Pi------

Raspberry Pi Supply Voltage: 4.964 V
Raspberry Pi Current Current Consumption: 1164.172 mA
Raspberry Pi Current Power Consumption: 5776.283 mW

Traceback (most recent call last):
File "/home/pi/bin/upsPlus.py", line 41, in
batt_power = ina_batt.power()
File "/home/pi/.local/lib/python3.9/site-packages/ina219.py", line 204, in power
self._handle_current_overflow()
File "/home/pi/.local/lib/python3.9/site-packages/ina219.py", line 246, in _handle_current_overflow
self._increase_gain()
File "/home/pi/.local/lib/python3.9/site-packages/ina219.py", line 271, in _increase_gain
raise DeviceRangeError(self.__GAIN_VOLTS[gain], True)
ina219.DeviceRangeError: Current out of range (overflow), for gain 0.32V, device limit reached
UPS Plus Installation is Incomplete! ... failed!
Please visit wiki for more information:.
-----------------------------------------------------.
https://wiki.52pi.com/index.php/UPS_Plus_SKU:_EP-0136.
-----------------------------------------------------.
pi@raspberrypi:~ $

I have created separate issue here as well:

chrisb2/pi_ina219#32

@hellresistor
Copy link
Contributor

try with sudo

@wojciechczyz
Copy link
Author

sudo has not helped, there are no problems accessing tools nor io, simply values read are not correct

@hellresistor
Copy link
Contributor

hellresistor commented Jan 23, 2023

1st before all, what is system you are using? aarch64? debian ?
uname -a
The i2c is 1 for sure ?

if aarch64 you can get a start here #39

@wojciechczyz
Copy link
Author

It is Raspbian light 32 bit.

I2C is enabled, otherwise it would never read this:
Raspberry Pi Supply Voltage: 4.964 V
Raspberry Pi Current Current Consumption: 1164.172 mA
Raspberry Pi Current Power Consumption: 5776.283 mW

Somehow I just think the board may be defective, especially that after several hours even with power supply connected batteries finally go flat and raspberry shut downs. Batteries are doublepow as recomended on board docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants