Python I2C

Discussion in 'General Programming Discussion' started by DaViper, Jan 10, 2014.

  1. DaViper

    DaViper New Member

    Joined:
    Jan 8, 2014
    Messages:
    3
    Likes Received:
    0
    Hey all,

    has anyone been using i2c on Udoo with python? If so, which library would that be? I tried smbus, but that does not seem to exist

    Code:
       
    from smbus import SMBus
    ImportError: No module named smbus
    
    I am trying to communicate to a TEA5767 radio module via i2c from the linux command line using python.
    Any help would be appreciated.

    K.R.
     
  2. DaViper

    DaViper New Member

    Joined:
    Jan 8, 2014
    Messages:
    3
    Likes Received:
    0
    fixed it.
    had to install smbus via pip.
    now the GPIO module is remaining
     
  3. TomFreudenberg

    TomFreudenberg Member

    Joined:
    May 12, 2014
    Messages:
    59
    Likes Received:
    2
    Have you been able to use I2C with a python script from Linux side?

    If yes, could you be so please and publish your demo command.
    I have tried a lot but was not able to communicate with linux i2c.

    Thanks for some help if possible.
     
  4. peter247

    peter247 Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    Hows that theory going ?

    I`ve programmed in python using smb-dev library on the raspberry pi , so IF the port is working it shouldn`t be any different to that.
    Have you tried using i2cdetect -y 0 ( i2c-tools ) and see if it finds your device ?
     
  5. peter247

    peter247 Member

    Joined:
    Mar 10, 2014
    Messages:
    263
    Likes Received:
    2
    I tried pip install smbus and got this :-

    Could not find any downloads that satisfy the requirement smbus
    No distributions at all found for smbus

    The RIGHT WAY is apt-get install python-smbus !!!!!
     

Share This Page