more G-Labs products

Author Topic: Raspberry 2 MCP23017 Error  (Read 16632 times)

February 10, 2015, 10:07:26 PM
Read 16632 times

funworld

  • *
  • Information
  • Newbie
  • Posts: 20
CR: Read operation failed with BCM2835_I2C_REASON_ERROR_NACK status

Have Anyone a solution

THX

February 16, 2015, 08:35:11 PM
Reply #1

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi funworld,

I know at least one reason for this error.
It happens to me when the electrical connections on the I2C bus is faulty.

I would check all my connection for bad contacts etc.

The error tells you that an I2C device is not answering.

Regards,
Wibo.

February 17, 2015, 08:49:42 PM
Reply #2

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
It also could mean you're accessing an I2C device at the wrong address and that from the electrical perspective there's nothing wrong.

Regards,
Wibo.

February 19, 2015, 07:54:18 PM
Reply #3

funworld

  • *
  • Information
  • Newbie
  • Posts: 20
Hello Wibo,

I try with putty with i2cdetect -y 1 bus find device 0x20 and 0x21
and i  can turn on and off,
With genie smartIC-MCP23017 get the error!
After update to r478 I get a different error
Error
×
    Object of type 'HomeGenie.Automation.Scripting.ScriptingInstance' doesn't match target type 'HomeGenie.Automation.Scripting.ScriptingInstance'

THX for replay

February 19, 2015, 08:09:39 PM
Reply #4

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi funworld,

HomeGenie does not support Raspberry Pi 2 BCM2836 I2C, but RPi BCM2835 I2C.

Cheers,
g.

February 19, 2015, 08:14:53 PM
Reply #5

funworld

  • *
  • Information
  • Newbie
  • Posts: 20
Hi Gene,
Will raspi 2 supported in the future?
because the performance is great !

Regards,
funworld

February 19, 2015, 08:33:38 PM
Reply #6

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
If the RaspberrySharp-IO library will be updated with Rpi2 support I will also update HG with it.
https://github.com/raspberry-sharp/raspberry-sharp-io
A couple of months ago  I've been adapting some code of the RaspberrySharp to make it compatible with CubieTruck and encountered the I2C issue already.
https://github.com/genielabs/raspberry-sharp-io
By then I thought I may write an "EmbeddedSharp" library based on the currently used RaspberrySharp library but compatible with any computer board by just editing an XML file that will contain the various memory addresses needed for direct access operations on GPIO/I2C/SPI/... pins.
Off course this needs more encouragement and donations :)

Cheers,
g.


February 21, 2015, 07:38:44 PM
Reply #7

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi Gene,

since 3 days I'm an owner of the RPi2
It's bloody fast and dies when I take picture with my Nikon D40.

Well I need I2C to work and it doesn't work.
I'm trying to find the cause of this problem.
I'm not asking you to fix the problem, but maybe you know something I don't know.

Some guy claims to have it working (check the replies):
http://www.raspberrypi-spy.co.uk/2014/11/enabling-the-i2c-interface-on-the-raspberry-pi/

Kinda stuck right now...
Any pointers are appreciated.

Regards,
Wibo.







February 21, 2015, 08:40:15 PM
Reply #8

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Wibo... try it with HG r480. What is Nikon D40?

Cheers,
g.

February 22, 2015, 02:38:28 AM
Reply #9

bkenobi

  • *****
  • Information
  • Global Moderator
  • Posts: 1525
The D40 is a pretty nice digital SLR camera.

February 22, 2015, 03:19:01 AM
Reply #10

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
And what is the matter with D40 and Raspberry Pi 2? ;D

g.

February 22, 2015, 12:05:13 PM
Reply #11

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi Gene,

The RPi 2 has a semiconductor (U16) on the PCB that is sensitive to light.

See this link: http://www.raspberrypi.org/xenon-death-flash-a-free-physics-lesson/
or this: http://www.raspberrypi.org/forums/viewtopic.php?t=99042

You need a high intensity Xenon flash to reproduce it.
LED Flash isn't powerful enough, a 500 W halogen floodlight is also not capable of resetting it.

Problem can be "solved" by covering U16.

Regards,
Wibo.

February 22, 2015, 01:15:05 PM
Reply #12

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer

February 22, 2015, 02:16:01 PM
Reply #13

Wibo

  • ***
  • Information
  • Full Member
  • Posts: 95
Hi Gene,

I tested with HG r480.
Got the homegenie_1_00_beta_r480.tgz from
https://sourceforge.net/projects/homegenie/files/testing/

Copied all content of the tgz onto the RPi2

GPIO is working from HG when I use GPIO23 as output, but I2C doesn't work.

Attached a picture of the error I get.

I wonder if I forget something to setup when starting with a fresh raspbian image?

Regards,
Wibo.


February 22, 2015, 04:14:19 PM
Reply #14

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer
Hi Wibo,

so the changes I applied to raspberry-sharp did not help  :-\
In case you would like to help with this, I'm showing you what I did.

First I changed raspberry-sharp-system library to recognize RPi2 board
https://github.com/genielabs/raspberry-sharp-system
If you download it, you can compile the test program and see if the output on the RPi2 is the one expected.

Then I changed the raspberry-sharp-io library in order to use a different memory base address for I2C when running on RPi2:
https://github.com/genielabs/raspberry-sharp-io/commit/89b796a774658db89df2f598442f25ba38c99a90

That's it. Probably the trick of changing the base address is not the only thing to be aware of in order to properly address I2C on RPi2.

Cheers,
g.