LCDProc starts but won't connect
-
Hi all,
I'm trying (and failing) to get lcdproc working on my pfSense box using an Adafruit USB backpack on a 20x4 LCD screen.
It seems I can get LCDd running in the background and I've even gotten it to show the LCDd welcome screen on the LCD itself. However, I'm not able to get lcdproc to connect to it. Whilst the service is shown to be running in the WebUI, It gives the following error in the log:Feb 6 19:51:58 firewall LCDd[58868]: Using Configuration File: /usr/local/etc/LCDd.conf Feb 6 19:51:58 firewall LCDd[59153]: Listening for queries on 127.0.0.1:13666 Feb 6 19:51:58 firewall LCDd[59153]: MtxOrb: unable to read device type Feb 6 19:51:58 firewall LCDd[59153]: MtxOrb: unable to read device firmware revision Feb 6 19:51:58 firewall LCDd[59153]: MtxOrb: unable to read device serial number Feb 6 19:51:58 firewall php[59221]: lcdproc: Start client procedure. Error counter: (0) Feb 6 19:52:09 firewall php[59221]: lcdproc: Failed to connect to LCDd process Operation timed out (60) Feb 6 19:52:09 firewall php[59221]: lcdproc: Start client procedure. Error counter: (1) Feb 6 19:52:20 firewall php[59221]: lcdproc: Failed to connect to LCDd process Operation timed out (60) Feb 6 19:52:20 firewall php[59221]: lcdproc: Start client procedure. Error counter: (2) Feb 6 19:52:31 firewall php[59221]: lcdproc: Failed to connect to LCDd process Operation timed out (60) Feb 6 19:52:31 firewall php[59221]: lcdproc: Start client procedure. Error counter: (3) Feb 6 19:52:42 firewall php[59221]: lcdproc: Failed to connect to LCDd process Operation timed out (60) Feb 6 19:52:42 firewall php[59221]: lcdproc: Too many errors, the client ends
Logging in to the console I can see LCDd is running, however with netstat I don't see any listening port on 13666?
[2.6.0-RELEASE][root@firewall]/root: ps aux | grep -i lcd nobody 59153 0.0 0.0 11392 2620 - SNs 19:51 0:02.67 /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf -u nobody
Trying to run lcdproc manually from the cli shows the following output:
[2.6.0-RELEASE][root@firewall]/root: lcdproc -s localhost -p 13666 sock_connect: connect failed Error connecting to LCD server localhost on port 13666. Check to see that the server is running and operating normally.
LCDd - LCDproc Server Daemon, 0.5.9
LCDproc 0.5.9LCD / USB Model:
RGB backlight positive LCD 20x4 + Adafruit USB Serial LCD Backpack Add-On with Cable
Pfsense version:
Version 2.6.0-RELEASE (amd64) built on Mon Jan 31 19:57:53 UTC 2022 FreeBSD 12.3-STABLE
usbconfig output:
[2.6.0-RELEASE][root@firewall]/root: usbconfig ugen0.1: <0x8086 XHCI root HUB> at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA) ugen0.2: <vendor 0x239a Adafruit Industries> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
Relevant dmesg output:
ugen0.2: <vendor 0x239a Adafruit Industries> at usbus0 umodem0: <vendor 0x239a Adafruit Industries, class 2/0, rev 1.01/1.00, addr 1> on usbus0
Here's my configuration:
cat /usr/local/etc/LCDd.conf [server] DriverPath=/usr/local/lib/lcdproc/ Driver=MtxOrb 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 [MtxOrb] Device=/dev/cuaU0 Size=20x4 Type=lkd hasAdjustableBacklight=no Reboot=no Contrast=480 Brightness=1000 OffBrightness=0 Speed=9600
(note, i've played around with the speed and type settings a bit too, with no change)
Note, I'm able to change the background colour, so it would seem the port I've configured is right at least:
color red: printf "%b" '\0376\0320\0377\0001\0001' > /dev/cuaU0
- turns the backlight red(ish)
printf "%b" 'Hello World' > /dev/cuaU0
doesn't seem to do anything though...
Would appreciate any insight anyone has on this.
-
Just writing to the com port like that may not do anything. Depends when the LCD controller is expecting.
I would expect one of those lcproc clients to work if the server is running though.
You shouldn't need to specify the host or port since those are the defaults so simplylcdproc C T U
for exmaple should work.Steve
-
Thanks for your reply!
Unfortunately though I can see LCDd running in the process list when I try
lcdproc C T U
I get the following message:Thanks for your time.
-
Are you able to test 2.7? I don't have anything with an LCD that's still running 2.6. Though devices I have now running 2.7 ran LCDproc fine in 2.6.
In 2.7 it starts and runs fine here in yesterdays snap:
Feb 11 13:54:50 LCDd 19353 LCDd version 0.5.9 starting Feb 11 13:54:50 LCDd 19353 Using Configuration File: /usr/local/etc/LCDd.conf Feb 11 13:54:50 LCDd 19353 Listening for queries on 127.0.0.1:13666 Feb 11 13:54:51 php 19771 lcdproc: Start client procedure. Error counter: (0) Feb 11 13:54:52 LCDd 19353 Connect from host 127.0.0.1:31343 on socket 6
You might try using one of the parallel port connected display drivers where it doesn't know if the screen is actually present. That would allow the server to start and listen as expected as a test.
Do you actually see the server listening:
[2.7.0-DEVELOPMENT][root@xtm5.stevew.lan]/root: sockstat | grep 13666 root php 47079 12 tcp4 127.0.0.1:57383 127.0.0.1:13666 nobody LCDd 47027 4 tcp4 127.0.0.1:13666 *:* nobody LCDd 47027 6 tcp4 127.0.0.1:13666 127.0.0.1:57383
-
I'll find a spare box, download 2.7 and report back soon.
It seems LCDd is listening however connecting to it is another matter, as per the below screenshot:
-
As a test try setting the SDEClcd and parallel port for the server. You should see it start and the php client connect even without a screen or even a parallel port.
-
I can report that using the same screen, I can run this on pfsense 2.7 - Using an identical configuration file on 2.6 results in no connection to the screen. A bit strange since a quick diff -s of /usr/local/pkg/lcdproc_client.php and /usr/local/etc/LCDd.conf between both versions are essentially the same.
Here's the output from 2.7:
[2.7.0-DEVELOPMENT][root@pfSense-test.home.arpa]/root: sockstat | grep 13666 root php 94904 13 tcp4 127.0.0.1:8568 127.0.0.1:13666 nobody LCDd 94880 5 tcp4 127.0.0.1:13666 *:* nobody LCDd 94880 7 tcp4 127.0.0.1:13666 127.0.0.1:8568 [2.7.0-DEVELOPMENT][root@pfSense-test.home.arpa]/root: ps aux | grep -i lcd nobody 94880 0.0 0.0 13068 2804 - SNs 02:22 0:00.23 /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf -u nobody root 94904 0.0 0.1 69648 37952 - SN 02:22 0:00.14 /usr/local/bin/php -f /usr/local/pkg/lcdproc_client.php root 2267 0.0 0.0 12808 2448 0 S+ 02:27 0:00.00 grep -i lcd [2.7.0-DEVELOPMENT][root@pfSense-test.home.arpa]/root: ls -l /dev/cuaU0 crw-rw---- 1 uucp dialer 0x78 Feb 15 02:32 /dev/cuaU0 [2.7.0-DEVELOPMENT][root@pfSense-test.home.arpa]/root: cat /usr/local/etc/LCDd.conf [server] DriverPath=/usr/local/lib/lcdproc/ Driver=MtxOrb 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 Backlight=on ToggleRotateKey=Enter PrevScreenKey=Left NextScreenKey=Right ScrollUpKey=Up ScrollDownKey=Down [menu] MenuKey=Escape EnterKey=Enter UpKey=Up DownKey=Down [MtxOrb] Device=/dev/cuaU0 Size=20x4 Type=lkd hasAdjustableBacklight=yes Reboot=no Contrast=900 Brightness=400 OffBrightness=100 Speed=9600
Here's the best I can manage on 2.6
/root: sockstat | grep 13666 nobody LCDd 46251 4 tcp4 127.0.0.1:13666 *:* /root: ps aux | grep -i lcd nobody 46251 0.0 0.0 11392 2680 - SNs 18:40 0:01.58 /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf -u nobody root 75727 0.0 0.0 11216 2548 0 S+ 19:19 0:00.00 grep -i lcd
Addendum:
I tried running LCDd in verbose mode, there were no additional messages when trying to connect using 'lcdproc C T U'
/root: LCDd -f -r 5 -s 0 -c /usr/local/etc/LCDd.conf LCDd version 0.5.9 starting Built on Jan 12 2022, protocol version 0.3, API version 0.5 Using Configuration File: /usr/local/etc/LCDd.conf Set report level to 5, output to stderr LCDd 0.5.9, LCDproc Protocol 0.3 Part of the LCDproc suite Copyright (C) 1998-2017 William Ferrell, Selene Scriven and many other contributors This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Server running in foreground Listening for queries on 127.0.0.1:13666 screenlist_init() driver_load(name="MtxOrb", filename="/usr/local/lib/lcdproc/MtxOrb.so") MtxOrb: using Device /dev/cuaU1 MtxOrb: opened display on /dev/cuaU1 MtxOrb: contrast set to 229 MtxOrb: unable to read device type MtxOrb: unable to read device firmware revision MtxOrb: unable to read device serial number Display detected: Matrix Orbital, Unknown model (0x00), Firmware Rev.: 0x00 0x00, Serial No: 0x00 0x00 MtxOrb: init() done Key "Escape" is now reserved exclusively by client [-1] Key "Enter" is now reserved shared by client [-1] Key "Up" is now reserved shared by client [-1] Key "Down" is now reserved shared by client [-1] screenlist_process() screenlist_switch(s=[_server_screen]) screenlist_switch: switched to screen [_server_screen] screenlist_process() screenlist_process() screenlist_process() ...
-
Hmm, that is odd. I wouldn't have expected any difference there either. Especially odd sicne the server clearly is able to see the driver and hardware it just doesn't accept the client.
Did you try running SDEClcd driver? I expect that to run fine in 2.6 without the screen.
-
Do you mean "Watchguard firebox with SDEC" ? I've given that a try with the com port set to parallel
That gives me the error "lcdproc: Failed to connect to LCDd process Can't assign requested address (49)"
So unfortunately not much luck. -
Hmm, that's odd error. That looks to be from the client. Does the server not start at all when you try that?
-
This is what's running:
/root: ps aux | grep -i lcd nobody 40181 0.0 0.0 11356 2660 - S<s Wed21 1:30.28 /usr/local/sbin/LCDd -c /usr/local/etc/LCDd.conf -u nobody
...However the lcdproc_client.php never connects, even if I run it manually, same story for lcdproc.
Bit of a weird one, hey?
-
Hmm, that feels more like something is blocking it but I'm not sure what could...
-
@stephenw10
I might be way off base here, but there aren't any rules or such, or permissions, blocking processes connecting on 127.0.0.1 in 2.6? -
I wouldn't expect there to be any. No different in 2.7 either.
I could just about imagine a floating block all rule might apply to localhost. But probably not from localhost also. I've never tried to block that!