XBMC OpenELEC and LCD HD44780 via GPIO


109 posts   Page 2 of 5   1, 2, 3, 4, 5
by texy » Sat Dec 08, 2012 12:51 am
....then try raspbmc ;-)
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2355
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by texy » Sat Dec 08, 2012 11:15 am
OK, so I,ve gone back to the original hd44780.so file and still no joy. What I don't understand, and this applies to either my v1 or v2 rpi's, is that if I force an incorrect setting in the conf file, for example, if I make one of the databus line something that it isn't actually wired too, then i would expect the usual top line to be full of blocks. Now although this DOES happen, the backlight doesn't come on. The backlight is independant of the LCD and shouldn't be affected, but it is. Confused.
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2355
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by canibalimao » Sat Dec 08, 2012 1:37 pm
Can't you try it with another screen? The first time I connect the screen to the RPi, without any configuration at all, the block appeared on the first line, so even if you have the program wrong in any line, it should show anything.
Try with another one and see what happens...
Posts: 536
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal
by texy » Sat Dec 08, 2012 1:52 pm
The display is good - it works with my v1 RPi.
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2355
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by texy » Sun Dec 16, 2012 8:09 pm
So I delve a little further into the hd44780-rpi.c file and I believe I can see the problem :

/* gpio pins 3, 5, 27 available on S5 */
static const int gpio_pins[] = { 0, 1, -1, -1, 4, -1, -1, 7,
8, 9, 10, 11, -1, -1, 14, 15,
-1, 17, 18, -1, -1, 21, 22, 23,
/* 8-31 accessible via board-id resistors R3-R10 */
24, 25, -1, -1, -28, -29, -30, -31 };

Needs to be changed to :
/* gpio pins 3, 5, 21 available on S5 */
static const int gpio_pins[] = { 0, 1, -1, -1, 4, -1, -1, 7,
8, 9, 10, 11, -1, -1, 14, 15,
-1, 17, 18, -1, -1, -1, 22, 23,
/* 8-31 accessible via board-id resistors R3-R10 */
24, 25, -1, 27, -28, -29, -30, -31 };


I made those changes, but this the package needs compiling into an hd44780.so file?
Any idea's how to do this?

Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2355
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by Serac » Sun Dec 23, 2012 2:12 pm
Updated paul_c's patch - Highlights include:

* Added backlight support
* Updated for Rev 2 boards
* Fixed a potential NULL pointer bug

To use, grab the latest sources from the LCDproc repository
Code: Select all
cvs -z3 -d:pserver:anonymous@lcdproc.cvs.sourceforge.net:/cvsroot/lcdproc co -P lcdproc


Copy the attached patch to the lcdproc directory and unzip it
Code: Select all
gunzip lcdproc-Pi-Rev2.patch.gz


Apply the patch
Code: Select all
patch -p0 < lcdproc-Pi-Rev2.patch


Run the autogen script to generate the configure & automake files
Code: Select all
bash ./autogen.sh


Configure with the Pi driver enabled
Code: Select all
./configure --enable-drivers=hd44780


make and make install completes the exercise - If yo already have lcdproc installed with a working config, then you may want to skip the install stage and do
Code: Select all
sudo cp server/drivers/hd44780.so /usr/lib/lcdproc/
Attachments
lcdproc-Pi-Rev2.patch.gz
(5.28 KiB) Downloaded 202 times
Posts: 124
Joined: Wed Jul 18, 2012 2:49 pm
by texy » Sun Dec 23, 2012 10:25 pm
Thanks for you work on this.....I,m not quite there yet. I removed my previous lcdproc installation and started from scratch with your instructions. Alls well until the make and make install commands where I get warnings and errors. There is no hd44780.so file in the lcdproc/server/drivers/ folder either, I,m guessing as a result of the failed compiltion.
Are there prerequisites for the make commands?
I,m kinda guessing that all that is needed for previously working installs is a new hd44780.so file ?

Cheers,
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2355
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by Serac » Mon Dec 24, 2012 9:16 pm
Looks like one or two people might be having trouble with pkg-config.. In which case, try:

Code: Select all
./configure --enable-drivers=hd44780 --disable-libusb --disable-libusb-1-0 --disable-libhid --disable-libftdi --disable-freetype


If there are any errors or warnings generated by configure, don't waste time by saying make fails at.... We need to see the errors from configure before suggesting solutions.
Posts: 124
Joined: Wed Jul 18, 2012 2:49 pm
by kronflux » Wed Dec 26, 2012 9:41 am
It seems like this might work, however I'm not entirely sure how to add this to the main repo for OpenELEC. It seems when you build OpenELEC from source, it downloads the lcdproc source as a tar.gz file, and checks it against an md5 sum, so I can't just edit the tar.gz file.
And of course, in trying to compile lcdproc on its own, I got a lovely " hd44780-rpi.c:284:2: error: 'PrivateData' has no member named 'rpi_gpio' " message.

Also, I seem to be extremely slow at building the package. Took over a day for my system to compile it, which is just silly.

Is there any way someone can upload a build with Revision 2 support, so I don't have to try building it again?
Posts: 6
Joined: Wed Dec 26, 2012 9:16 am
by Serac » Wed Dec 26, 2012 11:03 am
kronflux wrote:And of course, in trying to compile lcdproc on its own, I got a lovely " hd44780-rpi.c:284:2: error: 'PrivateData' has no member named 'rpi_gpio' " message.


That should not happen as rpi_gpio is declared at line 161 in hd44780-low.h... Unless your compiler is not defining the __ARMEL__ flag. This can be checked with
Code: Select all
gcc -dM -E - < /dev/null | sort


In the meantime, after unzipping it, copy the attached file to /usr/lib/lcdproc/ - Assuming your install follows the Debian/Raspian layout.
Attachments
hd44780.so.gz
precompiled LCDproc HD44780 driver with support for Rev1/2 Pi.
(30.57 KiB) Downloaded 182 times
Posts: 124
Joined: Wed Jul 18, 2012 2:49 pm
by canibalimao » Wed Dec 26, 2012 1:55 pm
texy, today i had intalled the raspbmc on my RPi and now I've this working really well :D
I just need to figure out how to optimize the information displayed. The info is displayed correctly, I just need to know what kind of things I can put it showing, like weather and that kind of stuff.

Thank you for the help :D
Posts: 536
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal
by kronflux » Wed Dec 26, 2012 7:54 pm
Serac wrote:
kronflux wrote:And of course, in trying to compile lcdproc on its own, I got a lovely " hd44780-rpi.c:284:2: error: 'PrivateData' has no member named 'rpi_gpio' " message.


That should not happen as rpi_gpio is declared at line 161 in hd44780-low.h... Unless your compiler is not defining the __ARMEL__ flag. This can be checked with
Code: Select all
gcc -dM -E - < /dev/null | sort


In the meantime, after unzipping it, copy the attached file to /usr/lib/lcdproc/ - Assuming your install follows the Debian/Raspian layout.


Hm. I entirely forgot that the OpenELEC builds for the Raspberry Pi are Read-Only, so apparently I'm going to have to implement this into the source somehow and build a new copy. Unless someone knows a way to add files to the read only filesystem..
Posts: 6
Joined: Wed Dec 26, 2012 9:16 am
by Boeeerb » Thu Dec 27, 2012 9:41 am
texy wrote:So I delve a little further into the hd44780-rpi.c file and I believe I can see the problem :

/* gpio pins 3, 5, 27 available on S5 */
static const int gpio_pins[] = { 0, 1, -1, -1, 4, -1, -1, 7,
8, 9, 10, 11, -1, -1, 14, 15,
-1, 17, 18, -1, -1, 21, 22, 23,
/* 8-31 accessible via board-id resistors R3-R10 */
24, 25, -1, -1, -28, -29, -30, -31 };

Needs to be changed to :
/* gpio pins 3, 5, 21 available on S5 */
static const int gpio_pins[] = { 0, 1, -1, -1, 4, -1, -1, 7,
8, 9, 10, 11, -1, -1, 14, 15,
-1, 17, 18, -1, -1, -1, 22, 23,
/* 8-31 accessible via board-id resistors R3-R10 */
24, 25, -1, 27, -28, -29, -30, -31 };


I made those changes, but this the package needs compiling into an hd44780.so file?
Any idea's how to do this?

Texy


Hello Texy, now the business of christmas is done I can finally get back to Pi stuff and will have a play, I've tried the default wiring on both rev 1 and 2 boards and the LCD screen works on them.
What is your pin wiring so I can try your schematic?
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk
User avatar
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
by texy » Thu Dec 27, 2012 12:24 pm
Hi Boeeerb,
as you can see from the thread, Serac has done a sterling job looking at this over the last few days. I had a lot of trouble compiling the code, but got there eventually.
However, neither my compiled version, or the hd44780.so file posted by Serac above works on my v1 rpi, let alone my v2. The last code working with my v1 rpi and with backlight is the version you posted on the 7th November. FYI, my LCD uses the following GPIO lines :
LCD_RS = 17
LCD_E = 4
LCD_D4 = 24
LCD_D5 = 22
LCD_D6 = 23
LCD_D7 = 21 # 21 for v1, 27 for v2 RPi
LCD_LED = 18

It was unfortunate that I chose pin 21 as that becomes pin 27 on the v2 boards, but there you go.
Cheers,
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2355
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by delinend » Thu Dec 27, 2012 12:50 pm
Hi.

I follow this tread, and got my HD44780 to work, on my RaspPi v1, but not on v2. Thank all.. :-)
I'm wondering.. In the new r12755 release (24 dec 2012), I now can select hd44780 in the Openelec LCD settings. Do I still have to install LCDproc/GPIO, to get it to work? And compile my one Openelec..

Best regards.
Posts: 19
Joined: Thu Dec 27, 2012 12:43 pm
by texy » Thu Dec 27, 2012 1:04 pm
texy wrote:Hi Boeeerb,
as you can see from the thread, Serac has done a sterling job looking at this over the last few days. I had a lot of trouble compiling the code, but got there eventually.
However, neither my compiled version, or the hd44780.so file posted by Serac above works on my v1 rpi, let alone my v2. The last code working with my v1 rpi and with backlight is the version you posted on the 7th November. FYI, my LCD uses the following GPIO lines :
LCD_RS = 17
LCD_E = 4
LCD_D4 = 24
LCD_D5 = 22
LCD_D6 = 23
LCD_D7 = 21 # 21 for v1, 27 for v2 RPi
LCD_LED = 18

It was unfortunate that I chose pin 21 as that becomes pin 27 on the v2 boards, but there you go.
Cheers,
Texy


OK, slight update. In fact the display IS working with my compiled hd44780.so file, however, the backlight isn't enabled, so i couldn't see anything on the screen. This is with my v1 rpi.
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2355
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by texy » Thu Dec 27, 2012 1:22 pm
....also now working with my v2 rpi, but still no backlight.

Rgds,
Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2355
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by delinend » Thu Dec 27, 2012 3:49 pm
Anyone knows, how to edit /etc/LCDd.conf in openelec ? It's a read-only system :-(
Do I have to compile hole openelec, just to make a change in the LCDd.conf. I have tryet to place a copy in ~/.config/LCDd.conf, but it will not write it to /etc/LCDd.conf, when rebooting.

Best regards.
Posts: 19
Joined: Thu Dec 27, 2012 12:43 pm
by texy » Thu Dec 27, 2012 3:58 pm
You should be able to use
Code: Select all
sudo nano /etc/LCDd.conf


Texy
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2355
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by delinend » Thu Dec 27, 2012 4:04 pm
Hi Texy

Sorry.. But openelec says: sudo: command not found
The hole SYSTEM is mounted in read-only LOOP, so I can't edit with VI or Nano.

Best regards.
Posts: 19
Joined: Thu Dec 27, 2012 12:43 pm
by delinend » Thu Dec 27, 2012 4:16 pm
The reason why I want to change the /etc/LCDd.conf setting in openelec, is that I now can see, that LCDproc and the HD44780 driver now is inplemented from release r12755 of openelec. Including LCD HD44780 setting in XBMC/openelec. But I have to change the GPI settings :-(

Best regards.
Posts: 19
Joined: Thu Dec 27, 2012 12:43 pm
by canibalimao » Thu Dec 27, 2012 4:25 pm
I had the same problem as you. It's impossible to edit files throw SSH. The system don't have a lot of functions that we use in raspbian, i.e. apt-get, nano, etc.
If you can't put the SD card in a computer and edit the content of that file (you should run linux, I think) the only way is to recompile all the system.

I follow an easier way: forget OpenELEC and use raspbmc. On raspbmc you can use almost all the functions/programs that you use in raspbian.
Posts: 536
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal
by Boeeerb » Thu Dec 27, 2012 5:07 pm
I have yet to use openelec but have you tried logging in as root? Not sure the password, you might have to try a combination to find it but it could be that Pi user has not been given enough privileges even with sudo. Worth a shot?
Find me on Twitter - @Boeeerb
Website - http://www.boeeerb.co.uk
User avatar
Posts: 43
Joined: Thu Sep 27, 2012 2:40 am
by canibalimao » Thu Dec 27, 2012 5:26 pm
I don't think the problem is being or not root. Even if you login as root you won't have access to "nano" and those things... Try to edit the file on a linux computer and see what happens. You can use a virtual machine to do that.
Posts: 536
Joined: Tue Aug 07, 2012 8:48 pm
Location: Portugal
by delinend » Thu Dec 27, 2012 5:35 pm
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.
Posts: 19
Joined: Thu Dec 27, 2012 12:43 pm