Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Orangepi zero i2c and ina219 poblem

Featured Replies

Hello everyone,

I'm having some trouble with i2c  between orangepi zero and ina219. Here is i2cdetect -y 0 respons:
"     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --"

I'm using https://github.com/chrisb2/pi_ina219 and also installed https://github.com/adafruit/Adafruit_Python_GPIO and both of them installed without any problem, but when I run: 

"from ina219 import INA219, DeviceRangeError
from time import sleep

SHUNT_OHMS = 0.1
MAX_EXPECTED_AMPS = 2.0
ina = INA219(SHUNT_OHMS, MAX_EXPECTED_AMPS, address=0x40)
ina.configure(ina.RANGE_16V)

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)"

 

I get:

"Traceback (most recent call last):
  File "zero.py", line 7, in <module>
    ina.configure(ina.RANGE_16V)
  File "/root/pi_ina219/ina219.py", line 164, in configure
    self._max_expected_amps)
  File "/root/pi_ina219/ina219.py", line 282, in _calibrate
    self._calibration_register(calibration)
  File "/root/pi_ina219/ina219.py", line 328, in _calibration_register
    self.__write_register(self.__REG_CALIBRATION, register_value)
  File "/root/pi_ina219/ina219.py", line 360, in __write_register
    self._i2c.writeList(register, register_bytes)
  File "build/bdist.linux-armv7l/egg/Adafruit_GPIO/I2C.py", line 128, in writeList
  File "build/bdist.linux-armv7l/egg/Adafruit_PureIO/smbus.py", line 274, in write_i2c_block_data
IOError: [Errno 70] Communication error on send"

 

So does anyone know what to do to fix this error.

 

Thanks

Edited by Orangepi0

Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.