picandies
Posts: 192
Joined: Wed Nov 26, 2014 5:13 pm

strange i2c & VNC interaction

Tue Dec 11, 2018 11:35 pm

Using latest RPI3 Stretch, standard VNC & VNC Server on the windows PC

Using the secondary I2C with smbus & to read some data on some chip, in a python3 script running in terminal window...

bus.read_i2c_block_data ...seems to work ok , thousands of times over & over!!!!!

Config the i2c as, follows...seems to work good.
dtoverlay=w1-gpio
dtparam=i2c_arm=on
dtparam=i2c_vc=on
dtparami2c_vc_baudrate=100000
dtoverlay=i2c0-bcm2708,sda0_pin=28,scl0_pin=29

HOWEVER...moving the terminal window around with the mouse (on the PC screen using VNC) causes MANY errors of the bi2c lock readings. Some type except IOError ......(even if the little rpi HDMI screen is unplugged, same thing.)
However...if the PC VNC is quit, then moving the terminal window around on the little rpi screen show no erorrs...
Why does using VNC on the PC cause these i2c block read errors?

picandies
Posts: 192
Joined: Wed Nov 26, 2014 5:13 pm

Re: strange i2c & VNC interaction

Tue Dec 11, 2018 11:46 pm

To clarify, using pins 28 & 29 (not sure whether the particular i2c matters), on the compute module

picandies
Posts: 192
Joined: Wed Nov 26, 2014 5:13 pm

Re: strange i2c & VNC interaction

Wed Dec 12, 2018 12:14 am

I think this was a false alert...seems like activity on the rpi usb bus (wifi to PC) caused noise pickup on the i2c lines

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2318
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: strange i2c & VNC interaction

Wed Dec 12, 2018 7:37 am

The I2C bus speed varies with the VPU clock, which in turn normally changes when the ARMs enter and leave turbo mode. Add "core_freq=250" to config.txt, and see if that improves the I2C reliability.

N.B. Depending on the split of the workload, limiting the VPU speed in this way could reduce the performance of VNC.

Return to “Compute Module”