LCD+button I2c error on RaspPi

EL Wire/Tape/Panels, LEDs, pixels and strips, LCDs and TFTs, etc products from Adafruit

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

LCD+button I2c error on RaspPi

Post by mapledyne »

I have the i2c kit for the two line LCD display and have it built per the tutorial.

I've been trying to test it with the sample code available, and am currently trying with the 'LCDTest.py" file in the AdaFruit_CharLCDPlate set. I've edited it to support the correct bus (1), but continue to get:
Error accessing 0x20: Check your I2C address

When running:
i2cdetect -y 1
The device is detected on 0x20, and I can read from there manually with i2cget, and get what seems reasonable data from i2cdump (though I don't know precisely what it should show - reasonable in this instance is "not all XX's, and it changes when I hit buttons and rerun").

I've put the account into the i2c group, and even changed the permissions of /dev/i2c-1 to 0666 to (hopefully) make sure it wasn't a permission issue, though it happens when running under sudo or not.

I've been trying to parse out what the various scripts are exactly reading to try to create something by hand to read/write to see if I'm getting truly reasonable results, but if there were other tips, I'd love to hear them.

Thanks for any help,
Michael

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: LCD+button I2c error on RaspPi

Post by adafruit »

what happens if you run sudo python adafruit_charlcdplate.py?

User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

Re: LCD+button I2c error on RaspPi

Post by mapledyne »

I'm getting the same error:
Error accessing 0x20: Check your I2C address

When I add a line to print the message from the error I also see:
[Errno 5] Input/output error

I've tried manually ensuring the code went to bus 1 in case the autodetect failed, and

The dump at 0x20 before anything is initialized there looks like:
0 1 2 3 4 5 6 7 8 9 a b c d e f 0123456789abcdef
00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ................
10: ff XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX .BANNED
20: XX XX XX XX XX XX XX XX ff XX XX XX XX XX XX XX BANNED.BANNED
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
80: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
90: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
a0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
b0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
c0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
d0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
e0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX BANNED
f0: XX XX XX XX ff XX XX XX XX XX XX XX XX XX XX XX XXXX.BANNED


If I try to manually initialize things by going through the CharLCDPlate code (or if I just read continually from 0x00, for instance), the data will change in here, though I don't exactly know if what I'm seeing is "correct". The i2cdetect looks like it should (as I understand things):


0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --

User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

Re: LCD+button I2c error on RaspPi

Post by mapledyne »

I didn't see a way to edit a post, but wanted to finish a sentence in the above post that makes pretty much no sense:

I've tried manually ensuring the code went to bus 1 in case the autodetect failed, and am getting the same results.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: LCD+button I2c error on RaspPi

Post by adafruit »

what file are you editing to set the bus to 1?

User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

Re: LCD+button I2c error on RaspPi

Post by mapledyne »

In AdaFruit_CharLCDPlate.py, I did this to test it:

Code: Select all

if __name__ == '__main__':

    lcd = Adafruit_CharLCDPlate(busnum = 1)
And changed a similar line in LCDTest.py when testing with that file. Could this be being overridden somewhere else?

User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

Re: LCD+button I2c error on RaspPi

Post by mapledyne »

Earlier I also tried to change the Adafruit_I2C.py file in the __init__ section from:

Code: Select all

self.bus = bus;
to

Code: Select all

self.bus = smbus.SMBus(1);
But wasn't as confident in this, so have changed it back to the original currently.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: LCD+button I2c error on RaspPi

Post by adafruit »

Hmm, are you running occidentalis or wheezy?

User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

Re: LCD+button I2c error on RaspPi

Post by mapledyne »

I'm using Wheezy (technically Raspian, which as I understand it is slightly different that Wheezy).

User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

Re: LCD+button I2c error on RaspPi

Post by mapledyne »

Any thoughts?

Thanks!
Michael

User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

Re: LCD+button I2c error on RaspPi

Post by mapledyne »

Update:

Since I really haven't known how to troubleshoot this with the i2c control, and I have the other code all finished at this point to test out with the project (I'd hope to have been long done by now, but such is projects), I've desoldered the LCD from the i2c set and have it wired separately directly to the Pi. This works, but is far from what I'd like, since the original plan was to keep this on the i2c lines to free up wiring. At least this extra testing has confirmed that the LCD works properly.

Are there other resources I could look into on how to resolve this problem, or other help you could provide? Support seems to point only to these forums, and I don't really know where else to turn for help with this interface.

Thanks!
Michael

User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

Re: LCD+button I2c error on RaspPi

Post by mapledyne »

Any luck?

Is there anything else I can look at on my end to help out with this?

Thanks,
Michael

User avatar
mapledyne
 
Posts: 12
Joined: Tue Jan 11, 2011 12:52 am

Re: LCD+button I2c error on RaspPi

Post by mapledyne »

Just touching base again.

Ultimately, I've moved on to another company's product to get this to work - getting the new LCD shipped in was faster, apparently, than getting technical support here.

I'd still like to get this to work (or return them?) for use in a future project instead of just having the parts go unused since they aren't functional.

Anything I can do to try?

Thanks for any reply to know you're still reviewing this,
Michael

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: LCD+button I2c error on RaspPi

Post by adafruit »

mktacoma wrote:Just touching base again.

Ultimately, I've moved on to another company's product to get this to work - getting the new LCD shipped in was faster, apparently, than getting technical support here.

I'd still like to get this to work (or return them?) for use in a future project instead of just having the parts go unused since they aren't functional.

Anything I can do to try?

Thanks for any reply to know you're still reviewing this,
Michael
please contact [email protected]

thanks!
adafruit support, phil

diptopratyaksa
 
Posts: 1
Joined: Thu Feb 07, 2013 8:40 pm

Re: LCD+button I2c error on RaspPi

Post by diptopratyaksa »

Hi, i had the same error, when accessing 0x20 but imfound a perfect solution.

Test your lcd using LCDtest.py
A minor modification is required to the 'busnum' variable. Please change 0 to 1 if younare using wheezy 256mb raspberry.

Lcd = Adafruit_CharLCDPlate(busnum = 1)

Save and run the file
Sudo python LCDtest.python

It works beautifully and the buttons actualltnchange the screen colours.

Now with the Adafruit_CharLCDPlate.py file younhave to change the bus number in two places
Def __init__(self, busnum=1, pin_rs.............Morecodeshere

And

Lcd = Adafruit_CharLCDPlate(busnum=1)


Save and exit.
Sudo Adafruit_CharLCDPlate.py

And it works!!

Ill post the solution in my blog http://www.linuxcircle.com

Locked
Please be positive and constructive with your questions and comments.

Return to “Glowy things (LCD, LED, TFT, EL) purchased at Adafruit”