I2C Detect Slave Method?
UFD, congratulations and thank you for sharing.
@UFD Thanks for this "solution" (or more workaround). This was the only way I was able to get my Python code towards a keller pressure meter work. So I'm lifting this fabioulus post
I'm still unable to fix my related problem with write a byte wait 8ms then read 5 bytes without specifying register.
there seems also to still be a open drain issue
Why hasn't this been fixed in Omega2+? I have scanned several posts in the forum that probably has problems that are related to this. I2C is a vital bus doing smart IoT stuff for real. So if Onion would like to be part of commercial projects I2C needs to have top priority.
Could any of the staff comment?
In case any body else is looking for this.
If for example you wanted two I2C busses, you would do that like this.
Example: using GPIO 14 for the second SDA and GPIO 16 for the 2nd SCL
insmod i2c-gpio-custom bus0=1,5,4 bus1=2,14,16
and you can then verify them with
i2cdetect -y 1
i2cdetect -y 2
Im glad you guys found this useful!
@Jeff-Seese Thanks for the additional information on spinning up multiple I2C channels (useful when you have fixed I2C address based devices).
@Jan-Breuer I will certainly look into this. It would be amazing if "real" I2C worked on the Omega.
How I can use these kmod's with another version of kernel?
Now I have latest firmware and the kernel version is 4.4.74.
Is it possible to give links to newer compiled versions of (?):
kmod-i2c-gpio-custom_4.4.46-2_mipsel_24kc.ipk kmod-i2c-gpio_4.4.46-1_mipsel_24kc.ipk kmod-i2c-algo-bit_4.4.46-1_mipsel_24kc.ipk
There is no longer a b160 image at: http://repo.onion.io/omega2/images/ for some mysterious reason.
I have tried b159, but it gives me an "unable to open mmap file" error when I run "omega2-ctrl gpiomux set i2c gpio".
b175 gives me a "failed to find i2c-algo-bit" error when I run "insmod i2c-algo-bit"
@George-Gerber, it is there, you may miss it because it falls under 0.1.10 i.e. omega2p-v0.1.10-b160.bin
@Sergiy-Tarasov, I have had some success using what is most likely a hack and not recommended.
- Uncomment line 1 "reboot_core" in the file /etc/opkg/distfeeds.conf
- opkg update
- opkg --force-depends install kmod-i2c-gpio-custom
Now the hack, because it was for a higher kenel version the libraries are installed to /lib/module/<kenel-version> so we need to copy them across to the current version, in my case:
- cp /lib/modules/4.4.131/* /lib/4.47/
Then proceed with the insmod as before.
@UFD we fixed the driver for the hardware I2C controller. The main enhancements are:
i2cdetectcommand is now supported
- clock stretching is supported
- support for unlimited message length
- support for repeated start sequences
Check out this blog post for more details
@Lazar-Demin, Awesome news, thanks for letting me know. I will test very soon.