Crystal Fontz 635 help!



  • I have been trying to get the Crystal Fontz 635 LCD to work and I'm affraid that I have reached the end of my FreeBSD knowldege which is very little. I have built a custom box and this is the only piece that I can not get to work. I am able to turn the device on and off from the command line but that is about it. I have found some interesting threads on devices similar to mine but have not found one specific to my device. Here is what I have and what I have done. The device's usb port was not showing up on the Lcdproc menu so I edit the lcdproc.xml and lcdproc.inc and lCDd.conf files per the guide located here http://forum.pfsense.org/index.php/topic,23919.0.html the usb port is showing up now but the device is still not working, not sure what else to do. I belive it may be a driver issue. I'm willing to pay money to anyone who spends the time to make this work seamlessly or if you would like for me to buy you this screen and get it working I can do that too. I know that I can probably buy another screen but I would like to try to get this one to work. I don't want to waist more money and time. I would also like the ability to add custom text to the LCDproc package. If the driver for this device is not available I would like to have it made available to the package and have the package detect more usb ports. This would be my contribution to this wonderful project. I don't think that this would take a lot of time and willing to pay $100.


  • Netgate Administrator

    When you say not working what exactly do you mean?
    Are you seeing anything at all on the display?
    Have you selected the CFontzPacket driver?
    What are you seeing in the logs?

    What is the rest of your hardware? Any other useful information?

    Steve



  • make sure your selecting the the crystal fontz packact driver. i know this driver works with the current LCDproc package on the i386 platform.


  • Netgate Administrator

    The pfSense package uses lcdproc version 0.5.3.1, not the most recent. However the Crystal Fontz Packet driver has included support for the 635 since well before that so it should work.

    What is the output from usbconfig?

    Steve



  • Here is how I have the package setup.

    here is the following for the output of usbconfig:

    ugen0.1: <ohci root="" hub="" ati="">at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen1.1: <ohci root="" hub="" ati="">at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen2.1: <ohci root="" hub="" ati="">at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen3.1: <ohci root="" hub="" ati="">at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen4.1: <ohci root="" hub="" ati="">at usbus4, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen5.1: <ehci root="" hub="" ati="">at usbus5, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
    ugen1.2: <generic usb="" hub="" alcor="">at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=SAVE
    ugen3.2: <crystalfontz cfa635-usb="" lcd="" crystalfontz="">at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
    ugen1.3: <usb trackball="" logitech="">at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
    ugen1.4: <hp usb="" multimedia="" keyboard="" novatek="">at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON
    ugen1.5: <4 Port KVMSwicther No brand> at usbus1, cfg=0 md=HOST spd=LOW (1.5Mbps) pwr=ON

    and I add the following lines to the /usr/local/pkg/lcdproc.xml:

    <option><value>ugen3.2</value>
        <name>ugen3.2 (/dev/ugen3.2)</name></option>

    I also edited the /usr/local/pkg/lcdproc.inc as follows:

    case "ugen3.2":
        continue;
        break;

    and

    case "ugen3.2":
          $realport = "/dev/ugen3.2";
          break;

    The full lcdproc.xml can be found here sewellnj.dyndns-free.com/public_images/proclcd.xml.doc

    The full lcdproc.inc can be found here sewellnj.dyndns-free.com/public_images/proclcd.inc.doc

    The content of my logs show this:

    I have stopped the service and restarted it.

    The lcdproc.conf file is here sewellnj.dyndns-free.com/public_images/lcdproc.conf.doc
    Here is the output of dmesg sewellnj.dyndns-free.com/public_images/dmesg.doc

    Hardware that I'm running is the following:

    Motherboard: MSI FUZZY RS690T AMD ATI AM2+ MINI ITX HDMI MOTHERBOARD
    Processor    : AMD Athlon™ X2 Dual Core Processor BE-2350
    Memory      : 2GB DDR2
    NIC            : dual gigabit motherboard NICs + Dual Gigabit Intel PCI NIC
    LCD Screen: CrystalFontz 635
    Case          : NORCO RPC-230 2U Rackmount Server Case - OEM
    pfsense version: 2.0-RC3 (amd64)
    built on Wed Jul 27 13:16:07 EDT 2011

    My screen at the moment always looks like this:
    This is what my pfsense box looks like just in case others are interested:

    Thanks for any help you guys / gals can provide.</hp></usb></crystalfontz></generic></ehci></ohci></ohci></ohci></ohci></ohci>



  • Sorry for large Pic I resized them on my website but they are still showing large pics in IE.


  • Netgate Administrator

    Hmm, OK.
    So it looks like it's starting twice and then having a problem because it's using the same conf file.
    What does your lcdproc.sh file look like in /usr/local/etc/rc.d?

    Is either lcdd or lcdproc running? Use 'top' to view running processes.

    Steve



  • I have the same issue with LCDproc double starting. I posted this a couple of weeks ago. Something change on how packages are started. I believe the package itself needs to be looked at to fix the issue. I was able to make it work on my box. If you dont mind editing files, i've put the steps below. It may not be the right way but it works for me.

    Make sure everything is correct in your LCDproc settings, the screens you and such. 'Enable LCDproc' it and Save. Go back and uncheck 'Enable LCDproc'
        the above step makes sure settings are saved but by unchecking Enable, it wont start up..

    You can change folder locations if you want but this is what i did:

    create a folder called 'custom' under your root directory.
    put this file there with 755 permissions
    lcdclient.sh

    
    #!/bin/sh
    
    # script starts a lcd client and always keeps it active.
    counter=1
    while [ "$counter" -ne 0 ]
    do
    	# loop the client to drive the display
    	/usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php
    	sleep 1
    done
    
    

    create a file under /usr/local/etc/rc.d called 'lcddisplay.sh' with 755 permissions

    
    #!/bin/sh
    # This file was automatically generated
    # by the pfSense service handler.
    
    rc_start() {
    
    if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill 
    	sleep 1	
    fi
    if [ `ps auxw |awk '/lcdclient.s[h]/ {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk '/lcdclient.s[h]/ {print $2}'|xargs kill
    	sleep 1	
    fi
    if [ `ps auxw |awk 'lcdproc {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk 'lcdproc {print $2}'|xargs kill
    	sleep 1	
    fi
    
    	/usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf
    	/root/custom/lcdclient.sh &
    	sleep 5
    	lcdproc
    
    }
    
    rc_stop() {
    
    if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill 
    	sleep 1	
    fi
    if [ `ps auxw |awk '/lcdclient.s[h]/ {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk '/lcdclient.s[h]/ {print $2}'|xargs kill
    	sleep 1	
    fi
    if [ `ps auxw |awk 'lcdproc {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk 'lcdproc {print $2}'|xargs kill
    	sleep 1	
    fi
    
    }
    
    case $1 in
    	start)
    		rc_start
    		;;
    	stop)
    		rc_stop
    		;;
    	restart)
    		rc_stop
    		rc_start
    		;;
    esac
    
    

    Then you can maunally start it by typeing '/usr/local/etc/rc.d/lcddisplay.sh start' from the cmd line.  When you reboot your box, LCDproc should also start byself since the lcddisplay.sh will be executed on startup

    Hope this helps!



  • This is my lcdproc.sh:

    #!/bin/sh
    # This file was automatically generated
    # by the pfSense service handler.
    
    rc_start() {
    
    if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill 
    	sleep 1	
    fi
    if [ `ps auxw |awk '/lcdclient.s[h]/ {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk '/lcdclient.s[h]/ {print $2}'|xargs kill
    	sleep 1	
    fi
    
    	/usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf
    	/tmp/lcdclient.sh &
    
    }
    
    rc_stop() {
    
    if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill 
    	sleep 1	
    fi
    if [ `ps auxw |awk '/lcdclient.s[h]/ {print $2}'| wc -l` != 0  ]; then
    	ps auxw |awk '/lcdclient.s[h]/ {print $2}'|xargs kill
    	sleep 1	
    fi
    
    }
    
    case $1 in
    	start)
    		rc_start
    		;;
    	stop)
    		rc_stop
    		;;
    	restart)
    		rc_stop
    		rc_start
    		;;
    esac
    
    

    And this is the output of top:

      PID USERNAME  THR PRI NICE   SIZE    RES STATE   C   TIME   WCPU COMMAND
    41285 nobody      1  54    0  7936K  1648K nanslp  0 151:16 17.09% LCDd
    41650 root        1  66    0  8292K  1668K wait    0   0:33  0.00% sh
    58696 root        1  67    0  8292K  1668K wait    0   0:31  0.00% sh
    36313 root        1  64   20  5836K  1468K select  1   0:17  0.00% apinger
    12176 root        1  76   20  8292K  1720K wait    1   0:13  0.00% sh
     2748 root        1  44    0 19152K  4772K select  0   0:06  0.00% racoon
    46700 dhcpd       1  44    0 13056K  7668K select  0   0:04  0.00% dhcpd
    39941 root        1  44    0   104M 29624K accept  0   0:04  0.00% php
    17548 root        1  44    0 14772K  2796K select  1   0:03  0.00% syslogd
    40227 root        1  76    0   104M 24436K accept  1   0:03  0.00% php
    36983 root        1  44    0 25764K  5364K kqread  0   0:02  0.00% lighttpd
    18570 root        1  44    0 11768K  3972K bpf     1   0:02  0.00% tcpdump
    18810 root        1  44    0  5832K  1016K piperd  1   0:02  0.00% logger
    53890 root        3  64   20  7216K  1652K nanslp  0   0:01  0.00% filterdns
    47579 nobody      1  44    0 10144K  2936K select  0   0:01  0.00% dnsmasq
    14608 _dhcp       1  44    0  5832K  1572K select  0   0:01  0.00% dhclient
    39886 _ntp        1  44    0  5832K  1456K select  0   0:00  0.00% ntpd
    38682 root        1  45    0   104M 22472K accept  0   0:00  0.00% php
    15207 root        1  44    0  7980K  1556K nanslp  0   0:00  0.00% cron
    39687 root        1  76    0   100M 12312K wait    0   0:00  0.00% php
    37349 root        1  76    0   100M 12308K wait    0   0:00  0.00% php
    

    I see that LCDd is running but I don't see that lcdproc is running and I'm assuming that you need both?
    Cino I have not tried your work around yet, taking a look at it now. Thanks for the quick responses.


  • Netgate Administrator

    The LCDproc package runs differently to the way I have it installed on my firebox so I could be wrong.
    Looking at lcdproc.sh it appears the two processes you should see are lcdd and lcdclient.sh. You don't so it's not working.
    However with lcdd running but no client I expect the display to show some lcdd server info as in this post.
    The fact that is doesn't could indicate a driver problem. However I think you need to try Cino's fix above to make sure it's starting correctly. Or start the server manually at some point.

    Steve



  • No luck guys, still seems that it doesn't work. Even with Cino's work around.

    Here is my syslog information:


    At this point I'm not even sure the screen works since I have never seen anything other then the demo text on it.
    I am going to install windows on the box and see if I can get it to work that way. I still don't have a clear understanding on how the package works so let me take a try and you guys can tell me if I'm right.

    In the FreeBSD there is a folder called /usr/local/etc/rc.d and anything that you put in there will autorun when the computer starts. Now the package LCDproc takes advantage of a demon called LCDd which gets its configuration information from LCDd.conf. LCDproc also uses LCDproc.inc and LCDproc.xml to get it's configuration information for such things as what text to display on the screen and also what driver to use and port, speed ect. Now the drivers are located in /usr/local/lib/lcdproc folder and have an extention of *.so. But the LCDd.conf addresses the driver without the extension, does this mean anyting? Also how is the LCDd.conf generated? I suspect it is generated from the lcdproc package. Below is my LCDd.conf

    [server]
    Driver=CFontzPacket
    Bind=127.0.0.1
    Port=13666
    ReportLevel=3
    ReportToSyslog=yes
    WaitTime=5
    User=nobody
    ServerScreen=no
    Foreground=no
    DriverPath=/usr/local/lib/lcdproc/
    GoodBye="Thanks for using"
    GoodBye="    pfSense     "
    ToggleRotateKey=Enter
    PrevScreenKey=Left
    NextScreenKey=Right
    ScrollUpKey=Up
    ScrollDownKey=Down
    [menu]
    MenuKey=Escape
    EnterKey=Enter
    UpKey=Up
    DownKey=Down
    [CFontzPacket]
    Device=/dev/ugen3.2
    Model=635
    Size=20x4
    Contrast=350
    Brightness=1000
    OffBrightness=50
    Speed=115200
    NewFirmware=yes
    Reboot=yes
    

    Also does my port speed seem kind of high, I know typically serial devices use a port speed of 9600. My device is USB however just trying to think of all possibilities. I may also try to update to the lates version of lcdproc. One last thing it seems like I'm trying to connect to the LCDd on a different port than it's listening on but all of the config files say port=13666.

    Thanks for all your help in advance. If anything I'm learning a whole lot about Unix (FreeBSD).


  • Netgate Administrator

    The system log looks a lot better though. It shows lcdd starting and listening for a client and then the client successfully connecting to it. So why is it not actually updating the screen?
    Is it stuck in demo mode? It is set to the wrong baud rate?
    The option Reboot=yes is supposed to be so that the screen resets itself and comes up in a known state. This implies it may be possible for it to setup wrong.

    Override the default communication speed known for the selected model.

    [default: depending on model; legal: 19200, 115200]

    #Speed=115200

    So maybe try 19200.

    The Newfirmware=yes option is a bit confusing. If you look at the code at the lcdproc site it seems to imply there isn't any new firmware so this does nothing.  :-
    In fact your display shows V1.6 and this option is V2.0 firmwares. Maybe try changing that to no.

    Set the firmware version (New means >= 2.0) [default: no; legal: yes, no]

    Currently this flag is not in use, there is no such thing as NewFirmware. ;=)

    #NewFirmware=no

    Edit: Actually 1.6 is the most recent. the above only applies to the 633.

    Your explanation of how it works is mostly accurate. However this isn't a "normal" install of lcdproc.
    In order to use the pfSense package system the lcdproc package does things a bit differently. For example it writes out the lcdproc.conf file when you setup the package. Usually you would just edit the file directly.
    It doesn't use the standard lcdproc client instead using it's own client. Lcdproc is written as a client/server combination just to make it easy for people to write their own client software.

    Steve



  • I know a 635 with scab works on my box as I tried it a few weeks ago as a test. I didn't change any settings other then add the usb port to the config files and selected the packet driver… I do have one extra driver that you may not have. In the http://forum.pfsense.org/index.php/topic,23919.msg123663.html#msg123663 thread, there are steps to add 'libusb.so.2' I needed this to get my piclcd driver to work but I wonder if its needed for any USB LCD device as it was already on my box when I tested with my 635. It also talked about 'libkvm.so.5' but I found I didn't need it.



  • I installed the libkvm.5, libusb.so.2, picolcd.so and now I'm getting:

    /libexec/ld-elf.so.1: /lib/libkvm.so.5: Shared object has no run-time symbol table
    Error.
    I have tried to erase the files now I am just getting this error on my terminal and I get this error when I try to run the top command and also if I try to execute the LCDd or lcdproc. I am finishing my basement so I will have to take the router off line for a couple of days also I am making some upgrades so I can switch from operating systems more efficiently and will try to update on my progress later on in the week. I have still not tried to get the LCD working in Windows just as a test.  I am also going to try to see if I can get the LCD to work in PfSense 1.2.3. I will update on my progress.



  • you dont need the libkvm.5, libusb.so.2, picolcd.so files. They are needed if you have a picolcd display. A firmware update should overwrite the libkvm.5 file.

    try it on a windows box to make sure its working.. download ccontrol and the window drivers to get it working on a windows box.


  • Netgate Administrator

    Are you sure you don't need libusb?
    Just the fact that something changed when it was added to the box implies that it's being used?

    Steve



  • i think your right… libusb wasn't there on a fresh install and its needed for picolcd because it uses the usb interface.. the 635 may need it also since its attach via usb. libkvm, at first i did use that driver but after a few fresh installs, i found i didn't need it only libusb. I end up not installing the libkvm



  • Okay so I installed Windows 7 32 bit on my box and was able to get the 635 to work with little issues. I did notice that there were two drivers for this screen. There was a USB Driver (I'm guessing that is the CFontzPacket in FreeBSD) but there is also a serial port driver (Not sure which driver does this in FreeBSD) that gets installed even though this screen connects through my motherboard via USB. I remember reading somewhere that this device is a serial device with an USB controller attached to it. If that is the case is there another driver that I have to install before this screen will work? Also in Windows there is a separate program that is responsible for putting the information on the screen (lcdproc I'm guessing is what does that in FreeBSD). I did find out in Windows the screen will not function unless you have the serial port speed set to the Max 115200. I feel like I'm getting closer, I think the issue is the serial port driver. Any ideas?
    I also notice that if I edit files with file manger a package I downloaded for PfSense I get all kind of errors trying to run LCDd but if I use the built in file editor then I don’t get the error. There may be a problem with File Manager. Not sure if anyone else has seen this.

    Here is a read out of my system logs:

    LCDd: LCDd version 0.5.3 starting
    Aug 11 21:56:32                  LCDd: Using Configuration File: /usr/local/etc/LCDd.conf
    Aug 11 21:56:32                  LCDd: Listening for queries on 127.0.0.1:13666
    Aug 11 21:56:38                  LCDd: Connect from host 127.0.0.1:11527 on socket 6
    Aug 11 21:56:39                  LCDd: error: huh? Too much data received… quiet down!
    Aug 11 21:56:39                  LCDd: Client on socket 6 disconnected


  • Netgate Administrator

    The USB-Serial port driver, uftdi, is in the FreeBSD kernel and is loading correctly as you can see from your system logs.

    One thing that occurs to me is that you may have to point LCDd at the serial device rather than the usb port directly. E.g. at uftdi0

    If you plug the screen in after pfSense has booted and you have the console up what messages do you get? Does it show an extra com port for example?

    Steve



  • The USB-Serial port driver, uftdi, is in the FreeBSD kernel and is loading correctly as you can see from your system logs.

    One thing that occurs to me is that you may have to point LCDd at the serial device rather than the usb port directly. E.g. at uftdi0

    If you plug the screen in after pfSense has booted and you have the console up what messages do you get? Does it show an extra com port for example?

    Steve

    I will try that, right now the system is down due to basement construction. I did forget to mention one thing. I was messing around with the LCDd.conf and I copied the LCDd.conf.sample to LCDd.conf without editing it. I then ran the LCDd and lcdproc and it put all the lcdproc information on my terminal window (I was sshed into the box at the time) So it seems that the lcdproc and LCDd are working and it is just a matter of getting the information to the screen. I will try what you said and report back soon.


  • Netgate Administrator

    This makes for interesting reading, though it's an older version of FreeBSD and the com port labelling has changed since then:
    http://www.tnpi.net/computing/freebsd/crystalfontz.shtml

    Perhaps you need the ucom driver?

    Steve

    Edit: Further reading seems to show that the uftdi driver should automatically generate an extra com port which the CFontz packet driver can talk to. I don't see one in your dmesg from a while ago.

    Edit: The ucom driver doesn't seem to be in the 32 bit kernel, you using 64 bit?

    
    [2.0-RC3][root@pfsense.fire.box]/boot/modules(14): kldstat -v | grep ucom
    [2.0-RC3][root@pfsense.fire.box]/boot/modules(15): kldstat -v | grep uftdi
                    285 uhub/uftdi
    
    


  • This makes for interesting reading, though it's an older version of FreeBSD and the com port labelling has changed since then:
    http://www.tnpi.net/computing/freebsd/crystalfontz.shtml

    Perhaps you need the ucom driver?

    Steve

    Edit: Further reading seems to show that the uftdi driver should automatically generate an extra com port which the CFontz packet driver can talk to. I don't see one in your dmesg from a while ago.

    Yeah I saw that post too, I think there is were I discovered that the LCD screen was really a serial device with a usb interface slapped on it or perhaps it would be more accurate to call it an serial LCD screen with a usb to serial device included?

    So I turned on the router and unplugged the usb from the motherboard. (Kind of tricky as it is all individual wires!) and I got this :

    ugen3.2 <crystalfontz>at usbus3 (disconnected)
    uftdi0: at uhub3, Port2, addr 2 disconnected

    When I plugged it back in I got:

    ugen3.2: <crystalfontz>at usbus3
    uftdi0: <crystalfontz cfa635-usb="" lcd="">on usbus3

    You may be correct. I ran the following command though I don't know what it means:

    kldstat -v|grep ucom

    and nothing was returned but the prompt.</crystalfontz></crystalfontz></crystalfontz>


  • Netgate Administrator

    In FreeBSD drivers can be either built into the kernel or loaded as a module. The drivers that are built in are decided at compile time.
    kldstat usually lists the kernel modules that have been loaded with kldload or from /boot/loader.conf. kldstat -v lists modules that are compiled in, I think!

    I think you need to kldload the ucom.ko module but I only have the 32bit version to hand.

    Steve



  • That's good because I have re-installed PfSense and used the 32bit version. I wanted to see if 64 bit was the cause of my troubles and just decided to keep it because I wasn't sure what 64 bit gave me other than the ability to address more memory. I would just need the driver and instructions on how to install it.


  • Netgate Administrator

    Edit: Don't bother with this see below!  ;)

    Hmm, looks like I was wrong about the kldstat command. Trying to load ucom on my system gives:

    
    [2.0-RC3][root@pfsense.fire.box]/root(1): kldload ucom.ko
    kldload: can't load ucom.ko: File exists
    
    

    This implies it's already in the kernel. It's probably worth trying though on your system.

    I've attached the ucom.ko module from FreeBSD 8.1. Remove the .png suffix.
    The file should be 20,607 Bytes.
    Upload the file to /boot/modules then from the command line:
    cd /boot/modules
    kldload ucom.ko

    Steve

    ucom.ko.png


  • Netgate Administrator

    Forget all that!  ::)

    I'm not sure why, perhaps the logging level is set differently, but the ucom driver output does not show up when you connect a device. However the resulting com port is created.

    I happened to have an FTDI device to hand (it's a USB ODBII reader) so I gave it a go.

    
    [2.0-RC3][root@pfsense.fire.box]/dev(36): dmesg | grep ftdi
    uftdi0: <ft232r usb="" uart="">on usbus0
    [2.0-RC3][root@pfsense.fire.box]/dev(37): ls /dev/cua??
    /dev/cuaU0 /dev/cuau0 /dev/cuau1</ft232r> 
    

    As you can see the device cuaU0 is created. The capital U is important it indicates a USB connected com port. It also appears as ttyU0.

    Just use that in the lcdproc config page instead of ugen3.2.

    Steve



  • Success! Adding the serial port and not the USB port was the key. Here is what I did.

    1. Complete reinstall (Wanted to start clean)
    2. Edited the lcdproc.xml file and added ttyU0
    3. Edited the lcdproc.inc file and added ttyU0 in that file as well.

    The screen was showing 0 Clients, 0 Screens but after looking at some things I noticed that I didn't have a lcdproc.conf so I just cp lcdproc.conf.sample lcdproc.conf . Now everything seems to be running ok. I have not tried to restart the system to see if it will start automatically. I will report back on my finding. I just want to thank Stephenw10 and Cino, and all others in previous post. Without you guys I would have never figured this thing out.



  • Good to hear!! I was going to get back to you on this but glad you got it to work… Strange you had to use that... I wonder if its because when I tested this a few weeks ago, i had the LCD with SCAB built in.



  • @mikeisfly:

    Success! Adding the serial port and not the USB port was the key. Here is what I did.

    1. Complete reinstall (Wanted to start clean)
    2. Edited the lcdproc.xml file and added ttyU0
    3. Edited the lcdproc.inc file and added ttyU0 in that file as well.

    The screen was showing 0 Clients, 0 Screens but after looking at some things I noticed that I didn't have a lcdproc.conf so I just cp lcdproc.conf.sample lcdproc.conf . Now everything seems to be running ok. I have not tried to restart the system to see if it will start automatically. I will report back on my finding. I just want to thank Stephenw10 and Cino, and all others in previous post. Without you guys I would have never figured this thing out.

    Hi,

    I order an CrystalFontz LCD for my Pfsense box
    Can you explain step by step what you do you get it working (clarify)

    Thanks



  • Hi,

    I order an CrystalFontz LCD for my Pfsense box
    Can you explain step by step what you do you get it working (clarify)

    Thanks

    Okay just as a disclaimer before I start, this is what worked for me, so please backup your systems before you change any files I would also suggest that you make a .bak file of anything that you edit that way you can always go back to a known good position.

    I am using pfsense 2.0.1 - Release (amd64)
    I'm using a MSI FUZZY RS690T AMD ATI AM2+ MINI ITX HDMI MOTHERBOARD
    AMD Athlon™ X2 Dual Core Processor BE-2350
    2 GB RAM
    4 GB Trendnet CF
    CF to SATA adatper with Half-Height Adaptor
    CrystalFontz 635 LCD
    Intel PWLA8492MTBLK5 10/ 100/ 1000Mbps PCI PRO/1000 MT Dual Port Server Adapter - with Half-Height Adaptor
    NORCO RPC-230 2U Rackmount Server Case

    I'm using the nano build of pfsense, I have gotten this to work with the full version of 2.0 32bit
    The LCDproc package that I'm using is: lcdproc-0.5.3_1 Haven't got the developer one to work yet

    Stop LCDProc if you have it running.
    There are two files that you have to edit: use the file editor in pfsense under Diagnostics "Edit File"

    First one is /usr/local/pkg/lcdproc.xml  add the following lines under <options>```

    			 <option><value>ttyU0</value>
    				<name>USB Com port 3 alternate (/dev/ttyU0)</name></option> 				
    
    
    Save your file.
    
    Now you need to edit **_/usr/local/pkg/lcdproc.inc_** adding the following lines under the case statements:
    
    
    			case "ttyU0":
    				continue;
    				break;
    
    
    **The scroll down to find the case statements with $realport varible and add**
    
    
    			case "ttyU0":
    				$realport = "/dev/ttyU0";
    				break;
    
    
    Save your file. Start LCDproc, if it doesn't start go to Services under Status and start the service there. You should be good to go.
    
    Here is my entire lcdproc.xml for your perusal:
    

    <packagegui><title>Services: LCDproc</title>
    <name>lcdproc</name>
    <version>0.5.2_1-p12</version>
    <savetext>Save</savetext>
    <include_file>/usr/local/pkg/lcdproc.inc</include_file>
    <tabs><tab><text>Server</text>
    <url>/pkg_edit.php?xml=lcdproc.xml&id=0</url>
    <active></active></tab>
    <tab><text>Screens</text>
    <url>/pkg_edit.php?xml=lcdproc_screens.xml&id=0</url></tab></tabs>

    <menu>
    <name>LCDproc</name>
    <tooltiptext>Set LCDproc settings such as display driver and com port</tooltiptext>
    Services
    <url>/pkg_edit.php?xml=lcdproc.xml&id=0</url>
    </menu>

     <additional_files_needed>http://www.pfsense.org/packages/config/lcdproc/lcdproc.inc
        <prefix>/usr/local/pkg/</prefix>
        <chmod>0755</chmod></additional_files_needed> 
     <additional_files_needed>http://www.pfsense.org/packages/config/lcdproc/lcdproc_screens.xml
        <prefix>/usr/local/pkg/</prefix>
        <chmod>0755</chmod></additional_files_needed> 
     <additional_files_needed>http://www.pfsense.org/packages/config/lcdproc/lcdproc_client.php
        <prefix>/usr/local/pkg/</prefix>
        <chmod>0755</chmod></additional_files_needed> 
     <additional_files_needed>http://www.pfsense.org/packages/config/lcdproc/bin/nexcom.so
        <prefix>/usr/local/lib/lcdproc/</prefix>
        <chmod>0755</chmod></additional_files_needed> 
     <additional_files_needed>http://www.pfsense.org/packages/config/lcdproc/bin/SureElec.so
        <prefix>/usr/local/lib/lcdproc/</prefix>
        <chmod>0755</chmod></additional_files_needed> 	
     <additional_files_needed>http://www.pfsense.org/packages/config/lcdproc/bin/picolcd.so
        <prefix>/usr/local/lib/lcdproc/</prefix>
        <chmod>0755</chmod></additional_files_needed> 
     <additional_files_needed>http://www.pfsense.org/packages/config/lcdproc/bin/libusb.so.2
        <prefix>/usr/local/lib/lcdproc/</prefix>
        <chmod>0755</chmod></additional_files_needed> 
     <service><name>lcdproc</name>
    	<rcfile>lcdproc.sh</rcfile>
    	<executable>LCDd</executable>
    	<description>LCD Driver</description></service> 
     <fields><field><fielddescr>Enable LCDproc</fielddescr>
    		<fieldname>enable</fieldname>
    		<type>checkbox</type></field> 
    	 <field><fieldname>comport</fieldname>
    		<fielddescr>Com Port</fielddescr>
    		<description>Set the com port LCDproc should use.</description>
    		<type>select</type>
    		 <options><option><value>none</value>
    				<name>none</name></option> 
    			 <option><value>com2</value>
    				<name>Serial Com port 2 (/dev/cua1)</name></option> 
    			 <option><value>ucom1</value>
    				<name>USB Com port 1 (/dev/cuaU0)</name></option> 
    			 <option><value>ucom2</value>
    				<name>USB Com port 2 (/dev/cuaU1)</name></option> 
    			 <option><value>lpt1</value>
    				<name>Parallel port 1 (/dev/lpt0)</name></option> 
    			 <option><value>ugen0.2</value>
    				<name>USB Com port 1 alternate (/dev/ugen0.2)</name></option> 				
    			 <option><value>ugen1.2</value>
    				<name>USB Com port 2 alternate (/dev/ugen1.2)</name></option> 
    			 <option><value>ugen2.2</value>
    				<name>USB Com port 3 alternate (/dev/ugen2.2)</name></option> 
    			 <option><value>ttyU0</value>
    				<name>USB Com port 3 alternate (/dev/ttyU0)</name></option></options> 
    		<default_value>ucom1</default_value></field> 
    	 <field><fieldname>size</fieldname>
    		<fielddescr>Display Size</fielddescr>
    		<description>Set the display size lcdproc should use.</description>
    		<type>select</type>
    		 <options><option><value>12x1</value>
    				<name>1 rows 12 colums</name></option> 
    			 <option><value>12x2</value>
    				<name>2 rows 12 colums</name></option> 
    			 <option><value>12x4</value>
    				<name>4 rows 12 colums</name></option> 
    			 <option><value>16x1</value>
    				<name>1 row 16 colums</name></option> 
    			 <option><value>16x2</value>
    				<name>2 rows 16 colums</name></option> 
    			 <option><value>16x4</value>
    				<name>4 rows 16 colums</name></option> 
    			 <option><value>20x1</value>
    				<name>1 row 20 colums</name></option> 
    			 <option><value>20x2</value>
    				<name>2 rows 20 colums</name></option> 
    			 <option><value>20x4</value>
    				<name>4 rows 20 colums</name></option></options> 
    		<default_value>16x2</default_value></field> 
    	 <field><fieldname>driver</fieldname>
    		<fielddescr>Driver</fielddescr>
    		<description>Set the LCD driver LCDproc should use.</description>
    		<type>select</type>
    		 <options><option><value>nexcom</value>
    				<name>nexcom</name></option> 
    			 <option><value>bayrad</value>
    				<name>bayrad</name></option> 
    			 <option><value>CFontz</value>
    				<name>CrystalFontz</name></option> 
    			 <option><value>CFontz633</value>
    				<name>CrystalFontz 633</name></option> 
    			 <option><value>CFontzPacket</value>
    				<name>CrystalFontz Packet</name></option> 
    			 <option><value>curses</value>
    				<name>curses</name></option> 
    			 <option><value>CwLnx</value>
    				<name>CwLnx</name></option> 
    			 <option><value>ea65</value>
    				<name>ea65</name></option> 
    			 <option><value>EyeBoxOne</value>
    				<name>EyeBoxOne</name></option> 
    			 <option><value>gl5</value>
    				<name>gl5</name></option> 
    			 <option><value>glcdlib</value>
    				<name>glcdlib</name></option> 
    			 <option><value>glk</value>
    				<name>glk</name></option> 
    			 <option><value>hd44780</value>
    				<name>hd44780</name></option> 
    			 <option><value>icp_a106</value>
    				<name>icp_a106</name></option> 
    			 <option><value>imon</value>
    				<name>imon</name></option> 
    			 <option><value>IOWarrior</value>
    				<name>IOWarrior</name></option> 
    			 <option><value>irman</value>
    				<name>irman</name></option> 
    			 <option><value>joy</value>
    				<name>joy</name></option> 
    			 <option><value>lb216</value>
    				<name>lb216</name></option> 
    			 <option><value>lcdm001</value>
    				<name>lcdm001</name></option> 
    			 <option><value>lcterm</value>
    				<name>lcterm</name></option> 
    			 <option><value>lirc</value>
    				<name>lirc</name></option> 
    			 <option><value>MD8800</value>
    				<name>MD8800</name></option> 
    			 <option><value>ms6931</value>
    				<name>ms6931</name></option> 
    			 <option><value>mtc_s16209x</value>
    				<name>mtc_s16209x</name></option> 
    			 <option><value>MtxOrb</value>
    				<name>MtxOrb</name></option> 
    			 <option><value>NoritakeVFD</value>
    				<name>NoritakeVFD</name></option> 
    			 <option><value>pyramid</value>
    				<name>pyramid</name></option> 				
    			 <option><value>picolcd</value>
    				<name>picolcd</name></option> 
    			 <option><value>Sed1330</value>
    				<name>Sed1330</name></option> 
    			 <option><value>sed1520</value>
    				<name>sed1520</name></option> 
    			 <option><value>serialpos</value>
    				<name>serialpos</name></option> 
    			 <option><value>serialVFD</value>
    				<name>serialVFD</name></option> 
    			 <option><value>sli</value>
    				<name>sli</name></option> 
    			 <option><value>stv5730</value>
    				<name>stv5730</name></option> 
    			 <option><value>SureElec</value>
    				<name>SureElec</name></option> 				
    			 <option><value>svga</value>
    				<name>svga</name></option> 
    			 <option><value>t6963</value>
    				<name>t6963</name></option> 
    			 <option><value>text</value>
    				<name>text</name></option> 
    			 <option><value>tyan</value>
    				<name>tyan</name></option> 
    			 <option><value>ula200</value>
    				<name>ula200</name></option> 
    			 <option><value>xosd</value>
    				<name>xosd</name></option></options> 
    		<default_value>pyramid</default_value></field> 
    	 <field><fieldname>refresh_frequency</fieldname>
    		<fielddescr>Refresh frequency</fielddescr>
    		<description>Set the refresh frequency of the information on the LCD Panel</description>
    		<type>select</type>
    		 <options><option><value>1</value>
    				<name>1 second</name></option> 
    			 <option><value>2</value>
    				<name>2 seconds</name></option> 
    			 <option><value>3</value>
    				<name>3 seconds</name></option> 
    			 <option><value>5</value>
    				<name>5 seconds</name></option> 
    			 <option><value>10</value>
    				<name>10 seconds</name></option></options> 
    		<default_value>5</default_value></field></fields> 
     <custom_php_command_before_form>before_form_lcdproc(&$pkg);</custom_php_command_before_form> 
     <custom_php_validation_command>validate_form_lcdproc($_POST, &$input_errors);</custom_php_validation_command> 
     <custom_php_resync_config_command>sync_package_lcdproc();</custom_php_resync_config_command></packagegui> 
    
    
    Here is my entire lcdproc.inc for your perusal:
    

    /* $Id$ /
    /

            lcdproc.inc
            Copyright (C) 2007 Seth Mos seth.mos@xs4all.nl
            All rights reserved.

    Redistribution and use in source and binary forms, with or without
            modification, are permitted provided that the following conditions are met:

    1. Redistributions of source code must retain the above copyright notice,
              this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
              notice, this list of conditions and the following disclaimer in the
              documentation and/or other materials provided with the distribution.

    THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
            INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
            AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
            AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
            OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
            SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
            INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
            CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
            ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
            POSSIBILITY OF SUCH DAMAGE.
    */

    require_once("config.inc");
    require_once("functions.inc");
    
    /* LCDproc */
    define('LCDPROC_RCFILE', '/usr/local/etc/rc.d/lcdproc.sh');
    define('LCDPROC_CLIENT', '/tmp/lcdclient.sh');
    define('LCDPROC_CONFIG','/usr/local/etc/LCDd.conf');
    define('LCDPROC_HOST','localhost');
    define('LCDPROC_PORT','13666');
    
    function lcdproc_notice ($msg) { syslog(LOG_NOTICE, "lcdproc: {$msg}"); }
    function lcdproc_warn ($msg) { syslog(LOG_WARNING, "lcdproc: {$msg}"); }
    
    function lcdproc_action ($action) {
    	if (file_exists(LCDPROC_RCFILE))
    		mwexec(LCDPROC_RCFILE.' '.$action);
    }
    
    function lcdproc_running () {
    	if((int)exec('pgrep LCDd | wc -l') > 0)
    		return true;
    	return false;
    }	
    
    function lcdproc_write_config($file, $text) {
    	$handle = fopen($file, 'w');
    	if(!$handle) {
    		lcdproc_warn("Could not open {$file} for writing.");
    		exit;
    	}
    	fwrite($handle, $text);
    	fclose($handle);
    }
    
    function lcdproc_write_script($file, $text) {
    	$handle = fopen($file, 'wx');
    	if(!$handle) {
    		lcdproc_warn("Could not open {$file} for writing.");
    		exit;
    	}
    	fwrite($handle, $text);
    	fclose($handle);
    	chmod($file, 0755);
    }
    
    function before_form_lcdproc($pkg) {
    	global $config;
    
    	config_lock();		
    
    	config_unlock();
    }
    
    function before_form_lcdproc_screens($pkg) {
    	global $config;
    
    	config_lock();		
    
    	config_unlock();
    }
    
    function validate_form_lcdproc($post, $input_errors) {
    	if($post['comport']) {
    		switch($post['comport']) {
    			case "none":
    				continue;
    				break;
    			case "com2":
    				continue;
    				break;
    			case "ucom1":
    				continue;
    				break;
    			case "ucom2":
    				continue;
    				break;
    			case "lpt1":
    				continue;
    				break;
    			case "ugen0.2":
    				continue;
    				break;
    			case "ugen1.2":
    				continue;
    				break;
    			case "ugen2.2":
    				continue;
    				break;
    			case "ttyU0":
    				continue;
    				break;
    
    			default:
    				$input_errors[] = "The chosen com port is not valid";
    				break;
    		}
    	}
    	if($post['size']) {
    		switch($post['size']) {
    			case "12x1":
    				continue;
    				break;
    			case "12x2":
    				continue;
    				break;
    			case "12x4":
    				continue;
    				break;
    			case "16x1":
    				continue;
    				break;
    			case "16x2":
    				continue;
    				break;
    			case "16x4":
    				continue;
    				break;
    			case "20x1":
    				continue;
    				break;
    			case "20x2":
    				continue;
    				break;
    			case "20x4":
    				continue;
    				break;
    			default:
    				$input_errors[] = "The chosen display size is not valid";
    				break;
    		}
    	}
    }
    function validate_form_lcdproc_screens($post, $input_errors) {
    	// No validation required ?!
    }
    
    function sync_package_lcdproc_screens() {
    	sync_package_lcdproc();
    }
    function sync_package_lcdproc() {
    	global $g;
    	global $config;
    	global $input_errors;
    
    	config_lock();
    
    	$lcdproc_config = $config['installedpackages']['lcdproc']['config'][0];
    	$lcdproc_screens_config = $config['installedpackages']['lcdprocscreens']['config'][0];
    
    	/* since config is written before this file invoked we don't need to read post data */
    	if($lcdproc_config['enable'] && ($lcdproc_config['comport'] != "none")) {
    		switch($lcdproc_config['comport']) {
    			case "com2":
    				$realport = "/dev/cua1";
    				break;
    			case "ucom1":
    				$realport = "/dev/cuaU0";
    				break;
    			case "ucom2":
    				$realport = "/dev/cuaU1";
    				break;
    			case "lpt1":
    				$realport = "/dev/lpt0";
    				break;
    			case "ugen0.2":
    				$realport = "/dev/ugen0.2";
    				break;
    			case "ugen1.2":
    				$realport = "/dev/ugen1.2";
    				break;
    			case "ugen2.2":
    				$realport = "/dev/ugen2.2";
    				break;
    			case "ttyU0":
    				$realport = "/dev/ttyU0";
    				break;
    
    			default:
    				lcdproc_warn("The selected com port is not valid!");
    				return;
    		}
    
    		$config_text = "[server]\n";
    		$config_text .= "Driver={$lcdproc_config[driver]}\n";
    		$config_text .= "Bind=127.0.0.1\n";
    		$config_text .= "Port=13666\n";
    		$config_text .= "ReportLevel=3\n";
    		$config_text .= "ReportToSyslog=yes\n";
    		$config_text .= "WaitTime=5\n";
    		$config_text .= "User=nobody\n";
    		$config_text .= "ServerScreen=no\n";
    		$config_text .= "Foreground=no\n";
    		$config_text .= "DriverPath=/usr/local/lib/lcdproc/\n";
    		$config_text .= "GoodBye=\"Thanks for using\"\n";
    		$config_text .= "GoodBye=\"    {$g['product_name']}     \"\n";
    		/* FIXME: Specific to the pyramid project */
    		$config_text .= "ToggleRotateKey=Enter\n";
    		$config_text .= "PrevScreenKey=Left\n";
    		$config_text .= "NextScreenKey=Right\n";
    		$config_text .= "ScrollUpKey=Up\n";
    		$config_text .= "ScrollDownKey=Down\n";
    		/* FIXME: pyramid test menu */
    		$config_text .= "[menu]\n";
    		$config_text .= "MenuKey=Escape\n";
    		$config_text .= "EnterKey=Enter\n";
    		$config_text .= "UpKey=Up\n";
    		$config_text .= "DownKey=Down\n";
    
    		/* lcdproc default driver definitions */
    		switch($lcdproc_config[driver]) {
    			case "SureElec":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "driverpath =/usr/local/lib/lcdproc/\n";
    				$config_text .= "Device={$realport}\n";
    				$config_text .= "Size={$lcdproc_config['size']}\n";
    				$config_text .= "Edition=2\n";					
    				$config_text .= "Contrast=200\n";
    				$config_text .= "Brightness=480\n";	
    				$config_text .= "Speed=19200\n";
    				break;			
    			case "nexcom":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "driverpath =/usr/local/lib/lcdproc/\n";
    				$config_text .= "Device={$realport}\n";
    				$config_text .= "Size={$lcdproc_config['size']}\n";
    				break;
    			case "bayrad":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "Device={$realport}\n";
    				$config_text .= "Speed=9600\n";
    				break;
    			case "picolcd":
    				 $config_text .= "[{$lcdproc_config['driver']}]\n";
    				 $config_text .= "driverpath=/usr/local/lib/lcdproc/\n";
    				 $config_text .= "Device={$realport}\n";
    				 $config_text .= "Size={$lcdproc_config['size']}\n";
    				 $config_text .= "KeyTimeout=500\n";
    				 $config_text .= "Brightness=1000\n";
    				 $config_text .= "Blacklight_Timer=60\n";
    				 $config_text .= "Contrast=1000\n";
    				 $config_text .= "Keylights=on\n";
    				 $config_text .= "Key0Light=on\n";
    				 $config_text .= "Key1Light=off\n";
    				 $config_text .= "Key2Light=off\n";
    				 $config_text .= "Key3Light=off\n";
    				 $config_text .= "Key4Light=off\n";
    				 $config_text .= "Key5Light=off\n";
    				 break;					
    			case "CFontz":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "Device={$realport}\n";
    				$config_text .= "Size={$lcdproc_config['size']}\n";
    				$config_text .= "Contrast=350\n";
    				$config_text .= "Brightness=1000\n";
    				$config_text .= "OffBrightness=50\n";
    				$config_text .= "Speed=9600\n";
    				$config_text .= "NewFirmware=no\n";
    				$config_text .= "Reboot=no\n";
    				break;
    			case "CFontz633":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "Device={$realport}\n";
    				$config_text .= "Size={$lcdproc_config['size']}\n";
    				$config_text .= "Contrast=350\n";
    				$config_text .= "Brightness=1000\n";
    				$config_text .= "OffBrightness=50\n";
    				$config_text .= "Speed=19200\n";
    				$config_text .= "NewFirmware=yes\n";
    				$config_text .= "Reboot=yes\n";
    				break;
    			case "CFontzPacket":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "Device={$realport}\n";
    				$config_text .= "Model=635\n";
    				$config_text .= "Size={$lcdproc_config['size']}\n";
    				$config_text .= "Contrast=350\n";
    				$config_text .= "Brightness=1000\n";
    				$config_text .= "OffBrightness=50\n";
    				$config_text .= "Speed=115200\n";
    				$config_text .= "NewFirmware=yes\n";
    				$config_text .= "Reboot=yes\n";
    				break;
    			case "curses":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "Foreground=blue\n";
    				$config_text .= "Background=cyan\n";
    				$config_text .= "Backlight=red\n";
    				$config_text .= "Size={$lcdproc_config['size']}\n";
    				$config_text .= "TopLeftX=7\n";
    				$config_text .= "TopLeftY=7\n";
    				$config_text .= "UseACS=no\n";
    				break;
    			case "CwLynx":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "Model=12232\n";
    				$config_text .= "Device={$realport}\n";
    				$config_text .= "Size={$lcdproc_config['size']}\n";
    				$config_text .= "Speed=19200\n";
    				$config_text .= "Reboot=no\n";
    				break;
    			case "pyramid":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "Device={$realport}\n";
    				$config_text .= "Size={$lcdproc_config['size']}\n";
    				break;
    			case "ea65":
    				$config_text .= "[{$lcdproc_config['driver']}]\n";
    				$config_text .= "Device={$realport}\n";
    				$config_text .= "OffBrightness=0\n";
    				$config_text .= "Brightness=500\n";
    				break;
    			default:
    				lcdproc_warn("The chosen lcdproc driver is not a valid choice");
    				unset($lcdproc_config[driver]);
    		}
    
    		/* generate rc file start and stop */
    		$client_script = <<<eod<br>#!/bin/sh
    

    script starts a lcd client and always keeps it active.

    counter=1
    while [ "$counter" -ne 0 ]
    do
    # loop the client to drive the display
    /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php
    sleep 1
    done

    EOD;

    		/* generate rc file start and stop */
    		$stop = << <eod<br>if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0  ]; then
    ps auxw |awk '/LCD[d]/ {print $2}'|xargs kill 
    sleep 1	
    

    fi
    if [ ps auxw |awk '/lcdclient.s[h]/ {print $2}'| wc -l != 0  ]; then
    ps auxw |awk '/lcdclient.s[h]/ {print $2}'|xargs kill
    sleep 1
    fi

    EOD;
    $start = $stop ."\n";
    $start .= "\t/usr/local/sbin/LCDd -c ". LCDPROC_CONFIG ."\n";
    $start .= "\t". LCDPROC_CLIENT ." &\n";

    		/* write out the configuration */
    		conf_mount_rw();
    		lcdproc_write_script(LCDPROC_CLIENT, $client_script);
    		lcdproc_write_config(LCDPROC_CONFIG, $config_text);
    		write_rcfile(array(
    				'file' => 'lcdproc.sh',
    				'start' => $start,
    				'stop' => $stop
    				));
    		conf_mount_ro();
    
    		/* or restart lcdproc if settings were changed */
    		if(lcdproc_running($_POST['comport'])) {
    			lcdproc_notice("Restarting service lcdproc");
    			lcdproc_action('restart');
    		}
    	}
    
    	if((! $lcdproc_config['driver']) || ($lcdproc_config['comport'] == "none")) {
    		/* no parameters user does not want lcdproc running */
    		/* lets stop the service and remove the rc file */
    
    		if(file_exists(LCDPROC_RCFILE)) {
    			if(!$lcdproc_config['enable']) {
    				lcdproc_notice('Stopping service: lcdproc disabled');
    			} else {
    				lcdproc_notice('Stopping service: no com port selected');
    			}
    			lcdproc_action('stop');
    			conf_mount_rw();
    			unlink(LCDPROC_RCFILE);
    			unlink(LCDPROC_CLIENT);
    			unlink(LCDPROC_CONFIG);
    			conf_mount_ro();
    		}
    	}
    	config_unlock();
    }
    

    ?></eod<br></eod<br>/seth.mos@xs4all.nl

    
    Hope this help!</options>


  • Re-installed Lcdproc 0.5.4 v. 0.3 and used the above process and everything worked so this works with the new package as well.


Locked