There's plenty of resources around the hobby electronics community about i2c and how to go about using it on linux based devices like the Raspberry Pi and the Beagleboard, and the Jolla is a linux based device so I figured it should be fairly similar.
First Problem
All the guides I've found reference this command line package i2c-tools, which at first doesn't seem to be available on the Jolla through pkcon or any of the third party repositories. Turns out the package works fine you just have to compile it from source on the Jolla, which of course requires installing make, gcc, gcc-c++ via pkcon (if you don't know how, follow this).Might be an idea to get it submitted to the usual Jolla repository or in mer-tools or something, but thats a story for another day.
Make sure you install it using devel-su otherwise it will fail, but once thats done you can now probe the i2c bus using i2cdetect -r 1 (/dev/i2c-1 is the i2c port on the jolla) which will probe the i2c bus for connected devices.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[nemo@dhcppc0 ~]$ i2cdetect -r 1 | |
WARNING! This program can confuse your I2C bus, cause data loss and worse! | |
I will probe file /dev/i2c-1 using read byte commands. | |
I will probe address range 0x03-0x77. | |
Continue? [Y/n] Y | |
0 1 2 3 4 5 6 7 8 9 a b c d e f | |
00: -- -- -- -- -- -- -- -- -- -- -- -- -- | |
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
50: UU UU UU UU UU UU UU UU -- -- -- -- -- -- -- -- | |
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- | |
70: -- -- -- -- -- -- -- -- | |
[nemo@dhcppc0 ~]$ |
the i2ctool app on the Jolla Store by kimmoli does mostly the same stuff as i2c-tools, but from a silica app rather than the command line.
No comments:
Post a Comment