Page 12 of 14

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Tue Jun 14, 2016 1:21 pm
by vidal
Sorry for the unsufficient report, I have said that I was using debian but that was not clear enough, and lost among the contribution.
At best I get a message in the log :
[ 10.569376] i2c /dev entries driver
but nothing more. I have never been able to get any i2c device . I am using a debian image.
Thank-you for the hint I have passed it on to maintainers of the script I used to build the image; even if at the moment I have not changed anything, I have thought that I would like to be able to build a custom kernel (stretch) and as comparisons raspbian/debian do not strongly favour one solution against the other, I decided to choose this debian script to build my raspberry image. I will drop the solution here if it comes out.
Thanks for your work sorry again for the unclear report.

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Tue Jan 24, 2017 6:16 am
by SunDontShine
So what is the correct way now with the latest rasping jessie?

I tried editing my

Code: Select all

/boot/config.txt
file with "device_tree=" and it breaks after reboot

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Tue Jan 24, 2017 6:46 am
by PhilE
rpi-4.4 and later kernels will not work without Device Tree. Why do you want to disable it?

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Tue Jan 24, 2017 10:41 pm
by SunDontShine
Well I want to simply run I2C using wiring Pi.

Even after I enable I2C through raspi-config I get the prompt that started this posted after trying to enter "gpio load i2c" in the command line

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Wed Jan 25, 2017 12:41 am
by DougieLawson
You need to upgrade your version of WiringPi.

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Thu Jan 26, 2017 2:43 am
by SunDontShine

Code: Select all

gpio version: 2.38
Copyright (c) 2012-2017 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Pi 2, Revision: 01, Memory: 1024MB, Maker: Sony 
  * Device tree is enabled.
  *--> Raspberry Pi 2 Model B Rev 1.1
  * This Raspberry Pi supports user-level GPIO access.
Above is my latest version. Is the solution still, to edit the /boot/config.txt file then? My raspi will not boot if I do this

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Thu Jan 26, 2017 6:38 am
by PhilE
What is in your config.txt? You can omit any comments and blank lines, but include everything else.

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Thu Jan 26, 2017 8:50 pm
by SunDontShine
HelloPhilE, below is my /boot/config.txt file. I have not made any modifications to this file on this build

Code: Select all

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
#dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# NOOBS Auto-generated Settings:
hdmi_force_hotplug=1

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Thu Jan 26, 2017 8:58 pm
by PhilE
To enable i2c, uncomment the "dtparam=i2c_arm=on" line. For userspace access, which I think is what you want, make sure "i2c-dev" is in /etc/modules. Then reboot.

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Fri Jan 27, 2017 6:31 am
by SunDontShine
Yes I've tried that... and to be extra sure I formatted the raspi and installed the latest rasping "noobs" version on there with wiringPi

I enabled I2C the /boot/config.txt file is below

Code: Select all

# For more options and information see
# http://www.raspberrypi.org/documentation/configuration/config-txt.md
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
#disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
#dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# NOOBS Auto-generated Settings:
hdmi_force_hotplug=1
/etc/modules

Code: Select all

# /etc/modules: kernel modules to load at boot time.
#
# This file contains the names of kernel modules that should be loaded
# at boot time, one per line. Lines beginning with "#" are ignored.

i2c-dev
And finally when I run

Code: Select all

gpio load i2c

i receive the error below which points me to this forum?

Code: Select all

gpio: Unable to load/unload modules as this Pi has the device tree enabled.
  You need to run the raspi-config program (as root) and select the
  modules (SPI or I2C) that you wish to load/unload there and reboot.
  There is more information here:
      https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97314
What is the known solution for this problem?

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Fri Jan 27, 2017 6:54 am
by PhilE
Have you tried skipping the "gpio load i2c" command? With your configuration both modules should already be loaded.

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Sat Feb 04, 2017 2:50 am
by SunDontShine
yes. i've tried that. same thing. does not work!
Does anyone know what version of raspian previously worked with this wiringpi i2c?

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Sat Feb 04, 2017 7:22 am
by DougieLawson
What does an lsmod command show?
What does ls -la /dev/i2c* show?

Do you have an up to date version of the wiringPi gpio command?

Code: Select all

root@apollo ~ # gpio -v
gpio version: 2.32
Copyright (c) 2012-2015 Gordon Henderson
This is free software with ABSOLUTELY NO WARRANTY.
For details type: gpio -warranty

Raspberry Pi Details:
  Type: Model B+, Revision: 02, Memory: 512MB, Maker: Sony
  * Device tree is enabled.
  * This Raspberry Pi supports user-level GPIO access.
    -> See the man-page for more details
    -> ie. export WIRINGPI_GPIOMEM=1
root@apollo ~ #
even my version is six point releases out of date. See http://wiringpi.com/download-and-install/

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Sat Feb 04, 2017 7:42 am
by DougieLawson
Read the results from running Gordon's code. It doesn't work on device tree enabled kernels.

Code: Select all

root@intrepid:/shared/Raspi/wiringPi # gpio load i2c
gpio: Unable to load/unload modules as this Pi has the device tree enabled.
  You need to run the raspi-config program (as root) and select the
  modules (SPI or I2C) that you wish to load/unload there and reboot.
  There is more information here:
      https://www.raspberrypi.org/forums/viewtopic.php?f=28&t=97314
root@intrepid:/shared/Raspi/wiringPi #

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Tue Feb 07, 2017 6:41 pm
by SunDontShine
Yes,
That is the error I received before. So how do you disable device_tree?

EDIT: I previously tried editing /boot/config.txt with "device_tree=" to disable the device tree, as found in the instructions https://www.raspberrypi.org/documentati ... ce-tree.md raspi documentation website.

The result of this, was the Pi would not boot up! I could not see the screen

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Tue Feb 07, 2017 7:46 pm
by DougieLawson
SunDontShine wrote:Yes,
That is the error I received before. So how do you disable device_tree?
You can't, because your kernel won't boot without it.

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Tue Feb 07, 2017 8:44 pm
by BobKruse
DougieLawson & SunDontShine,

Am I wrong, or stating the obvious? I think the error message
"gpio: Unable to load/unload modules as this Pi has the device tree enabled.
You need to run the raspi-config program (as root) and select the
modules (SPI or I2C) that you wish to load/unload there and reboot."

Really just needs the "dtparam=i2c_arm=on" and "dtparam=spi=on" lines un-commented in /boot/config.txt

Then the load command still won't run, but it will already be loaded.

best regards,
Bob

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Tue Feb 07, 2017 8:47 pm
by DougieLawson
It's a junk message from ancient history before the device tree stuff made it easy to get I²C running.

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Thu Feb 23, 2017 4:04 pm
by nomercy515
HI everyone,
I'm trying to setup my RPI 3B with latest Jessie on it.
I've already tried making the changes suggested in this forum such as
the few additions to the config.txt and I've also just ran an apt-get update to make sure everything was fine. Now my I2C setup works, but I can't manage to modify the GPIO baudrate via the WiringPi Library (Function: gpio load i2c 1000). it would always bring me back to the Device tree page troubleshoot, but I've been through it with no success. Any ideas?

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Wed Mar 29, 2017 3:12 pm
by ols
Hi,

I am trying to setup SPI on my Rpi 2, rev. 01.
I used raspi-config in sudo mode to enable SPI.
I rebooted, but I can't find spi device in /dev/
How I can to enable spi ?

Thank you

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Wed Mar 29, 2017 3:14 pm
by PhilE
What is in your config.txt? And are you using NOOBS?

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Wed Mar 29, 2017 4:21 pm
by ols
My config.txt is:

Code: Select all

# For more options and information see
# http://rpf.io/configtxtreadme
# Some settings may impact device functionality. See link above for details

# uncomment if you get no picture on HDMI for a default "safe" mode
#hdmi_safe=1

# uncomment this if your display has a black border of unused pixels visible
# and your display can output without overscan
disable_overscan=1

# uncomment the following to adjust overscan. Use positive numbers if console
# goes off screen, and negative if there is too much border
#overscan_left=16
#overscan_right=16
#overscan_top=16
#overscan_bottom=16

# uncomment to force a console size. By default it will be display's size minus
# overscan.
#framebuffer_width=1280
#framebuffer_height=720

# uncomment if hdmi display is not detected and composite is being output
#hdmi_force_hotplug=1

# uncomment to force a specific HDMI mode (this will force VGA)
#hdmi_group=1
#hdmi_mode=1

# uncomment to force a HDMI mode rather than DVI. This can make audio work in
# DMT (computer monitor) modes
#hdmi_drive=2

# uncomment to increase signal to HDMI, if you have interference, blanking, or
# no display
#config_hdmi_boost=4

# uncomment for composite PAL
#sdtv_mode=2

#uncomment to overclock the arm. 700 MHz is the default.
#arm_freq=800

# Uncomment some or all of these to enable the optional hardware interfaces
dtparam=i2c_arm=on
#dtparam=i2s=on
dtparam=spi=on

# Uncomment this to enable the lirc-rpi module
#dtoverlay=lirc-rpi

# Additional overlays and parameters are documented /boot/overlays/README

# Enable audio (loads snd_bcm2835)
dtparam=audio=on

# uncomment one of the ovrelays if loading from EEPROM is not supported
#dtoverlay=4dpi-32
#dtoverlay=4dpi-35
#dtoverlay=24-hat
#dtoverlay=32-hat
#dtoverlay=35-hat

#uncomment to enable HAT EEPROM programming
#dtparam=i2c0

[pi3]
kernel=kernel7_hat.img
[pi2]
kernel=kernel7_hat.img
[pi1]
kernel=kernel_hat.img
[pi0]
kernel=kernel_hat.img
[all]

enable_uart=1
I did not use NOOBS

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Wed Mar 29, 2017 4:24 pm
by PhilE
You look like you are using a non-standard kernel. You'd be better off reporting the issue to its maintainers.

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Wed Mar 29, 2017 4:54 pm
by ols
I am using Jessy lite from official site.
I have kernel version:
Linux raspberrypi 4.4.34-v7+ #1 SMP Thu Dec 29 11:16:26 UTC 2016 armv7l GNU/Linux

Re: I2C, SPI, I2S, LIRC, PPS, stopped working? Read this.

Posted: Wed Mar 29, 2017 5:11 pm
by PhilE
That doesn't look standard. Delete the references to kernel*_hat.img and try again.