6 Replies Latest reply on Oct 15, 2015 5:25 PM by gerarde

    Edison timeouts with I2C connection

    twatanabe11

      Greetings,

      Dear Guys.

       

      I get Intel Edison with Arduino board kit and Sparkfun Weather Shield(DEV-12081).

      However, I found code998 I2C timeout error on HTU21D Humidity sample code.

      What points should I check?

       

      I believe there is no problem about soldering of arduino pin headers.

      The switch named "Serial" on weather shield is for additional GPS module, right?

      And, other sample codes such as LED blink, AnalogInput, and Digital StateChangeDetection work correctly.

      I think the problem is I2C communication.

       

       

      --Environment

      Edison Firmware: version120

      Yocto: Linux edison 3.10.17-poky-edison+ #1 SMP PREEMPT Fri Jan 30 14:16:35 CET 2015 i686 GNU/Linux

      Arduino IDE: arduino-windows-1.0.4.7z

      Humidity sensor: HTU21D

      Sample code and Library: https://dlnmh9ip6v2uc.cloudfront.net/assets/b/5/9/7/f/52cd8187ce395fa7158b456c.zip

       

       

      Thank You and Best Regards,

        • 1. Re: Edison timeouts with I2C connection
          JPMontero_Intel

          Hi twatanabe11,

           

          I just compiled the sketch you mentioned and I did not get any errors, but in the code state that error 998 is displayed if there is no sensor is detected, make sure you have connected the sensor to the right pins and that it works properly. You can check how the sensor behaves if you have a logic analyzer or an oscilloscope.

           

          Regards,
          JPMontero_Intel

          • 2. Re: Edison timeouts with I2C connection
            twatanabe11

            Greetings,

            Dear JPMontero-san.

             

            Thank you for helping.

             

            I checked the connection of pins and voltages, however, It looks there is no problem.

            Unfortunately, I don't have Logic Analyzer and Oscilloscope.

             

            And,

            I also tested MPL3115A2 Pressure sensor on same shield.

            It returns 999 CRC error code.

            It means Edison can detect the device, but connection is not correct, right?

             

            Is there the way to check I2C communication by another method?

             

            Thank You and Best Regards,

            • 3. Re: Edison timeouts with I2C connection
              bbx10node

              I connected to an htu21d breakout board to the Edison-Arduino board but without using the Arduino SDK. The C command line code is at htu21dflib. The program first uses a shell script to configure A4/A5 for I2C using information at EmutexLabs.The C program then uses /dev/i2c-6 as usual. Temperature and humidity results match the results when using the same sensor on an Uno.

               

              i2cdetect -r -y 6 fails to detect the sensor even though the C code works. I have not been successful using the same sensor using node.js. I suspect these two issues may be related.

               

              Physical connection

               

              1. htu21d VIN <-> Edison 5V
              2. htu21d GND <-> Edison GND
              3. htu21d SDA <-> Edison A4
              4. htu21d SCL <-> Editson A5

               

              Linux edison1 3.10.17-poky-edison+ #1 SMP PREEMPT Fri Jan 30 14:16:35 CET 2015, firmware 120

               

              P.S. The Arduino code in the original post works on the Edison using Arduino SDK 1.5.3-Intel.1.0.4.

               

              The Adafruit HTU21DF library also works but one change is required to compile. The compiler complains it cannot find the include file <util/delay.h>. Commenting out the #include statement works.

              • 4. Re: Edison timeouts with I2C connection
                twatanabe11

                Greetings,

                Dear bbx10node-san.

                 

                Thank you for your detailed information.

                I tried your shell scripts and GPIO setting command on Yocto.

                However, I still get 998 timeout error on my environment.

                 

                I will try the communication with another I2C device.

                 

                Thank you for helping.


                Thank You and Best Regards,

                • 5. Re: Edison timeouts with I2C connection
                  JPMontero_Intel

                  Hi twatanabe11,

                   

                  I apologize for the delay in my response. Let us know if you get the same behavior even using another I2C device.

                   

                  Regards,
                  JPMontero_Intel

                  • 6. Re: Edison timeouts with I2C connection
                    gerarde

                    Dear twatanabe11,

                     

                    Have you solve this problem? I have the same problem with my HTU21D and Arduino Mega. It always output 998. How did you solve this problem?

                     

                    Regards,

                     

                    Gerarde