LCD+button I2c error on RaspPi
Moderators: adafruit_support_bill, adafruit

LCD+button I2c error on RaspPi

by mktacoma on Mon Dec 31, 2012 1:28 pm

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
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by adafruit on Wed Jan 02, 2013 8:11 pm

what happens if you run sudo python adafruit_charlcdplate.py?
User avatar
adafruit
 
Posts: 11682
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: LCD+button I2c error on RaspPi

by mktacoma on Thu Jan 03, 2013 11:19 am

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 .XXXXXXXXXXXXXXX
20: XX XX XX XX XX XX XX XX ff XX XX XX XX XX XX XX XXXXXXXX.XXXXXXX
30: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
40: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
50: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
60: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
70: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
80: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
90: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
a0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
b0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
c0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
d0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
e0: XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XX XXXXXXXXXXXXXXXX
f0: XX XX XX XX ff XX XX XX XX XX XX XX XX XX XX XX XXXX.XXXXXXXXXXX


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: -- -- -- -- -- -- -- --
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by mktacoma on Thu Jan 03, 2013 11:21 am

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.
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by adafruit on Thu Jan 03, 2013 11:27 am

what file are you editing to set the bus to 1?
User avatar
adafruit
 
Posts: 11682
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: LCD+button I2c error on RaspPi

by mktacoma on Thu Jan 03, 2013 11:51 am

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


Code: Select all | TOGGLE FULL SIZE
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?
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by mktacoma on Thu Jan 03, 2013 11:54 am

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

Code: Select all | TOGGLE FULL SIZE
self.bus = bus;


to

Code: Select all | TOGGLE FULL SIZE
self.bus = smbus.SMBus(1);


But wasn't as confident in this, so have changed it back to the original currently.
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by adafruit on Sat Jan 05, 2013 4:23 pm

Hmm, are you running occidentalis or wheezy?
User avatar
adafruit
 
Posts: 11682
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: LCD+button I2c error on RaspPi

by mktacoma on Sat Jan 05, 2013 5:16 pm

I'm using Wheezy (technically Raspian, which as I understand it is slightly different that Wheezy).
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by mktacoma on Sat Jan 12, 2013 1:25 pm

Any thoughts?

Thanks!
Michael
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by mktacoma on Tue Jan 15, 2013 5:24 pm

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
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by mktacoma on Mon Jan 21, 2013 6:00 pm

Any luck?

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

Thanks,
Michael
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by mktacoma on Thu Jan 24, 2013 1:23 pm

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
mktacoma
 
Posts: 12
Joined: Mon Jan 10, 2011 11:52 pm

Re: LCD+button I2c error on RaspPi

by adafruit on Thu Jan 24, 2013 1:26 pm

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 support@adafruit.com

thanks!
adafruit support, phil
User avatar
adafruit
 
Posts: 11682
Joined: Thu Apr 06, 2006 3:21 pm
Location: nyc

Re: LCD+button I2c error on RaspPi

by diptopratyaksa on Wed Mar 06, 2013 5:33 am

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
diptopratyaksa
 
Posts: 1
Joined: Thu Feb 07, 2013 7:40 pm