SPARKY FORUM

How to enable I2C?

How to enable I2C?
« on: November 14, 2017, 12:44:17 AM »
I want to add 4x20 OLED screen to Sparky, how can I enable I2C? Can you provide some documentation or examples? I'm using latest Volumio.

Re: How to enable I2C?
« Reply #1 on: November 14, 2017, 11:25:01 PM »
Hi,

   In latest volumio I2C is already enabled.Can you please share OLED part number or part details ?

With Regards
Sparky Admin

Re: How to enable I2C?
« Reply #2 on: November 15, 2017, 05:47:00 AM »
It's a wide.hk OLED screen with SSD131 controller.

http://www.wide.hk/index.php?route=product/product&path=18_46&product_id=69

***

I tried it with Audiophonics i2s to spdif HAT without success. It works great with RPi3.

dmesg shows gslX680, is it correct?

Code: [Select]
/etc/modules

i2c-gslX680
i2c-dev
spi-dev

Code: [Select]
/boot/config.txt

dtparam=i2c_arm=on
dtparam=i2s=on
dtoverlay=hifiberry-digi
dtoverlay=lirc-rpi,gpio_in_pin=26,gpio_in_pull=high

Lirc works great!

Re: How to enable I2C?
« Reply #3 on: November 17, 2017, 05:52:42 AM »
Hi,

    Please refer below link for OLED configuration in sparky.

https://github.com/sparky-sbc/sparky-test/tree/master/oled_test/sh1106

With Regards
Sparky Admin
« Last Edit: November 17, 2017, 05:56:21 AM by sparkyadmin »

Re: How to enable I2C?
« Reply #4 on: November 18, 2017, 03:09:30 AM »
Thanks for the link! But this didn't do the trick. There's nothing about /etc/modules and /boot/config.txt isn't it supposed to be similar process to raspberrys: https://learn.adafruit.com/adafruits-raspberry-pi-lesson-4-gpio-setup/configuring-i2c#installing-kernel-support-manually

Code: [Select]
volumio@volumio:~$ sudo i2cdetect -y 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- UU -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

Re: How to enable I2C?
« Reply #5 on: November 20, 2017, 01:11:09 AM »
Hi,

  On sparky  i2c 2 using , not i2c 0,i2c 2 uses on 40 pin 3 and 5. All the modules are available , no need to edit config.txt

With Regards
Sparky Admin

Re: How to enable I2C?
« Reply #6 on: November 29, 2017, 12:56:13 PM »
Thanks! Now it recognize it, have to work with python script a bit.

Code: [Select]
volumio@volumio:~$ sudo i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- 3c -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --