pfSense Support Subscription

Author Topic: lcdproc with Sure Electronics LCD  (Read 2617 times)

0 Members and 1 Guest are viewing this topic.

Offline ezyclie

  • Newbie
  • *
  • Posts: 24
    • View Profile
lcdproc with Sure Electronics LCD
« on: May 16, 2012, 04:55:08 am »
Hi,

Anyone have experiences installing [port]sysutils/lcdproc[/port] with Sure Electronics LCD (http://www.sure-electronics.com/goods.php?id=969)?

I am getting this when trying to load the driver for testing:
Code: [Select]
[/usr/local/lib/lcdproc]# LCDd -d SureElec
SureElec: open(/dev/ttyUSB0) failed (No such file or directory)
Driver [SureElec] init failed, return code -1
Could not load driver SureElec
There is no output driver
Critical error while initializing, abort.

Code: [Select]
[/usr/local/lib/lcdproc]# dmesg | grep usb
uslcom0: <CP2102 USB to UART Bridge Controller> on usbus1

Online stephenw10

  • Hero Member
  • *****
  • Posts: 8103
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #1 on: May 16, 2012, 06:21:48 am »
There is a pfSense package for lcdproc in case you weren't aware.
You probably need to point LCDd at the generated serial port, probably /dev/cuaU0.1. The uppper case 'U' indicates a usb connected serial port. Look in /dev before and after you plug it in to see what appears.

Steve

Offline ezyclie

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #2 on: May 16, 2012, 07:08:12 am »
This what i have

Code: [Select]
$ ls /dev
ad0
ad0s1
ad0s1a
ad0s2
ad0s2a
ad0s3
ata
bpf
bpf0
console
crypto
ctty
cuau0
cuau0.init
cuau0.lock
cuau1
cuau1.init
cuau1.lock
devctl
devstat
fd
fido
geom.ctl
io
klog
kmem
led
md0
md1
mdctl
mem
nfslock
null
pci
pf
ptmx
random
speaker
stderr
stdin
stdout
ttyu0
ttyu0.init
ttyu0.lock
ttyu1
ttyu1.init
ttyu1.lock
ufs
ufsid
ugen0.1
ugen0.2
ugen1.1
urandom
usb
usbctl
xpt0
zero

There is no cuaU0 with capital 'U'

and this what i have if use ugen0.2
Code: [Select]
May 16 20:23:46 LCDd: LCDd version 0.5.3 starting
May 16 20:23:46 LCDd: Using Configuration File: /usr/local/etc/LCDd.conf
May 16 20:23:46 LCDd: Listening for queries on 127.0.0.1:13666
May 16 20:23:46 LCDd: SureElec: cannot write to port
May 16 20:23:46 LCDd: Driver [SureElec] init failed, return code -1
May 16 20:23:46 LCDd: Could not load driver SureElec
May 16 20:23:46 LCDd: There is no output driver
May 16 20:23:46 LCDd: Critical error while initializing, abort.
May 16 20:23:52 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:23:57 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:24:09 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:24:21 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:24:33 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:24:44 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:24:56 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:25:08 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:25:20 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:25:32 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
May 16 20:25:44 php: lcdproc: Failed to connect to LCDd process Operation timed out (60)
« Last Edit: May 16, 2012, 07:23:25 am by ezyclie »

Online stephenw10

  • Hero Member
  • *****
  • Posts: 8103
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #3 on: May 16, 2012, 08:18:46 am »
Hmm, ok. Those serial devices are just the seemingly omnipresent com1 and com2.
Any of those disappear when you unplug it?

Clearly your screen is being recognised and attached to the uslcom(4) driver.

Steve

Edit: Try looking in /dev/usb

Edit2: I see that your display is 'edition 3' and there is a driver option for that:
http://lcdproc.sourceforge.net/docs/current-user.html#SureElec

Edit3: Your device is on usbus1 so try ugen1.1      <-- try this first! Hmm unsure about this now. It should definitely appear as ugen1.x though as it's on usbus1. ugen1.1 is probably the hub though.
« Last Edit: May 16, 2012, 08:53:43 am by stephenw10 »

Offline ezyclie

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #4 on: May 16, 2012, 09:37:20 am »
There is no ugen0.2 when i unplugged the LCD but i am still getting same error:
Code: [Select]
LCDd: Driver [SureElec] init failed, return code -1
I have tried /dev/usb/0.2.0 and /dev/usb/0.2.1 but same got this error:
Code: [Select]
LCDd: SureElec: failed to configure port (Inappropriate ioctl for device)
« Last Edit: May 16, 2012, 09:46:02 am by ezyclie »

Online stephenw10

  • Hero Member
  • *****
  • Posts: 8103
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #5 on: May 16, 2012, 10:30:51 am »
Ok so assume ugen0.2, have you tried 'edition=3'?

Steve

Offline ezyclie

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #6 on: May 16, 2012, 10:31:59 am »
Tried and no success. Here is my LCDd.conf

Code: [Select]
[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

with this error logs:
Code: [Select]
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)
« Last Edit: May 16, 2012, 10:37:50 am by ezyclie »

Online stephenw10

  • Hero Member
  • *****
  • Posts: 8103
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #7 on: May 16, 2012, 11:08:05 am »
Reading through the source code for the Sure Elec driver it expects to see a serial port not a usb device.

Surprising that the uslcom driver does not generate a new serial device.  ???

You should ask in the lcdproc-dev package thread. The new maintainer, mdima, is using a SureElec LCD.

Steve

Online stephenw10

  • Hero Member
  • *****
  • Posts: 8103
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #8 on: May 16, 2012, 11:25:15 am »
It looks like the device should appear as ucom0.
You need to have the ucom(4) driver loaded. Is it in the kernel?
The uslcom driver has been updated quite a bit since 8.1 was released, though it seems to recognise your device.

You could try adding the ucom driver from here:
http://files.pfsense.org/jimp/ko-8.1/i386/ucom.ko
Add it to /boot/modules.
Load it from the command line:
Code: [Select]
kld_load ucom.ko
Or add ucom_load="YES" to /boot/loader.conf.local and reboot.

Steve

Offline ezyclie

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #9 on: May 16, 2012, 07:44:57 pm »
How to upload ko file to my router? is it allowed?

Online stephenw10

  • Hero Member
  • *****
  • Posts: 8103
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #10 on: May 16, 2012, 08:15:40 pm »
Yes you can upload it. I usually use WinSCP uploading from windows.
Alternatively you can fetch it directly from the machine:
Code: [Select]
[2.0.1-RELEASE][root@pfsense.fire.box]/root(1): cd /boot/modules
[2.0.1-RELEASE][root@pfsense.fire.box]/boot/modules(2): /etc/rc.conf_mount_rw
[2.0.1-RELEASE][root@pfsense.fire.box]/boot/modules(3): fetch http://files.pfsense.org/jimp/ko-8.1/i386/ucom.ko
ucom.ko                                       100% of   20 kB  429 kBps
[2.0.1-RELEASE][root@pfsense.fire.box]/boot/modules(4): kldload ucom
kldload: can't load ucom: File exists
[2.0.1-RELEASE][root@pfsense.fire.box]/boot/modules(5): /etc/rc.conf_mount_ro

However as you can see on my machine ucom is already present in the kernel.

The only other thing is to check that the USB product and vendor IDs are in the source code correctly.
Enter: usbconfig dump_device_desc
Paste the output here.

Steve

Offline ezyclie

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #11 on: May 17, 2012, 06:16:43 am »
This what i have now:

Code: [Select]
$ usbconfig dump_device_desc
ugen0.1: <OHCI root HUB AMD> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0100
  bDeviceClass = 0x0009
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <AMD>
  iProduct = 0x0002  <OHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

ugen1.1: <EHCI root HUB AMD> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0200
  bDeviceClass = 0x0009
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0001
  bMaxPacketSize0 = 0x0040
  idVendor = 0x0000
  idProduct = 0x0000
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <AMD>
  iProduct = 0x0002  <EHCI root HUB>
  iSerialNumber = 0x0000  <no string>
  bNumConfigurations = 0x0001

ugen0.2: <CP2102 USB to UART Bridge Controller Silicon Labs> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON

  bLength = 0x0012
  bDescriptorType = 0x0001
  bcdUSB = 0x0110
  bDeviceClass = 0x0000
  bDeviceSubClass = 0x0000
  bDeviceProtocol = 0x0000
  bMaxPacketSize0 = 0x0040
  idVendor = 0x10c4
  idProduct = 0xea60
  bcdDevice = 0x0100
  iManufacturer = 0x0001  <Silicon Labs>
  iProduct = 0x0002  <CP2102 USB to UART Bridge Controller>
  iSerialNumber = 0x0003  <0001>
  bNumConfigurations = 0x0001

Code: [Select]
$ ls /dev
ad0
ad0s1
ad0s1a
ad0s2
ad0s2a
ad0s3
ata
bpf
bpf0
console
crypto
ctty
cuau0
cuau0.init
cuau0.lock
cuau1
cuau1.init
cuau1.lock
devctl
devstat
fd
fido
geom.ctl
io
klog
kmem
led
md0
md1
mdctl
mem
nfslock
null
pci
pf
ptmx
random
speaker
stderr
stdin
stdout
ttyu0
ttyu0.init
ttyu0.lock
ttyu1
ttyu1.init
ttyu1.lock
ufs
ufsid
ugen0.1
ugen0.2
ugen1.1
urandom
usb
usbctl
xpt0
zero

NOTE: This LCD works properly under FreeBSD 9-STABLE but not under pfSense 2.0.1-RELEASE (i386)
« Last Edit: May 17, 2012, 06:29:17 am by ezyclie »

Online stephenw10

  • Hero Member
  • *****
  • Posts: 8103
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #12 on: May 17, 2012, 08:33:54 am »
In that case it's almost certainly due to the usb ids not in the source.
Have you tried one of the pfSense 2.1 snapshots? Based on FreeBSD 8.3.

Under FreeBSD 9 does it generate a new serial port?

Looking at the 8.1 source it is in the usbdevs file.
The ucom functionality has been changed from 8.2 up so it's hard to see how to update.

Steve
« Last Edit: May 17, 2012, 08:46:54 am by stephenw10 »

Offline ezyclie

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #13 on: May 17, 2012, 08:40:27 am »
It generates ugen1.2

I will try 2.1 tonight and will let you know asap.

Offline ezyclie

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: lcdproc with Sure Electronics LCD
« Reply #14 on: May 17, 2012, 11:07:18 am »
It worse now, even my ntpd won't start with 2.1