I built linkit7688 v19.07.2 and get SMBus(busnum) FileNotFoudError

I built Target Linkit7688 on Tag v19.07.2 and have problems using SMBus with this small driver.
Can that be a physical Problem, like a misconnected SDA/SCL?
Where do I have to start debug?

BusyBox v1.30.1 () built-in shell (ash)

  _______                     ________        __
 |       |.-----.-----.-----.|  |  |  |.----.|  |_
 |   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
 |_______||   __|_____|__|__||________||__|  |____|
          |__| W I R E L E S S   F R E E D O M
 -----------------------------------------------------
 OpenWrt 19.07.2, r10947-65030d81f3
 -----------------------------------------------------
root@openwrt:~# cd webthing/
root@openwrt:~/webthing# cd ina219_python/
root@openwrt:~/webthing/ina219_python# python3 ina219_example.py
Traceback (most recent call last):
  File "ina219_example.py", line 4, in <module>
    ina219 = INA219(address=INA219_ADDRESS)
  File "/root/webthing/ina219_python/ina219.py", line 72, in __init__
    self.bus = smbus.SMBus(busnum)
FileNotFoundError: [Errno 2] No such file or directory
root@openwrt:~# uname -a
Linux openwrt 4.14.171 #0 Thu Feb 27 21:05:12 2020 mips GNU/Linux

busnum defaults to 1

Did you install kermel support for i2c bus (kmod-i2c-core kmod-i2c-mt7628)?
Also i2c-tools package may be helpful.

I have kmod-i2c-core and kmod-i2c-mt7628 installed and I added i2c-tools rebooted and failed with the same reason.

What I have seen now is that kmod-i2c-smbus is not installed and shows an incompatible version of kernel. That seams strange to me...

Bildschirmfoto 2020-04-05 um 19.32.06

Is that normal? Did I build on a wrong branch? I checked out the Tag "v19.07.2"

novski@ubuntu:~/Documents/openwrt$ git log --oneline
33732f4a9c (HEAD, tag: v19.07.2) OpenWrt v19.07.2: adjust config defaults

Pls, output of commands:

ls /dev | grep i2c
i2cdetect -y 0

You use correct source tree but different kernel config.
So:

  1. Compile all needed modules yourself
  2. Or use stable release and precompiled modules repo.

And pay attention to the notes of python module ina219.py:

Notes

    I2C device: /dev/i2c-1
    INA219 address: 0x40
    bus_voltage_range: INA219_CONFIG_BVOLTAGERANGE_32V,
    gain: INA219_CONFIG_GAIN_8_320MV,
    bus_adc: INA219_CONFIG_BADCRES_12BIT,
    shunt_adc: INA219_CONFIG_SADCRES_12BIT_1S_532US,
    mode: INA219_CONFIG_MODE_SANDBVOLT_CONTINUOUS,
    cal_value: self.cal_value

It's possibly that in your environment bus number and/or bus address are different.

Thanks for pointing me to this:

Did that and found an i2c-0 device instead of i2c-1 changeing the adress=0 makes my device work.

root@openwrt:~/webthing/ina219_python# ls /dev | grep i2c
i2c-0
root@openwrt:~/webthing/ina219_python# i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: 30 31 32 33 34 35 36 37 -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 51 52 53 54 55 56 57 58 59 5a 5b 5c 5d 5e 5f 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --

Can you explane to me the meaning of the last command and its output?

This command noniteractively scan i2c bus 0. Just google more info.

Description
i2cdetect is a userspace program to scan an I2C bus for devices. It outputs a table with the list of detected devices on the specified bus. i2cbus indicates the number or name of the I2C bus to be scanned, and should correspond to one of the busses listed by i2cdetect -l. The optional parameters first and last restrict the scanning range (default: from 0x03 to 0x77).

i2cdetect can also be used to query the functionalities of an I2C bus (see option -F.)
Warning
This program can confuse your I2C bus, cause data loss and worse!
Interpreting the Output
Each cell in the output table will contain one of the following symbols:

    "--". The address was probed but no chip answered.
    "UU". Probing was skipped, because this address is currently in use by a driver. This strongly suggests that there is a chip at this address.
    An address number in hexadecimal, e.g. "2d" or "4e". A chip was found at this address.

How come it did not detect my device on 0x40?
Seams strange as I can receive data from that address...

root@openwrt:~/webthing/ina219_python# python3 ina219_example.py 
bus voltage 4972 mV
shunt voltage 35.130 mV
current 347.200 mA
power 1894.000 mW

Source of i2cdetect is available. You can inspect how it detect presence of device and try to switch mode of detection. But don't forget of Warning.