[SOLVED] Couldn't use ./susv -status ( can't access i2c device )

mustafaxfemustafaxfe Posts: 4New Member
edited July 2 in 40-PIN GP-bus

Hi,
I have followed this "https://wiki.up-community.org/Ubuntu#Enable_the_HAT_functionality_from_userspace" tutorial to get i2c access.
Also, I have connected "UPS and wide range DC-in HAT" and installed its software for up-board:
https://shop.olmatic.de/en/content/7-downloads.
But, couldn't work. Its daemon starts without problem:
cd /opt/susvd/
sudo ./susvd -start
But when I try to read its status:
./susv -status
It gives:
Unable to select I2C device
I have installed i2c-tools and i2cdetect gives these outputs:
[email protected]:/opt/susvd$ i2cdetect -y 0
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
[email protected]:/opt/susvd$ i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
[email protected]:/opt/susvd$ i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- 3a -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- 55 -- -- -- -- 5a -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
What should I do for accessing i2c devices.
Thanks in advance.

Tagged:

Best Answer

  • mustafaxfemustafaxfe Posts: 4
    Accepted Answer

    I have changed my distro with Ubilinux. It seems it is working without any problem.
    Thank you...

Answers

  • Michael McCoolMichael McCool Posts: 14New Member
    edited May 21

    I am having the exact same issue. I see some devices when I scan bus 2 but they don't match the U.USV docs, which give commands to scan bus 1; but when I do a scan, both bus 0 and bus 1 are empty. The docs are a little vague about whether i2c-1 is the one used for the HAT but that is what the pinout docs seem to imply. I do see a couple of things (strangely, in different places than you) when I scan bus 2.

    At any rate, things I have tried:

    • Updating to the latest BIOS (UPCDM11) and kernel (4.10.0-42-upboard10-Ubuntu). It didn't work with the old BIOS, either. Using default BIOS setting (eg ACPI for i2c) except for the speed tweaks noted below.
    • Reducing the speed of i2c-1 to 100kHz using the BIOS setting (under the HAT menu).
    • Reducing the speed of both i2c ports to 100kHz in the BIOS
    • Testing GPIOs. These work (at least, I can turn the RGY LEDs under the board on and off). That tells me I have the right drivers, kernel, permissions, etc.
    • Tried fancier i2cdetect options, namely "i2cdetect -r -a -y 1" which is supposed to be more robust; however, I got the same results.

    Things I haven't tried yet:

    • Using i2c-2. Maybe one of the devices showing up on the scan is in fact the U.USV? I don't want to poke at things randomly in case that is something else, though.
    • Disabling one of i2c-1 or i2c-2. There was a bug reported where enabling one i2c port disabled another on the UP2. Could something similar be going on here?

    Information:

    • I am using a version of the UP Board from last year (with active cooling) that was included with the Intel Robotics Development Kit. It may be this problem is specific to particular versions of the board so we should try to be specific. I will have to figure out the specific model number of the board (if someone can tell me where to find it).
    • The U.USV does work just as a "UPS". But I really need the i2c interface to monitor the charge state as I'm using this in a robot where I need to disconnect from wall power (the robot is supposed to return to a charge station when its battery gets low, so I need to be able to monitor it, shutdown gracefully if the robot can't make it back, etc. etc.)
    • Running Ubuntu 16.04.3, because ROS.
  • Michael McCoolMichael McCool Posts: 14New Member
    edited May 21

    I don't know if it's relevant but I noticed there were no udev rules for gpio, i2c, or spi. The following thread seems to imply there should be:
    https://forum.up-community.org/discussion/2141/tutorial-gpio-i2c-spi-access-without-root-permissions#latest
    However, I don't think this is the problem since my scan comes back empty when I use sudo, too, and I don't get any complaints about lacking permissions when I tweak the LEDs and run i2cdetect in user mode (I did add my $USER to all the groups indicated in the cited tutorial).
    There was another thread that mentioned i2c devices not showing up for a while so I waited a few hours and did a scan. Nope, still not showing up...

    Later when I have time I will try putting a logic analyser on the i2c pins and see if there are any bits getting twiddled when I run a scan. That may help figure out whether it is a SW or firmware issue (eg CPLD config) or a HW issue (eg pullups too weak or too strong).

  • ccaldeccalde Posts: 173New Member, Emutex mod

    Hi all,

    Any update for that issue?

    Cheers!

Sign In or Register to comment.