From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I2C channel error during communication between LabVIEW and raspberry pi

Solved!
Go to solution

I am trying to read acceleration values from MPU 6050 but I am getting this error code in LabVIEW:

 

Error 5005 occurred at :

Open.vi >>
I2C Open.vi

Possible reason(s):

The specified I2C channel (0) is not available on the Raspberry Pi 2 Model B.

 

I ran i2cdetect command to see connected devices and this is what I see:

 

 

 

pi@raspberrypi:~ $ 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: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

 

 

 

I am not sure what to make of it!

 

I also want to mention that I want to read data from address 59 to 64 and I have entered the same in my VI but when I run the VI, this address is changed to 69 at the MPU60X0 read.vi. I don't understand why this is happening.

 

Edit: Changing the I2C channel to 1 removed this error but I got a new error now.

girish_jadhav_0-1640005113320.png

 


I ran example VI (Linx - Blink (Simple)) and it works so I don't think it is a communication problem. But a funny thing I noticed was I have raspberry pi 3 model b vi 2 but in LabVIEW it shown as raspberry pi 2 b (pinout is different).

 

girish_jadhav_0-1640003326493.png

In the example vi digital output pin was set to 23 but in case of raspberry pi 3 the same pin is numbered as 16 so I had to change that. But this shouldn't matter as SDA and SCL pins are located at same position in both versions of raspberry pi. 


I would really appreciate your inputs/help in solving this issue.

0 Kudos
Message 1 of 4
(1,449 Views)

The I2C interface on Raspberry Pis is not enabled by default. Have you enabled it?

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 2 of 4
(1,438 Views)

Hi Redhawk,

 

I have enabled it. 

0 Kudos
Message 3 of 4
(1,424 Views)
Solution
Accepted by topic author girish_jadhav

Changing the clock source to PLL with X Gyro Ref worked for me. Found the relevant info here.

 

linx_acc_daq_pi.png

0 Kudos
Message 4 of 4
(1,382 Views)