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
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.