tompreston / pifacecad-lcdproc

LCDproc patch for PiFace Control and Display support.
0 stars 0 forks source link

No LCD in Raspbmc #1

Open barcoboy opened 10 years ago

barcoboy commented 10 years ago

Trying to get the LCDProc patch working for my PiFace Control and Display board in Raspbmc. I followed the directions on the patch page , and was able to apply the patch successfully to LCDProc and then the configure --with-driver=hd44780 and make worked fine. I installed the LCDProc addon in Raspbmc, and when I run the server in the foreground with the command sudo server/LCDd -r 5 -f -c LCDd.conf, I can see that Raspbmc is connecting to it (I also see the popup on my TV screen), and the following is displayed in my SSH window:

Server running in foreground Listening for queries on 127.0.0.1:13666 screenlist_init() driver_load(name="hd44780", filename="server/drivers/hd44780.so") HD44780: using ConnectionType: pifacecad hd44780: Using hd44780_default charmap HD44780: PiFaceCAD: Using device '/dev/spidev0.1' HD44780: pifacecad: initialised Key "Escape" is now reserved exclusively by client [-1] Key "Enter" is now reserved shared by client [-1] Key "Up" is now reserved shared by client [-1] Key "Down" is now reserved shared by client [-1] screenlist_process() screenlist_switch(s=[_server_screen]) screenlist_switch: switched to screen [_server_screen] screenlist_process() screenlist_process() screenlist_process() ... Connect from host 127.0.0.1:50242 on socket 5 screenlist_process() Client on socket 5 added added screen "xbmc" screenlist_process() screenlist_process: High priority screen [xbmc] selected screenlist_switch(s=[xbmc]) screenlist_switch: switched to screen [xbmc] screenlist_process() screenlist_process() screenlist_process() ... screenlist_switch(s=[xbmc]) screenlist_process() screenlist_switch(s=[xbmc]) screenlist_process() screenlist_switch(s=[xbmc]) screenlist_process() screenlist_switch(s=[xbmc]) (repeated until I hit CTRL-C)

However, my LCD stays blank.

I believe that SPI support is compiled into the Raspbmc kernel, as I see the following two lines via dmesg | grep spi

bcm2708_spi bcm2708_spi.0: master is unqueued, this is deprecated bcm2708_spi bcm2708_spi.0: SPI Controller at 0x20204000 (irq 80)

I can also see that /dev/spidev0.0 and /dev/spidev0.1 exist.

I know my LCD works fine, as I was able to test it in Raspian using the PiFace CAD Quickstart Guide procedure, and the sysinfo.py script works fine.

tompreston commented 10 years ago

Hi again. Just wanted to let you know that I got it working with the distribution Xbian (http://www.xbian.org) by > following your steps with these modifications:

  • Perform normal setup of XBian, enable networking
  • SSH to box with username xbian and password raspberry
  • Exit from menu system to get to shell prompt, then run

sudo su (prevents you from having to type sudo before every command) cd /usr/src mkdir software cd software apt-get update apt-get install autoconf apt-get install automake apt-get install build-essential

  • Download, patch, configure, and make LCDProc sources per your README file, but before running the LCDd > server, run the command:

modprobe spi_bcm2708

  • Install the XBMC LCDProc addon, and watch the display light up! :-)

Ah I forgot about the SPI module. More detailed instructions here: http://piface.github.io/pifacecommon/installation.html#enable-the-spi-module

I'll add this to the README. Does this solve your Raspbian problem?

barcoboy commented 10 years ago

Sorry for the delay... I had to reinstall Raspbmc after I had replaced it with Xbian.

Ran through the procedure again, but still no LCD. The problem with Raspbmc is that SPI support is compiled into the kernel, so there is no spi_bcm2708 module to load. Googling on building additional modules and it doesn't look like much fun. It's strange though, I can see these files on my Pi, which leads me to believe that SPI bcm2708 support is built into the kernel:

/sys/devices/platform/bcm2708_spi.0 /sys/devices/platform/bcm2708_spi.0/driver /sys/devices/platform/bcm2708_spi.0/modalias /sys/devices/platform/bcm2708_spi.0/power /sys/devices/platform/bcm2708_spi.0/spi_master /sys/devices/platform/bcm2708_spi.0/spi_master/spi0 /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/device /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/power /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0 /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/driver /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/modalias /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/power /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/spidev /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/spidev/spidev0.0 /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/spidev/spidev0.0/dev /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/spidev/spidev0.0/device /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/spidev/spidev0.0/power /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/spidev/spidev0.0/subsystem /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/spidev/spidev0.0/uevent /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/subsystem /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.0/uevent /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1 /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/driver /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/modalias /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/power /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/spidev /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/spidev/spidev0.1 /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/spidev/spidev0.1/dev /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/spidev/spidev0.1/device /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/spidev/spidev0.1/power /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/spidev/spidev0.1/subsystem /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/spidev/spidev0.1/uevent /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/subsystem /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/spi0.1/uevent /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/subsystem /sys/devices/platform/bcm2708_spi.0/spi_master/spi0/uevent /sys/devices/platform/bcm2708_spi.0/subsystem /sys/devices/platform/bcm2708_spi.0/uevent

But can't get it to work.

One other step I had to do in Raspbmc was "apt-get install pkg-config"... otherwise, these messages appear in the configure step (and make will fail):

checking if libusb support has been enabled... yes configure: WARNING: pkg-config not (fully) installed; drivers requiring libusb may not be built checking if libusb-1-0 support has been enabled... yes configure: WARNING: pkg-config not (fully) installed; drivers requiring libusb-1.0 may not be built checking if libftdi support has been enabled... yes configure: WARNING: pkg-config not (fully) installed; drivers requiring libftdi may not be built checking if X11 support has been enabled... yes configure: WARNING: pkg-config not (fully) installed; drivers requiring X11 may not be built checking if libhid support has been enabled... yes configure: WARNING: pkg-config not (fully) installed; drivers requiring libhid may not be built

tompreston commented 10 years ago

Have you tried libpifacecad or python3-pifacecad on Raspbmc?

barcoboy commented 10 years ago

Was able to download libpifacecad via git and compile everything successfully, but it too did not work. No errors were returned when running either ./example or ./pifacecad, but nothing on the display and no backlight.

As for python3-pifacecad, I downloaded from github pifacecad and installed it successfully, but when I tried to run the sysinfo.py example, I got the error:

Traceback (most recent call last): File "/usr/src/software/pifacecad/examples/sysinfo.py", line 5, in import pifacecad File "/usr/local/lib/python2.7/dist-packages/pifacecad/init.py", line 19, in from pifacecommon.interrupts import ( ImportError: No module named pifacecommon.interrupts

So I figured out I needed to install pifacecommon and did so, but then the error changed to:

Traceback (most recent call last): File "/usr/src/software/pifacecad/examples/sysinfo.py", line 5, in import pifacecad File "/usr/local/lib/python2.7/dist-packages/pifacecad/init.py", line 44, in from .ir import ( File "/usr/local/lib/python2.7/dist-packages/pifacecad/ir.py", line 4, in import lirc ImportError: No module named lirc

So I commented out the "import lirc" in the ir.py file, and then got this:

Traceback (most recent call last): File "/usr/src/software/pifacecad/examples/sysinfo.py", line 61, in cad = pifacecad.PiFaceCAD() File "/usr/local/lib/python2.7/dist-packages/pifacecad/core.py", line 50, in init self.init_board() File "/usr/local/lib/python2.7/dist-packages/pifacecad/core.py", line 80, in init_board h=self.hardware_addr, b=self.bus, c=self.chip_select)) pifacecad.core.NoPiFaceCADDetectedError: No PiFace Control and Display board detected (hardware_addr=0, bus=0, chip_select=1).

Again, nothing on the LCD, and no backlight.

tompreston commented 10 years ago

python3-pifacecad is in the main Raspbian repos, try installing that since it does some housekeeping first.

barcoboy commented 10 years ago

I do have it installed there, and it works fine in Raspbian. But I can't use apt-get under Raspbmc to install it as it tells me that it can't find either package python3-pifacecad or libpifacecad... thus I had to install it manually by downloading using git and then running python ./setup.py install.

keinstein commented 10 years ago

@tompreston python3-pifacecad is not in the main raspbian repos. It can be found in the repository of the raspberry foundation. I set up raspbian on another SD card and found (among others) the following differences:

pi@raspbmc:~$ cat /etc/apt/sources.list.d/raspi.list 
deb http://archive.raspberrypi.org/debian/ wheezy main
pi@raspbmc:~$ cat /etc/apt/sources.list.d/collabora.list 
deb http://raspberrypi.collabora.com wheezy rpi
pi@raspbmc:~$ dpkg -l collabora-rpifoundation-archive-keyring 
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
ii  collabora-rpif 0.2rpi1      all          GnuPG keys for the Collabora OBS 
pi@raspbmc:~$ 

With these archives installed I was able to install python{,3}-pifacecad. But it is still not detected. I got the same error message as @barcoboy got in his last try. I.e. my raspbi still compliains that it can't find pifaceCAD.

e6on commented 9 years ago

Any news of this problem? Did anyone get the pifacecad working under raspbmc?

Huti commented 9 years ago

Hello Everybody I am also curius about this. I stareted some investigation on my own as I am trying the same thing. What hapens when I am trying to run sysinfo.py is that https://github.com/piface/pifacecad/blob/master/pifacecad/core.py#L76 at this line self.iocon.value will be 0 and ioconfig 8 coming from pifacecommon.mcp23s17.HAEN_ON being 8. Can someone tell me what is this HAEN_ON?

Huti commented 9 years ago

I did some more investigating and i belive the spi kernel module is not available on raspbmc and that is why it won't work.

barcoboy commented 9 years ago

If I remember from my previous testing, I think that it is compiled into the kernel, and not as a module. Try running "dmesg | grep spi" after booting and see if anything comes up. Also, check to see if /dev/spidev0.0 and /dev/spidev0.1 exist... if they do, your system is ready for spi.