LCDProc package [picolcd now actually works :D]
-
For more info about this particular driver, see http://lcdproc.sourceforge.net/docs/current-user.html#picolcd
The display: http://www.mini-box.com/picoLCD-20x2-OEMI could not access it on 1.2.3, since there seems to be an USB "hack" necessary to get it working.
Thinking this one: http://www.freebsd.org/cgi/query-pr.cgi?pr=128803 , but no clue about how to apply it.The web page provides a patch to a couple of kernel source files. The kernel would need to be rebuilt to include the patch. The web page suggests the patch is already in FreeBSD 8.0 and hence in pfSense 2.0.
The LCD wasn't found at all there by LCDProc, but it was listed when using the usbdevs command (in 1.2.3):
Controller /dev/usb2:
addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), Intel(0x0000), rev 1.00
uhub2
port 1 powered
port 2 addr 2: full speed, power 100 mA, config 1, USB-LCD-20x2(0x0002), ITUNER INC(0x04d8), rev 0.01Thats when I thought of trying pfSense 2.0, where the usbdevs command is not found, so used dmesg instead and ended up with "/dev/ugen2.2" instead of the "/dev/usb2" in 1.2.3.
The /dev/usb2 is the controller of the USB bus to which the LCD panel is connected. /dev/usb2 does not and did not provide an interface to the LCD.
Since I don't have any kind of LCD panel I could connect to a pfSense box I'm probably not in a position to give further help with this.
-
"The /dev/usb2 is the controller of the USB bus to which the LCD panel is connected. /dev/usb2 does not and did not provide an interface to the LCD."
Hmm, than the absence of that patch most likely caused the display not being recognized properly.I just found out that in pfSense 2.0/FreeBSD 8 the usbdevs command no longer exists, now it's usbconfig which gave this:
[admin@pfSense.local]/dev(21): usbconfig
ugen0.1: <uhci root="" hub="" intel="">at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen1.1: <uhci root="" hub="" intel="">at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen2.1: <uhci root="" hub="" intel="">at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen3.1: <uhci root="" hub="" intel="">at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen4.1: <ehci root="" hub="" intel="">at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen2.2: <usb-lcd-20x2 ituner="" inc="">at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON</usb-lcd-20x2></ehci></uhci></uhci></uhci></uhci>"Since I don't have any kind of LCD panel I could connect to a pfSense box I'm probably not in a position to give further help with this."
'kay.edit:
I think I am on to something (again). Tried to start lcdproc from commandline with Putty (connected through SSH).
Got this:sock_init_sockaddr: Unknown host localhost.
Error connecting to LCD server localhost on port 13666.
Check to see that the server is running and operating normally.LCDd is running, but it seems it doesn't know localhost ???
edit2: Yes ;D, finally it works ;D ;D , more or less.
changed localhost to 127.0.0.1, now it displays system info and other stuff.
Although lcdproc isn't responding to the screens I enabled in the webinterface (https://ip-of-pfsense-box/pkg_edit.php?xml=lcdproc_screens.xml&id=0her), it just displays everything (haven't seen "uptime" come by though)…. But hey, it works ;Dedit3: it seems that I have to manually start LCDd and lcdproc by commandline after booting pfSense, think a simpel bootscript will do that. Anyway, besides a few minor "flaws", picolcd now finally works ;D
-
Good job!!! I'm in the process of building a new box, waiting on parts.. Was going to start with 1.2.3 but I may just load 2.0 on it instead. If OpenVPN works for me with no issues, I would like to try this hack…. When you have chance, could you add to your first post all the steps you took to get it up and running?
-
Thanks ;D, but don't thank me yet :P
Managed to get some output, but the settingspage in pfSense webpage doesn't do anything. Doesn't matter what screens I select, I get all of them (maybe because I have the embedded version of pfSense?).
Anyway, I'll try to make a howto tonight :)edit, before continuing reading, you might want to get a large cup of coffee (or whatever you like, I hate coffee….):
1. install LCDProc using that package page in pfSense 2.0;2. Download the following files and put them in there designated directories:
http://www.ravenslair.nl/files/picolcd.so /usr/local/lib/lcdproc/picolcd.so
http://www.ravenslair.nl/files/libusb.so.2 /usr/local/lib/libusb.so.2
http://www.ravenslair.nl/files/libkvm.so.5 /lib/libkvm.so.5
I used the FTP command to download them to pfSense since get and wget aren't found. Since I'm (obviously) not giving my login info ;) , use BPFTP or something to set up a FTP server or if someone knows a different way of transfering files….3. Log on with Putty through SSH and go to the console (menu option 8 ) and run this command: cp /lib/libkvm.so.5 /lib/libkvm.so.4
4. Run the usbconfig command to figure out which /dev/* the picolcd is designated as.
This is how it looks here:[admin@pfSense.local]/root(5): usbconfig
ugen0.1: <uhci root="" hub="" intel="">at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen1.1: <uhci root="" hub="" intel="">at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen2.1: <uhci root="" hub="" intel="">at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen3.1: <uhci root="" hub="" intel="">at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON
ugen4.1: <ehci root="" hub="" intel="">at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON
ugen2.2: <USB-LCD-20x2 ITUNER INC> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON</ehci></uhci></uhci></uhci></uhci>So /dev/ugen2.2 is what you need to know.
5. Use the file editor in pfSense's webinterface (Diagnostics menu -> Edit File) to edit /usr/local/pkg/lcdproc.xml.
First scroll down till you see the list of ports:<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></options>Add this to the list if the picolcd is recognized as /dev/ugen2.2:
<option><value>ugen2.2</value>
<name>ugen2.2 (/dev/ugen2.2)</name></option>Then scroll down to the driver list and add the following:
<option><value>picolcd</value>
<name>picolcd</name></option>Now save it, hit the "save" button ;).
6. Same as step 5, but now /usr/local/pkg/lcdproc.inc.
In this file there are two port lists, the first looks like this:case "none":
continue;
break;
case "com2":
continue;
break;
case "ucom1":
continue;
break;
case "ucom2":
continue;
break;
case "lpt1":
continue;
break;Add this to that list:
case "ugen2.2":
continue;
break;Then the next list, looks like:
case "com2":
$realport = "/dev/cua1";
break;
case "ucom1":
$realport = "/dev/cuaU0";
break;
case "ucom2":
$realport = "/dev/cuaU1";
break;
case "lpt1":
$realport = "/dev/lpt0";
break;Add this:
case "ugen2.2":
$realport = "/dev/ugen2.2";
break;The driver list is a little further down and looks like this:
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;Add:
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";
break;Hit save.
7. Edit /usr/local/etc/LCDd.conf the same way (with the Edit File menu) like the previous files. If LCDd.conf does not exist yet, enter this on the console cp /usr/local/etc/LCDd.conf.sample /usr/local/etc/LCDd.conf
The edit: put picolcd next to Driver= instead of what driver there might already be and save it.8. Edit /usr/local/etc/lcdproc.conf. Like LCDd.conf, if it does not exist: cp /usr/local/etc/lcdproc.conf.sample /usr/local/etc/lcdproc.conf
The edit: change Server=localhost to Server=127.0.0.1 and save it.And then you're done ;D
If you want to start it manually now, go to /usr/local/sbin. First type LCDd followed by an ENTER, then lcdproc, again an ENTER. Or reboot the system.Some (more) good news: while making this howto I figured out what was causing this:
$input_errors[] = "The chosen com port is not valid";
and the not automatic startup of LCDd (server). Seems there was a second interfaces list in /usr/local/pkg/lcdproc.inc ….. :D
The lcdproc client won't startup automatically though, another "flaw" that needs fixing ;) -
I followed your steps and it works for me… Like you said, still has some flaws, but this a really good start!!! Wish I knew more about freebsd/php so I could help getting it to fully work.. More of a windows server/networking/telecom guy then unix...
again, good work!!
ps, i get all the screens too and i'm installed to a HD
-
Yay :)
My knowledge about FreeBSD/php is very limited, so I'm not sure if I can resolve the flaws by myself. But I think I'll first wait for the final of 2.0, see of that helps, you never know ;)
When is the final coming anyway? Can't seem to find when….Thanks ;D
Hmm, so I'm guessing it's not because I run the embedded version, thought the settings wouldn't stick or something because of that. But since you installed it to a HD....
-
The settings would stay… but they made change to the display. I forgot to mention this before. I can make 1 change only to the GUI. After that change is complete, even if its to disable lcdpro, I have to start the box since it locks up the gui... hmm i should see if i can restart the gui from the console... as the router is still functionally, just not the web gui
-
bartgrefte,
Have you messed anymore with LCDProc? I installed pfSense 2.0 beta4 the other night to give it look see… Since it was running stable and everything was working for me, i decided to get my LCD to work again.
Were you ever able to get the web interface to work? By manually editing the lcdproc.conf, I'm able to get the LCD to display what I want it to display from the default screens. Looking at lcdproc_client.php, this file seems to create new screens that are more pfsense related. I think its a different client then lcdproc but not sure. I've been able able to get LCDd and lcdproc to auto start by creating a startup script in the /usr/local/etc/rc.d folder.
-
I have the same problem as Cino with any change to LCD Proc pages locks up the entire pfSense web interface. Haven't been able to reset it from the console. Only solution so far is to reboot.
I also have the lcdproc auto-start problem. The real problem is that nothing is telling lcdproc to start. Specifically, /usr/local/etc/rc.d/lcdproc.sh, which is automatically created by pfSense using /usr/local/pkg/lcdproc.inc, only starts LCDd and lcdclient.sh. My solution is to add the following bold lines to /usr/local/pkg/lcdproc.inc:
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 '/lcdpro[c]/ {print $2}'| wc -l
!= 0 ]; then
ps auxw |awk '/lcdpro[c]/ {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
fiEOD;
$start = $stop ."\n";
$start .= "\t/usr/local/sbin/LCDd -c ". LCDPROC_CONFIG ."\n";
$start .= "\t/usr/local/bin/lcdproc -c /usr/local/etc/lcdproc.conf\n";
$start .= "\t". LCDPROC_CLIENT ." &\n";(Ideally the second to last line should replace /usr/local/etc/lcdproc.conf with a variable like the other lines, but since the prior line already uses the most obvious name, I just hardcoded it.)
FYI, you can also optionally add/change the following to /usr/local/pkg/lcdproc.inc to create a custom startup/shutdown message:
$config_text .= "Hello="Startup Line 1"\n";
$config_text .= "Hello="Startup Line 2"\n";
$config_text .= "GoodBye="Shutdown Line 1"\n";
$config_text .= "GoodBye="Shutdown Line 2"\n";What I don't understand is how the LCDProc package works for any LCD, because it seems to me that lcdproc is vital. Maybe I just don't understand this package fully, because I don't see that the PHP client does anything.
Another error I have not figured out yet is enabling "BigClock" in /usr/local/etc/lcdproc.conf works, except that the right half of the top LCD row is stuck displaying the previous screen instead of showing the top of the numbers. Shame…probably my favorite of the default screens.
Last, I have to say that while I'm impressed with all the graphs and stats that the default screens can display, I am hugely disappointed that there is no apparent way to create custom lines. All I really care about displaying is my company/client name and the LAN IP (preferably the full pfSense management URL, like https://192.168.1.1:8080).
Does any one know how to display custom text with LCDProc?
-
Dang it! I don't think my above lcdprod.inc startup patch is working. I swear it was before. Maybe I broke something elsewhere with all my tweaking. If you try the above, please post whether or not it works.
In other news, BigClock magically fixed itself and simultaneously screwed itself up even worse. Display shows the whole time now, but some numbers–mainly the minutes and seconds--have extra and/or missing sections (0=6, 1=9, 2=backwards 9, 3=9, 4=E, etc.). It's so bad that I can't tell what time it is. Oh well. Still rather display IP if anyone knows how.
-
I've made a lot of progress, but can't remember details of what i edited. Basically I had to fine tune lcdproc.inc, lcdproc.xml, lcdproc_client.php, lcdproc_screens.xml. Now I'm able to have LCDProc auto start, able to use the options within the pfsense menu. I've been meaning to write an add-on to bartgreft how-to.. So here is a draft:
You can download a copy of my current files by clicking the below link. Do a chmod to install.sh and update.sh so you can execute them or you can manually copy the files over.
http://dl.dropbox.com/u/11597356/lcdproc_picolcd.tgzFresh Install:
1: Install LCDProc from the Packages menu
2: Follow bartgreft Step 4-6 but edit the files I attached (I think I may have a better way for this but I have to test idea first.)
3: run ./install.sh
4: Goto LCDProc within pfsense Services menu: select the correct Com Port from step 2, Display Size 2 Rows 20 Columns, Driver picolcd; click save. Goto the screen tab and click the screens you want and save.
5: Start LCDProc service from the Services menu (If it doesn't start, reboot and try this step again.After a pfsense update and all your packages have been re-installed:
1: run ./update.sh
2: Goto LCDProc within Pfsense Services menu: select the correct Com Port from step 2, Display Size 2 Rows 20 Columns, Driver picolcd; click save. Goto the screen tab and click the screens you want and save.
3: Start LCDProc service from the Services menu (If it doesn't start, reboot and try this step again.)Note: Stop the LCDProc service before making any changes via the WebGUI. After you save your changes, start the LCDProc service. I've found if LCDProc service is running, it will hang the WebGUI interface.
If you look at file lcdproc.inc around line 192 and 297. This is where I added the custom options for the picolcd drive. Turned off some of the buttons, added pfsense is starting up, shutting down.. This file I believe is what creates the LCDd.conf file for startup. The file lcdproc.conf is for the built-in functions that LCDProc provides: Big Clock(I don't use it), cpu, load. For custom screens, I think you need to look at lcdexec.conf.sample. Once you create your custom lcdexec.conf, you would need to start lcdexec process i think.
The next time I do a fresh install, I'll create a real how-to for all to use. Maybe with photos too.
P.S. Without the work bartgrefte did, I dont think I would had been able to figure this out.
Edit: I updated my archive with compare screen shots of the old/new files in-case anyone wants to manually update their files or add to what I did.
-
bartgrefte,
Have you messed anymore with LCDProc? I installed pfSense 2.0 beta4 the other night to give it look see… Since it was running stable and everything was working for me, i decided to get my LCD to work again.
Were you ever able to get the web interface to work? By manually editing the lcdproc.conf, I'm able to get the LCD to display what I want it to display from the default screens. Looking at lcdproc_client.php, this file seems to create new screens that are more pfsense related. I think its a different client then lcdproc but not sure. I've been able able to get LCDd and lcdproc to auto start by creating a startup script in the /usr/local/etc/rc.d folder.
Thought I saw a familiar topic pop up, almost forgot I made this :P
I haven't looked in to this for a while. My knowledge of FreeBSD is very limited, I was happy enough just to get the picolcd to work, although not with webinterface…
Haven't got a clue what might cause this, maybe pfSense 2 is too new or something? Maybe it helps if the LCDProc package could get an update, or is no one working on that anymore?
edit: You just posted before me :P , gonna read that later today, have to start with diner now ;)
-
Let me know how you make out. The way my box is setup right now, i'm able to see the displays based on the web-interface and the options selected within lcdproc.conf. Also note i'm using the latest beta5 snapshot.
-
I updated my archive with screenshots comparing the original files to the ones I modify if anyone is interested in seeing the changes.
Post: http://forum.pfsense.org/index.php/topic,23919.msg173074.html#msg173074
Still need to do some more testing but I found that even tho my picolcd is on /dev/ugen2.1, I was able to get it to run under /dev/ugen1.1. Maybe a waste of code, but I think I will add ugen1.1 thru ugen8.1 as port options. Save some folks from hacking at the files. I would love to add a lcdproc config tab under the webgui that would auto-create the lcdproc.conf file, but that is wishfully thinking as i'm not a programmer. Just a copy paste, try this, try that kind of hacker….lol..
-
Thanks for that :)
You do know mine was on ugen2.2? ;)
I think it would be best to add ugen1.1 + ugen1.2 and then both up to 4.1/4.2, think that will be enough since most people use mITX boards, which don't have much USB ports…To make things easier, would it be possible to create a script that runs usbconfig and then "grep LCD" the results to figure out where the LCD is on and have that ugen set?
ugen0.1: <uhci root="" hub="" intel=""> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen1.1: <uhci root="" hub="" intel=""> at usbus1, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen2.1: <uhci root="" hub="" intel=""> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen3.1: <uhci root="" hub="" intel=""> at usbus3, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON ugen4.1: <ehci root="" hub="" intel=""> at usbus4, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON ugen2.2: <usb-lcd-20x2 ituner="" inc=""> at usbus2, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON[/][/code]</usb-lcd-20x2></ehci></uhci></uhci></uhci></uhci>
-
Thank you so much for this guide I have my CrysalFontz 633 LCD finally working as it was running on a caua0 serial interface.
Everything is working, but I am getting a little tired of manually logging into shell and running the LDCd and lcdproc commands to get the proper output vs the default lcdproc output.
Is their a way to automate this on reboot?