i2c port changes randomly

dgridish New Member Posts: 1
edited July 2021 in UP Squared Linux

I'm using up squared.
I connect a device via the i2c port in the HAT40 connector.
when using i2cdetect, I detect the same device (identified by the address) on different ports.
Changes occur between reboots.

to my understanding, I may be able to resolve this by setting a rule in 'etc/udev/rules.d', but I'm not sure how to do this. specifically, I'm not sure how to filter the sensor to create the rule.
The 'kernel' I see is 'i2c-2', but I wonder if this will change on the next reboot.

Thank you.



  • Pratik_Kushwaha
    Pratik_Kushwaha Guest Posts: 123 admin

    Hi @dgridish ,

    Can you please provide the UP Squared product info. (RAM/eMMC/Part Number), along with the current BIOS version on it?

    Our tech team is trying to replicate your issue. I will keep you posted on the results/resolution.


  • camillus
    camillus Administrator, Moderator, AAEON Posts: 177 admin
    edited August 2021

    Hi @dgridish ,

    I saw a good tutorial that can guide you through creating the udev rule here

    You can follow the steps below to filter the i2c device:

    • With i2c device connected and you find the current port using i2cdetect and you find for example port 12c-2
    • Run the following command to find the sensor attributes you will need for the udev rule
    • udevadm info -a --p $(udevadm info -q path /sys/bus/pci/devices/*/i2c_designware.2/)
      With the details you can create udev rule.

    **Note ** I added 2 at the end of the device path because I am assuming i2c device current port is detected on i2c-2

    Kindly let us know the outcome and feel free to share with the community when the udev rule works.

    Best regards,