Hello m
I don't know if this is the place to ask - but I couln't find answer anywhere.
I have done everything is said in the guide : (except the LCD part)
https://www.rototron.info/raspberry-pi-ina219-tutorial/
download and try to run the code (without the LCD)
but I'm gettting the
[Errno 121] Remote I/O error
what could be the reason for it
when I run the scanner - I can see the INA219
sudo i2cdetect -y 1 0 1 2 3 4 5 6 7 8 9 a b c d e f 00: -- -- -- -- -- -- -- -- -- -- -- -- -- 10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 40: 40 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
this is the code I'm using
`from ina219 import INA219, DeviceRangeError
from time import sleep
SHUNT_OHMS = 0.1
MAX_EXPECTED_AMPS = 0.6
ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS)
ina.configure()
def read_ina219():
try:
print ('Bus Voltage: {0:0.2f}V'.format(ina.voltage()))
print ('Bus Current: {0:0.2f}mA'.format(ina.current()))
print ('Power: {0:0.2f}mW'.format(ina.power()))
print ('Shunt Voltage: {0:0.2f}mV\n'.format(ina.shunt_voltage()))
except DeviceRangeError as e:
# Current out of device range with specified shunt resister
print(e)
while 1:
read_ina219()
sleep(1)`
and this is the all error I'm getting
python Documents/TestINA219_a.py Traceback (most recent call last): File "Documents/TestINA219_a.py", line 7, in <module> ina.configure() File "/usr/local/lib/python2.7/dist-packages/ina219.py", line 165, in configure self._max_expected_amps) File "/usr/local/lib/python2.7/dist-packages/ina219.py", line 283, in _calibrate self._calibration_register(calibration) File "/usr/local/lib/python2.7/dist-packages/ina219.py", line 329, in _calibration_register self.__write_register(self.__REG_CALIBRATION, register_value) File "/usr/local/lib/python2.7/dist-packages/ina219.py", line 361, in __write_register self._i2c.writeList(register, register_bytes) File "/usr/local/lib/python2.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/python2.7/dist-packages/Adafruit_PureIO/smbus.py", line 294, in write_i2c_block_data self._device.write(data) IOError: [Errno 121] Remote I/O error
is there any way you can assit or find the problem ?
Thanks ,