LCDProc 0.5.4-dev
-
lcdproc works on a server-client basis. The two can be on remote machines if required. The server LCDd runs according to its config file, lcdd.conf, which for use has it listen on localhost:13666.
The client was written in php especially for pfSense, though many other clients are available. The server can connect to several clients at once and will cycle through them sequentially. Hence there are no errors when some instances of lcdproc_client.php are not killed.Both client and server are required.
In the original lcdproc package, written by Seth Mos, the lcdproc_client.php program was run from a separate shell script, lcdclient.sh, but this was removed.
The service name is set to lcdproc but the executable is set to LCDd:
<service><name>lcdproc</name> <rcfile>lcdproc.sh</rcfile> <executable>LCDd</executable> <description>LCD Driver</description></service>
Steve
-
Try to apply this patch and use this patched lcdproc.inc file
patch to etc/inc/service-utils.inc that is included on pfsense 2.1 and upcoming 2.0.2
https://github.com/marcelloc/pfsense/commit/6ae78f0808747893f30b867c51b744dfe39e2190patched lcdproc.inc file with some changes on startup process
http://e-sac.siteseguro.ws/packages/lcdproc-dev/lcdproc.inc.txt
you can use fetch -o lcdproc.inc http://e-sac.siteseguro.ws/packages/lcdproc-dev/lcdproc.inc.txt to download the file.diff in patch format
*** backup/lcdproc.inc Tue May 8 12:23:59 2012 --- /usr/local/pkg/lcdproc.inc Tue May 8 12:51:53 2012 *************** *** 72,106 **** if($post['comport']) { switch($post['comport']) { case "none": - continue; - break; case "com1": - continue; - break; case "com2": - continue; - break; case "com1a": - continue; - break; case "com2a": - 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; --- 72,86 ---- *************** *** 112,143 **** 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; case "40x2": continue; break; --- 92,105 ---- *************** *** 149,171 **** if($post['port_speed']) { switch($post['port_speed']) { case "0": - continue; - break; case "1200": - continue; - break; case "2400": - continue; - break; case "9600": - continue; - break; case "19200": - continue; - break; case "57600": - continue; - break; case "115200": continue; break; --- 111,121 ---- *************** *** 185,190 **** --- 135,148 ---- global $g; global $config; global $input_errors; + + # detect boot process + if (is_array($_POST)){ + if (! preg_match("/\w+/",$_POST['__csrf_magic'])) + return; + } + + #continue sync package lcdproc_notice("Sync: Begin package sync"); config_lock(); $lcdproc_config = $config['installedpackages']['lcdproc']['config'][0]; *************** *** 500,516 **** } /* generate rc file start and stop */ $stop = <<<eod<br>! if [ `ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'| wc -l` != 0 ]; then ! ps auxw |awk '/lcdproc_client.ph[p]/ {print $2}'|xargs /bin/kill ! sleep 1 fi ! if [ `ps auxw |awk '/LCD[d]/ {print $2}'| wc -l` != 0 ]; then ! ps auxw |awk '/LCD[d]/ {print $2}'|xargs /bin/kill sleep 1 fi EOD; $start = $stop ."\n"; ! $start .= "\t/usr/bin/nice -20 /usr/local/sbin/LCDd -c ". LCDPROC_CONFIG ."\n"; $start .= "\t/usr/bin/nice -20 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php &\n"; /* write out the configuration */ conf_mount_rw(); --- 458,475 ---- } /* generate rc file start and stop */ $stop = <<<eod<br>! if [ `pgrep -f lcdproc_client.ph` ];then ! pkill -f lcdproc_client.ph ! sleep 1 fi ! if [ `pgrep -anx LCDd` ]; then ! pkill -anx LCDd sleep 1 fi + EOD; $start = $stop ."\n"; ! $start .= "\t/usr/bin/nice -20 /usr/local/sbin/LCDd -c ". LCDPROC_CONFIG ." -u nobody\n"; $start .= "\t/usr/bin/nice -20 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php &\n"; /* write out the configuration */ conf_mount_rw();</eod<br></eod<br>
-
Ok I've tried that. Replaced lcdproc.inc with your file. Change lines 132, 141 and 150 in service-utils.inc.
Result imediately after boot:[2.0.1-RELEASE][root@x-core.localdomain]/root(1): ps aux|grep -i lcd root 1986 0.0 6.9 36188 16912 ?? SN 9:26PM 0:00.31 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php
No server running. After the boot up sound the display is correct for around 3 seconds and then LCDd is killed.
The system log for that boot shows that it only restarted LCDd twice:May 8 21:26:39 php: : pfSense package system has detected an ip change 0.0.0.0 -> ... Restarting packages. May 8 21:26:39 check_reload_status: Starting packages May 8 21:26:40 LCDd: LCDd version 0.5.5 starting May 8 21:26:40 LCDd: Using Configuration File: /usr/local/etc/LCDd.conf May 8 21:26:40 LCDd: Listening for queries on 127.0.0.1:13666 May 8 21:26:41 php: : IPSEC: One or more IPsec tunnel endpoints has changed its IP. Refreshing. May 8 21:26:41 php: lcdproc: Start client procedure. Error counter: (0) May 8 21:26:42 login: login on console as root May 8 21:26:42 sshlockout[46758]: sshlockout/webConfigurator v3.0 starting up May 8 21:26:42 LCDd: Connect from host 127.0.0.1:10527 on socket 11 May 8 21:26:43 check_reload_status: Reloading filter May 8 21:26:45 php: : Restarting/Starting all packages. May 8 21:26:48 LCDd: Client on socket 11 disconnected May 8 21:26:48 LCDd: sock_send: socket write error May 8 21:26:48 LCDd: Server shutting down on SIGTERM May 8 21:26:49 LCDd: LCDd version 0.5.5 starting May 8 21:26:49 LCDd: Using Configuration File: /usr/local/etc/LCDd.conf May 8 21:26:49 LCDd: sock_create_inet_socket: cannot bind to port 13666 at address 127.0.0.1 - Address already in use May 8 21:26:49 LCDd: sock_init: error creating socket - Address already in use May 8 21:26:49 LCDd: Critical error while initializing, abort. May 8 21:26:50 php: lcdproc: Start client procedure. Error counter: (0) May 8 21:27:01 php: lcdproc: Failed to connect to LCDd process Operation timed out (60) May 8 21:27:01 php: lcdproc: Start client procedure. Error counter: (1) May 8 21:27:09 sshd[2220]: Accepted keyboard-interactive/pam for root from 192.168.1.111 port 51742 ssh2 May 8 21:27:12 php: lcdproc: Failed to connect to LCDd process Operation timed out (60) May 8 21:27:12 php: lcdproc: Start client procedure. Error counter: (2) May 8 21:27:23 php: lcdproc: Failed to connect to LCDd process Operation timed out (60) May 8 21:27:23 php: lcdproc: Start client procedure. Error counter: (3) May 8 21:27:33 apinger: Error while feeding rrdtool: Broken pipe May 8 21:27:34 php: lcdproc: Failed to connect to LCDd process Operation timed out (60) May 8 21:27:34 php: lcdproc: Too many errors, the client ends. May 8 21:28:33 apinger: /usr/local/bin/rrdtool respawning too fast, waiting 300s. May 8 21:30:41 check_reload_status: Linkup starting re2
Result: no change! ???
Steve
-
php: : pfSense package system has detected an ip change 0.0.0.0 -> … Restarting packages.
This maybe the cause.
It's forcing all packages to restart.I'll check the startup script again.
att,
Marcello Coutinho -
Additionally the boot detection is now working so well that it inhibits all syncing at start up.
That prevented the new rc file being written out. I synced it manually. Still no change! ::)My thoughts are that it should be able to cope with this. Other packages don't have a problem being restarted multiple times. Also running LCDd with other drivers is no problem.
It seems more like LCDd cannot close correctly causing:May 8 21:50:30 LCDd: sock_init: error creating socket - Address already in use May 8 21:50:30 LCDd: Critical error while initializing, abort.
Again I really appreciate you looking at this.
Steve -
I have seen this behaviour at start up but not during normal running. Does it coincide with an IP change or an interface going up or down, when packages are restarted?
The old firebox lcd driver, which was 0.52 then 0.53, was not a pfSense package and as such it was only ever started once at boot. Currently there is an unresolved issue with the package being restarted multiple times during boot. This seems cause a problem with LCDd which cannot start/stop fast enough. On my box the daemon/client often ends up running incorrectly but after restarting manually it runs fine until I next reboot the box.
Steve
Hello Steve,
it seems that the IP change at night might cause the LCDproc to stop.
But after manually starting the LCDproc it shows sometime the info in the LCD panel CLI:0 SRV:0. And nothing more happen.Can I change some config file to prevent the behaviour to stop at IP change?
Matthias
-
There is an issue with the firebox driver and the startup procedure with the lcdproc-dev package. See my posts above this. Hopefully we can get to the cause of this soon.
When you see 'CLI:0 SRV:0' on the LCD it's because the server, LCDd, is running but the client, lcdproc_client.php, is not.
Which firebox do you have?Steve
-
There is an issue with the firebox driver and the startup procedure with the lcdproc-dev package. See my posts above this. Hopefully we can get to the cause of this soon.
When you see 'CLI:0 SRV:0' on the LCD it's because the server, LCDd, is running but the client, lcdproc_client.php, is not.
Which firebox do you have?Steve
Hi Steve,
I have a Firebox X750 showing this effect.
But yesterday I switched to my backup firebox X700 ;-). And there is not such a behaviour. It runs like a charm… with the same config.
After the nightly IP switch the LCDproc is still running cycling thru the different screens.
Maybe it depends on the X750 model?Matthias
-
Interesting. It does seem to be very dependent on the timing. The x750e has a much faster CPU. I was testing on an x700.
Steve
-
Interesting. It does seem to be very dependent on the timing. The x750e has a much faster CPU. I was testing on an x700.
Steve
Yes, my box was upgraded with a 1.7Ghz CPU!
But my X700 has also a faster CPU in it. -
I have been trying lcdproc-0.5.5 pkg v. 0.9.4 in an AR Infotek Teak 3035L without success.
Does any one have any experience with this device?
The box comes with source code for a standalone Linux program which works with the LCD panel, so it may be that I just have to figure out how to write an LCDProc driver.
Thanks
Mike -
Need more information. What type of LCD is it? How is it connected? Are there any drivers/example code available? Etc!
Steve
-
The label on the panel says SC2002D. I have found some suggestion that this is HD44780 compatable, but I could not get it to work with that driver.
It is a serial interface.
As I said in my original post there is Linux source code provided that does work. If no one has any insites on a working configuration/driver then I will look at using this source to write a driver.
-
I think in fact we already have that somewhere I remember reading the code.
A quick search shows that there was some discussion on this on the pfSense mailing list:
http://www.mail-archive.com/support@pfsense.com/msg20822.htmlI think there is a good chance that this could be persuaded to work with lcdproc. However currently there are a number of drivers and options that are not selectable via the package. In order to test them you would have to stop the lcdproc service and then edit /usr/local/etc/LCDd.conf appropriately. Each time you restart or sync the packge this will be overwritten but it can easily be incorporated if you find a working combination.
Currently if you select HD44780 as the driver it automatically selects USB2LCD as the connection type, which is obviously not right for you.
See: http://lcdproc.sourceforge.net/docs/current-user.html#hd44780-howtoEdit: Looking at the data sheet for the sc2002d it has a parallel interface so it's likely you have some serial-parallel converter somewhere.
Steve
-
This thread brought me to this thread:
http://forum.pfsense.org/index.php/topic,49481.0.htmlI am getting issue with my SureElec LCD with this error:
May 16 23:40:15 LCDd: LCDd version 0.5.5 starting May 16 23:40:15 LCDd: Using Configuration File: /usr/local/etc/LCDd.conf May 16 23:40:15 LCDd: Listening for queries on 127.0.0.1:13666 May 16 23:40:15 LCDd: SureElec: failed to configure port (Inappropriate ioctl for device) May 16 23:40:15 LCDd: Driver [SureElec] init failed, return code -1 May 16 23:40:15 LCDd: Could not load driver SureElec May 16 23:40:15 LCDd: There is no output driver May 16 23:40:15 LCDd: Critical error while initializing, abort. May 16 23:40:16 php: lcdproc: Start client procedure. Error counter: (0)
and this config:
[server] DriverPath=/usr/local/lib/lcdproc/ Driver=SureElec Bind=127.0.0.1 Port=13666 ReportLevel=3 ReportToSyslog=yes User=nobody Foreground=no ServerScreen=no GoodBye="Thanks for using" GoodBye=" pfSense " WaitTime=5 ToggleRotateKey=Enter PrevScreenKey=Left NextScreenKey=Right ScrollUpKey=Up ScrollDownKey=Down [menu] MenuKey=Escape EnterKey=Enter UpKey=Up DownKey=Down [SureElec] driverpath =/usr/local/lib/lcdproc/ Device=/dev/ugen0.2 Size=20x4 Edition=3 Contrast=200 Brightness=480
-
May 30 00:26:59 LCDd: Client on socket 13 disconnected May 30 00:26:59 LCDd: sock_send: socket write error May 30 00:27:00 LCDd: Server shutting down on SIGTERM May 30 00:27:01 LCDd: LCDd version 0.5.5 starting May 30 00:27:01 LCDd: Using Configuration File: /usr/local/etc/LCDd.conf May 30 00:27:01 LCDd: Listening for queries on 127.0.0.1:13666
I keeps getting the error above every 5-15 minutes and my LCD shows "LCDproc Server" only… it stops to show my screens after that error.
-
I've been working on hardware that is the bigger version of the Watchguard Firebox LCDs (Lanner LCM, etc). I set lcdproc-dev to 20x2 mode, but the screens appear to run in 16x4 mode even tho the options screen and "Next/Prev" popups appear in the extra eight "blank" spots at times. Are the SDECLCDs screens hard-coded at 16x4? I've also had to edit lcdproc.inc to change the button mapping, (Up and Down just need reversed) this should solve the Firebox X Core-e issue? Can we get a GUI to modify key mappings in LCD-proc dev?
Also, how would one go about converting the SDECLCD(x86 ONLY) to be x86-64bit capable? I would like to get these LCM drivers fully working, but I'm a total lame when it comes to freebsd C programming. I have hardware that needs 64bit OS to be fully utilized, and would love for lcdproc to be running on them.
Also, my menu system isn't completely dead, it's just a total hack-job since it takes some lcdproc-dev file edits to get LCDExec starting and stopping properly, but I've made progress. The menu system is seriously over-rated, i get messages constantly from people wanting to get the scripts, but I fear that they aren't ready for anyone except those who I know what hardware/configurations they use. Last thing we need is the Restore/Backup/ResetToDefault menu bricking boxes. ::)
-
The X-Core-e buttons should be correctly mapped in the current package.
Fmertz has just updated the driver to include detection on the box type and mapping for the XTM5 but I haven't had a chance to test it yet.Steve
-
OK All, question for the minds. I have another box I am working on. Ti has an Intel D2500CCE motherboard and a CrystalFontz CFA633-YYB-KS LCD. The Intel serial header uses what Crystal Fontz calls an "alternate rs-232 pin assignment". I loaded windows 7 on the box, and used Crystal Fontz's utility, and the LCD is working correctly on Com 2 @ 19200.
When I load pfSense 2.01 and LCDproc-dev, I CANNOT get the LCD to function. I am picking com 2 alternate /dev/cuau1. I have also tried just com 2. Any helpful ideas? Maybe it is because of the "alternate pinout"???
The documentation shows standard as pin 2 Rx, pin 3 Tx, and pin 5 ground. The alternate, that I am using is pin 2 Tx, pin 3 ground, and pin 6 Rx.
I don't know what to try next.
SOMEBODY HELP!
Thanks -
Are the SDECLCDs screens hard-coded at 16x4?
I've also had to edit lcdproc.inc to change the button mapping, (Up and Down just need reversed) this should solve the Firebox X Core-e issue?
Also, how would one go about converting the SDECLCD(x86 ONLY) to be x86-64bit capable?
The driver is hard coded for 20x2. This is the max the driver will allow, and will clip anything outside of this window.
Not sure what is up with the buttons. AFAIK, the code supports all versions of the Fireboxes (with the XTM pending release). With the exception of the XTM, all key codes are unique, and all key codes reported on this forum have been incorporated in the code.
A 64bit binary of the driver is here (rename it to sdeclcd.so):
https://github.com/downloads/fmertz/sdeclcd/sdeclcd64.so
Do you have a 64bit version of LCDd already? You can check with "file LCDd".
Also, does this Lanner box have the same LEDs as the Fireboxes? The code I am working on incorporates control for the LEDs, based on the specifics reported on this forum, i.e. ICH model, specific GPIO pin, etc.