1 2 Previous Next 21 Replies Latest reply on Jul 1, 2016 6:42 AM by GerardVidal

    I2C not working any more mraa / upm bug or hardware problem

    GerardVidal

      Hi all,

      I did some posts and comments some weeks ago to share difficulties using I2C bus on Edison Arduino and mini breakout. Some weeks ago I was finally able to properly use HTU21DF or BM180 sensors on I2C bus but never succeeded in using both on the same bus. Now the situation is even worse I cannot detect the sensors  that were working few weeks ago. Here is the situation.

       

      I am using an HTU21DF sensor that works properly with an arduino and a breadboard with HTU21DF and BM180 on the same bus with pullups and voltage converter that also works with the arduino.

      I am using a edison with arduino breakout fully reinstalled last week. mraa and up libs are compiled from github cloned and pulled sources :

      >>> mraa.getVersion()

      'v1.0.0-25-gc413a43'

       

      Tu be sure that there is no low level problem I have reconfigured the I2C according to http://www.intel.com/content/dam/support/us/en/documents/edison/sb/edisonarduino_hg_331191007.pdf

      echo 28 > /sys/class/gpio/export

      echo 27 > /sys/class/gpio/export

      echo 204 > /sys/class/gpio/export

      echo 205 > /sys/class/gpio/export

      echo 236 > /sys/class/gpio/export

      echo 237 > /sys/class/gpio/export

      echo 14 > /sys/class/gpio/export

      echo 165 > /sys/class/gpio/export

      echo 212 > /sys/class/gpio/export

      echo 213 > /sys/class/gpio/export

      echo 214 > /sys/class/gpio/export

      echo low  > /sys/class/gpio/gpio214/direction

      echo high > /sys/class/gpio/gpio204/direction

      echo high > /sys/class/gpio/gpio205/direction

      echo in > /sys/class/gpio/gpio14/direction

      echo in > /sys/class/gpio/gpio165/direction

      echo low > /sys/class/gpio/gpio236/direction

      echo low > /sys/class/gpio/gpio237/direction

      echo in > /sys/class/gpio/gpio212/direction

      echo in > /sys/class/gpio/gpio213/direction

      echo mode1 > /sys/kernel/debug/gpio_debug/gpio28/current_pinmux

      echo mode1 > /sys/kernel/debug/gpio_debug/gpio27/current_pinmux

      echo high  > /sys/class/gpio/gpio214/direction

       

      Then if I check the bus it does not detect the sensor(s) in any configuration

      i2cdetect -y -r 6

           0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f

      00:          -- -- -- -- -- -- -- -- -- -- -- -- --

      10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --

      70: -- -- -- -- -- -- -- --            

                 

      When I try to connect to the sensor with python upm modules  I get this error :

       

      >>> import time

      >>> import mraa

      >>> import pyupm_htu21d

      >>> bus = 6

      >>> tempAddress = 0x40

      >>> temp = pyupm_htu21d.HTU21D(bus, tempAddress)

      >>> temp.resetSensor ()

      >>> temp.sampleData()

      Traceback (most recent call last):

        File "<stdin>", line 1, in <module>

        File "/usr/lib/python2.7/site-packages/pyupm_htu21d.py", line 171, in sampleData

          return _pyupm_htu21d.HTU21D_sampleData(self)

      ValueError: UPM Invalid Argument: Unknown error in I2c::readReg()

       

      I have spent plenty hours  to try to get this to work without any progress, I have read many threads here with no clue or help  to solve my problem. Nobody seems to experience the same defect, could it be a problem with my Edison but in that case why both mini and Arduino breakout do not work...

       

      Please heeeeeeeeeeelp ;-(

      thanks

        1 2 Previous Next