Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Crystal Fontz 635 help!

    Scheduled Pinned Locked Moved Hardware
    31 Posts 4 Posters 10.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • stephenw10S
      stephenw10 Netgate Administrator
      last edited by

      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
      
      
      1 Reply Last reply Reply Quote 0
      • M
        mikeisfly
        last edited by

        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>

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • M
            mikeisfly
            last edited by

            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.

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              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

              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator
                last edited by

                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

                1 Reply Last reply Reply Quote 0
                • M
                  mikeisfly
                  last edited by

                  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.

                  1 Reply Last reply Reply Quote 0
                  • C
                    Cino
                    last edited by

                    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.

                    1 Reply Last reply Reply Quote 0
                    • F
                      fireman039
                      last edited by

                      @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

                      1 Reply Last reply Reply Quote 0
                      • M
                        mikeisfly
                        last edited by

                        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>
                        1 Reply Last reply Reply Quote 0
                        • M
                          mikeisfly
                          last edited by

                          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.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post
                          Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.