User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Thu Dec 27, 2012 5:49 pm

delinend wrote:When I take the openelec SD card to another machine/SD card reader, there is no access to the /etc directory. Most of the openelec, is in the SYSTEM file, that is mounted when openelec is booting. :-(

Btw. Nano is in openelec add-on's.

Best regards.
Is your other machine windows or linux?
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

canibalimao
Posts: 556
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Thu Dec 27, 2012 5:54 pm

Are you shure you can't get access to that folder? Even if you try to see hidden folders?

It is? So try it and see if you get results. That could be a very good help for some people here!

kronflux
Posts: 6
Joined: Wed Dec 26, 2012 9:16 am

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Thu Dec 27, 2012 8:27 pm

Many people seem to be confused about OpenELEC, and seem to think that A) you can edit most files, B) that it comes with nano, and C) that it has sudo.
One of the many benefits to OpenELEC is that it is a stripped down linux distro, which is designed entirely around being a media center. NOT a regular linux distro.
The filesystem is READ ONLY. This means that files such as the /etc/LCDd.conf are NOT able to be edited.
The same goes for pre-compiled drivers(hd44780.so), the files cannot replace existing files, as the filesystem is read-only.

The way to edit this file is to copy it to the storage directory

Code: Select all

cp /etc/LCDd.conf /storage/.config/LCDd.conf
and edit it from there. Note that vi is available for editing, and for those who aren't familiar with vi, you can also use an sftp client to connect to the pi and edit the files accordingly.
(Apparently Nano is also available via OpenELEC's addons, so you can also take a look there)

That being said, it seems that the method used in this post is ONLY for the FIRST revision of the Raspberry Pi board. The Second revision is currently not working, however there is a patch a page or two back in the comments to make it work again. Unfortunately, this patch doesn't seem to work the same way as the patch mentioned in the post(you can't just throw it in the patches folder and hope for the best)
I have yet to get my LCD working so far, as it takes forever to compile, and its very trial and error based.
I hope to take another look at it sometime tomorrow and hopefully I'll figure out a way to compile OpenELEC with the new patch.

If anyone else gets around to this before me, please upload your build somewhere, or your working updated patch. If I get to it first, I will try and upload it as well if it works.

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 4:03 am

@Texy

This seems to work with both my rev1 and rev2 using your pinout for both, displays information and switches on and off the backlight successfully.

Just replace your HD44780.so file with this : https://dl.dropbox.com/u/29632026/hd44780.so

I haven't added checks for no backlight or setting the same pin but functionally works
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 8:56 am

Also here's a Python script to show the backlight in operation...
http://dl.dropbox.com/u/29632026/temp.py

Once you copied into your location of choice, type "sudo python temp.py" and the temperature and cpu speed will show up and start to flash the backlight. Unless you have a 16x2 then it might not show the entire text.
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

texy
Forum Moderator
Forum Moderator
Posts: 5004
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 11:28 am

Brilliant! All now working as it should do. The python program also looks very interesting and I will be taking a closer look at that code.
Many thanks again,
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

delinend
Posts: 20
Joined: Thu Dec 27, 2012 12:43 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 1:43 pm

I can confirm, that Serac's compiled hd44780.so.gz is working on v1 and v2. :D
But I have no luke, to make a openelec setup with it. But I used Raspbmc.

Here what i did on a fresh Raspbmc:

Code: Select all

sudo apt-get install lcdproc

Code: Select all

mkdir /home/pi/lcdproc
copy Serac's hd44780 to /home/pi/lcdproc
Made change in /etc/LCDd.conf
DriverPath=/home/pi/lcdproc/
Driver=hd44780
ConnectionType=rpi
D7=22
D6=21 (v1) or 27 (v2)
D5=17
D4=23
RS=25
EN=24

Is there plans, to get the new hd44780.so implemented in the LCDproc, and in the openelec dist ?

Thanks Serac for your help. :)

Best regards.

soundsk
Posts: 4
Joined: Fri Dec 28, 2012 1:47 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 2:11 pm

Hi!

Just got my first couple of RPi's in the mail, and I'm loving them so far.

With the help of this thread and Boeeerb's tutorial, the process is really quite simple.
So I would like to thank everyone that contributed to this thread and Boeeerb for his tutorial and driver.
Just in case it matters to anyone, I'm using a 20x4 HD44780 with the latest XBian release.

One question though:
I tweaked XBMC's LCD.xml file to my liking and avoid scrolling text as much as I could, but it is really bugging me.
Is there any way I can change the scrolling speed of the text, to slow it way down? I tried the TitleSpeed in LCDd.conf to 1 (was 10), but I noticed no difference, so perhaps this is handled elsewhere, any ideas where?

Cheers! Zico

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 4:28 pm

Glad you got it working Zico, I can't remember off the top of my head if you put it in LCD.xml or you create advancedsettings.xml (you'll need to create this file with sudoku nano advancedsettings.xml) but you'll put something like this in :
<lcd>
<scrolldelay>2</scrolldelay>
</lcd>
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 4:29 pm

Boeeerb wrote:Glad you got it working Zico, I can't remember off the top of my head if you put it in LCD.xml or you create advancedsettings.xml (you'll need to create this file with sudoku nano advancedsettings.xml) but you'll put something like this in :
<lcd>
<scrolldelay>2</scrolldelay>
</lcd>
Damn you autocorrect!
It's sudo not sudoku
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

soundsk
Posts: 4
Joined: Fri Dec 28, 2012 1:47 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 5:07 pm

Boeeerb wrote:
Boeeerb wrote:Glad you got it working Zico, I can't remember off the top of my head if you put it in LCD.xml or you create advancedsettings.xml (you'll need to create this file with sudoku nano advancedsettings.xml) but you'll put something like this in :
<lcd>
<scrolldelay>2</scrolldelay>
</lcd>
Damn you autocorrect!
It's sudo not sudoku
Eheheh that one was funny!
And once again you're right on the money, just added that to advancedsettings.xml, rebooted and voilá, scroll speed was slower. 2 however, was still a bit too quick for my display, so I set it to 5, it's quite slow, but at least you can read it.
Thanks again, Jason, really appreciate the help!

I have a feeling I'll be ordering quite a few more RPi's in the very near future... :twisted:

Best regards, Zico

kronflux
Posts: 6
Joined: Wed Dec 26, 2012 9:16 am

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 9:06 pm

delinend wrote:I can confirm, that Serac's compiled hd44780.so.gz is working on v1 and v2
copy Serac's hd44780 to /home/pi/lcdproc
Made change in /etc/LCDd.conf
DriverPath=/home/pi/lcdproc/
Driver=hd44780
ConnectionType=rpi
D7=22
D6=21 (v1) or 27 (v2)
D5=17
D4=23
RS=25
EN=24
I seem to have gotten the driver working on OpenELEC by copying the LCDd.conf to /storage/.config and creating a new directory under /storage/.config called lcdproc, then edited the LCDd.conf DriverPath to point to there.
Now it's autostarting on boot, but the LCD is still showing all the top blocks.
I noticed D6 says GPIO27 for the V2 - what pin would that be? (for example, GPIO18 is pin 12, 23 is 16, etc)
I'm just wondering if I have mine wired wrong, or if the wiring needs to change for the V2.
"When you connect LCD GND, V0 and +5V you should see all upper row displaying rectangles."
this is exactly what I have.
I've even tried setting xbmc's openelec lcd setting to hd44780.
Any thoughts?

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Fri Dec 28, 2012 9:19 pm

Double check D7 too as I noticed the LCD does nothing if just D7 is incorrect.

Here's the pinout - http://elinux.org/File:GPIOs.png
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

texy
Forum Moderator
Forum Moderator
Posts: 5004
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Sat Dec 29, 2012 8:10 am

It'll only take 1 GPIO line to be incorrectly declared for the display to show a top row of blocks, with the exception of the backlight of course.
Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

delinend
Posts: 20
Joined: Thu Dec 27, 2012 12:43 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Sat Dec 29, 2012 8:28 am

Thanks kronflux. :-)

Your soloution to openelec work for me, on v1 and v2.
I just copyed Cerac's hd44780.so to a new directory /storage/.config/lcdproc and copyed LCDd.conf to /storage/.config/ where I edit it. Verry simple..

Yes there are many LCD pin/GPIO connectiones types. And I use this on: http://learn.adafruit.com/assets/1757
The problem with this setup, is the change from GPIO21 in v1 to GPIO27 in v2 (Pin #13 on J1). But Cerac have solved this problem, in the new hd44780.so driver :-)

You can use any other GPIO setup, and just change them in the LCDd.conf file.

The problem might be, to make this setup, in a permanent openelec release, without copy and editing files.

Thanks to all, who works on the hd44780 GPIO project :-)

Best regards.

delinend
Posts: 20
Joined: Thu Dec 27, 2012 12:43 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Sun Jan 27, 2013 4:11 pm

Hi.

Regarding Backlight (BL=18 on GPIO), when do openELEC/XBMC turns it on and off? On Screensaver or other ??

Best regards.

Serac
Posts: 124
Joined: Wed Jul 18, 2012 2:49 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Sun Jan 27, 2013 5:46 pm

delinend wrote:The problem might be, to make this setup, in a permanent openelec release, without copy and editing files.
That may be a little easier now - A dedicated driver for the Raspberry Pi has now been included in the LCDProc CVS repository. The next official release should include it, but as yet, no date set for a v0.5.7 release. Both Rev1 and Rev2 boards are supported as is the use of a backlight (but do watch the interfacing as your Pi could be potentially exposed to 5V).

In the meantime, use the CVS sources (or one of the nightly tarballs) as per the LCDProc website. Don't forget, you should be able to use any of the USB, Serial, i2c, or Ethernet connected LCDs using the standard drivers.

delinend
Posts: 20
Joined: Thu Dec 27, 2012 12:43 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Mon Jan 28, 2013 9:35 am

Thanks Serac.

So there is no compiled releases of hd44780.so, other than on this thread ?
Btw. When dos XBMC use the Backlight control? On screensaver or sleep/standby, other ?

Best regards.

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Mon Jan 28, 2013 9:49 am

Not currently having a setup to test as far as I know you can set (check with google) the tag dimonscreensaver in either LCD.xml or advancedsettings.xml and this will allow the screen backlight to turn off when the screensaver kicks in
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

holmez
Posts: 31
Joined: Sat Mar 31, 2012 6:39 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Sun Feb 10, 2013 11:07 am

Hello, I hope someone here will be able to help me solve the problem I'm getting with a corrupt display on an LCD screen.

I followed the tutorial on tech-fruits, which worked (almost) perfectly (many thanks for the great tutorial).
I have a fully HD44780 compatible 16x1 screen on raspbian.
When I turn my pi on, I get the HD47780 message, followed by the LCDproc server message.
Then it displays Home, followed by the XBMC Running... message.
About 4 seconds later, it corrupts completely, displaying nothing but gibberish. I've tried changing the delay setting, and searching here and on lcdproc.org for help. Based on what I've read I suspect the problem is with the lcdProc server, and not XMBC - which simply sends what it wants displaying to 127.0.0.1: 13666.

How can I fix this?

If I restart the LCDproc server, then it works perfectly for the rest of the time, but this isn't the ideal solution really.

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Sun Feb 10, 2013 2:13 pm

Glad the tutorial helped, have you got the setup on a breadboard? If so check all the connections are tight as a loose connection can result in gibberish. Also inspect the LCD itself for poor soldering. To restart run the " sudo /etc/init.d/LCDd restart " command, Xbmc will reconnect after a few seconds itself
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

holmez
Posts: 31
Joined: Sat Mar 31, 2012 6:39 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Sun Feb 10, 2013 9:42 pm

Thanks for your prompt reply boeeerb. It is connected on a breadboard, I have checked the connections again, but can find no loose connections.
It seems consistent in that it is always a matter of seconds after XMBC has started that the display corrupts.
Running sudo /etc/init.d/LCDd restart fixes the problem until the pi is physically switched off and on again. Even a soft reboot doesn't cause any corruption.

User avatar
Boeeerb
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
Contact: Website

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Mon Feb 11, 2013 12:54 am

Thats strange, I've not had any problem like that to date with my 2 displays, but I haven't used any of the new builds of Raspbmc, but I'll give it a go during the week. If not it could be a funny display messing about
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk

texy
Forum Moderator
Forum Moderator
Posts: 5004
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Wed Feb 13, 2013 3:48 pm

Its a 16 x 1 display though - the very smallest configuration you can get I believe. Maybe there is not enough lines, and display memory is getting corrupt, or something. Perhaps you should upgrade to 16 x 2 or more?

Texy
Various male/female 40- and 26-way GPIO header for sale here ( IDEAL FOR YOUR PiZero ):
https://www.raspberrypi.org/forums/viewtopic.php?f=93&t=147682#p971555

holmez
Posts: 31
Joined: Sat Mar 31, 2012 6:39 pm

Re: XBMC OpenELEC and LCD HD44780 via GPIO

Wed Feb 13, 2013 10:51 pm

Apologies for not tinkering and updating since - seem to be having a busy week.
Would be nice to have the 16x1 working first.
Just wondering if there was any way of switching logging on - I notice the ReportLevel and ReportToSyslog options in the configuration file and am wondering if setting these will give me a log of everything sent to the screen.

Return to “Media centres”

Who is online

Users browsing this forum: No registered users and 8 guests