Re: Connecting a USB UPS

2009-08-19 Thread Daniel Feiglin
Nope. There is no such thing as a ttyUSB0 device anywhere. However, in
the mean time I found someone else with the same problem, who did this:

Begin quote:

USB Serial Converter support

This serial driver supports a wide range of USB to serial adapters. It
also allows communication with the Handspring Visor. You need to turn on
USB Serial Converter support, and then select whichever of the various
particular drivers you need. The Generic Serial Driver can be used with
a wide range of converters, by specifying the vendor and product ID
codes when you load the USB serial converter module: insmod usb-serial.o
vendor=0x product-0x, where you need to change the  and 
to match your device.

The serial port driver uses a major number of 188. Up to sixteen serial
ports are supported. To create the appropriate device entries, use the
following commands:

mknod /dev/usb/ttyUSB0 c 188 0
...
mknod /dev/usb/ttyUSB15 c 188 15

You should now be able to plug in a serial device into the adapter, and
use the /dev/usb/ttyUSB0 just as if it were a normal serial port.

End quote.

Well, it didn't work, but it is in the right direction. I now see two
new devices in /dev, hiddev0 and hidraw0. That was the immediate effect
of the insmod.

Grinding on 

Daniel


Ori Idan wrote:
> It seems to be usb to serial device so try /dev/ttyUSB0
>
> -- 
> Ori Idan
>
>
> 2009/8/19 Daniel Feiglin  >
>
> Hello folks!
>
> I use a SL1000 UPS. The model is marketed by Advice, and looks like
> their continuation of the Sustainer UPS line. It comes with both a
> serial and USB port. The serial version of the SL line always
> worked OK
> under Linux with their grotty (but adequate) UPSMON program, which
> comes
> with the unit (or may be downloaded from the Powercom site.
> www dot pcmups dot com dot tw).
>
> My current workstation does not have any serial ports, so the supplied
> UPSMON will not work.
>
> As proof of hardware integrity for what follows, I ran up the supplied
> Windows UPS software on an XP client running under VMware. The new USB
> device was detected and everything worked as it should.
>
> Back to Linux:
> I'm running openSUSE 11.1 with KDE 3.5 fully updated.
>
> First, the relevant line from lsusb:
>
> Bus 004 Device 008: ID 0d9f:0002 Powercom Co., Ltd
>
> Next, an extract from the YAST hardware Information module:
>
> - hal device list -
>  0: udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial_if0'
>  info.subsystem = 'usb'
>  usb.interface.number = 0 (0x0)
>  info.linux.driver = 'usbhid'
>  usb.product = 'USB HID Interface'
>  usb.device_subclass = 0 (0x0)
>  usb.interface.class = 3 (0x3)
>  info.product = 'USB HID Interface'
>  usb.linux.sysfs_path =
> '/sys/devices/pci:00/:00:1d.0/usb4/4-1/4-1:1.0'
>  usb.speed = 1.5
>  usb.interface.subclass = 0 (0x0)
>
>  info.udi =
> '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial_if0'
>  usb.device_revision_bcd = 0 (0x0)
>  usb.device_protocol = 0 (0x0)
>  usb.interface.protocol = 0 (0x0)
>  usb.configuration_value = 1 (0x1)
>  usb.version = 1.0
>  usb.max_power = 100 (0x64)
>  usb.vendor_id = 3487 (0xd9f)
>  linux.sysfs_path =
> '/sys/devices/pci:00/:00:1d.0/usb4/4-1/4-1:1.0'
>  usb.num_configurations = 1 (0x1)
>  usb.is_self_powered = false
>  info.parent =
> '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial'
>  usb.num_ports = 0 (0x0)
>  usb.product_id = 2 (0x2)
>  usb.num_interfaces = 1 (0x1)
>  usb.can_wake_up = false
>  usb.linux.device_number = 7 (0x7)
>  usb.vendor = 'Powercom Co., Ltd'
>  linux.hotplug_type = 2 (0x2)
>  usb.device_class = 0 (0x0)
>  usb.bus_number = 4 (0x4)
>  linux.subsystem = 'usb'
>
>  1: udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial'
>  info.subsystem = 'usb_device'
>  info.linux.driver = 'usb'
>  usb_device.product = 'USB to Serial'
>  linux.device_file = '/dev/bus/usb/004/007' <<- That's it
>  usb_device.linux.sysfs_path =
> '/sys/devices/pci:00/:00:1d.0/usb4/4-1'
>  info.product = 'USB to Serial'
>  usb_device.device_revision_bcd = 0 (0x0)
>  usb_device.configuration_value = 1 (0x1)
>  usb_device.max_power = 100 (0x64)
>
>  info.udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial'
>  usb_device.num_configurations = 1 (0x1)
>  usb_device.num_ports = 0 (0x0)
>  usb_device.num_interfaces = 1 (0x1)
>  usb_device.linux.device_number = 7 (0x7)
>  usb_device.device_class = 0 (0x0)
>  linux.sysfs_path = '/sys/devices/pci:00/:00:1d.0/usb4/4-1'
>  usb_device.device_subclass = 0 (0x0)
>  info.vendor = 'Powercom Co., Ltd'
>  usb_device.speed = 1.5
>  info.parent =
> '/org/freedesktop/Hal/de

Re: Connecting a USB UPS

2009-08-19 Thread Ori Idan
It seems to be usb to serial device so try /dev/ttyUSB0

-- 
Ori Idan


2009/8/19 Daniel Feiglin 

> Hello folks!
>
> I use a SL1000 UPS. The model is marketed by Advice, and looks like
> their continuation of the Sustainer UPS line. It comes with both a
> serial and USB port. The serial version of the SL line always worked OK
> under Linux with their grotty (but adequate) UPSMON program, which comes
> with the unit (or may be downloaded from the Powercom site.
> www dot pcmups dot com dot tw).
>
> My current workstation does not have any serial ports, so the supplied
> UPSMON will not work.
>
> As proof of hardware integrity for what follows, I ran up the supplied
> Windows UPS software on an XP client running under VMware. The new USB
> device was detected and everything worked as it should.
>
> Back to Linux:
> I'm running openSUSE 11.1 with KDE 3.5 fully updated.
>
> First, the relevant line from lsusb:
>
> Bus 004 Device 008: ID 0d9f:0002 Powercom Co., Ltd
>
> Next, an extract from the YAST hardware Information module:
>
> - hal device list -
>  0: udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial_if0'
>  info.subsystem = 'usb'
>  usb.interface.number = 0 (0x0)
>  info.linux.driver = 'usbhid'
>  usb.product = 'USB HID Interface'
>  usb.device_subclass = 0 (0x0)
>  usb.interface.class = 3 (0x3)
>  info.product = 'USB HID Interface'
>  usb.linux.sysfs_path =
> '/sys/devices/pci:00/:00:1d.0/usb4/4-1/4-1:1.0'
>  usb.speed = 1.5
>  usb.interface.subclass = 0 (0x0)
>
>  info.udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial_if0'
>  usb.device_revision_bcd = 0 (0x0)
>  usb.device_protocol = 0 (0x0)
>  usb.interface.protocol = 0 (0x0)
>  usb.configuration_value = 1 (0x1)
>  usb.version = 1.0
>  usb.max_power = 100 (0x64)
>  usb.vendor_id = 3487 (0xd9f)
>  linux.sysfs_path = '/sys/devices/pci:00/:00:1d.0/usb4/4-1/4-1:1.0'
>  usb.num_configurations = 1 (0x1)
>  usb.is_self_powered = false
>  info.parent = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial'
>  usb.num_ports = 0 (0x0)
>  usb.product_id = 2 (0x2)
>  usb.num_interfaces = 1 (0x1)
>  usb.can_wake_up = false
>  usb.linux.device_number = 7 (0x7)
>  usb.vendor = 'Powercom Co., Ltd'
>  linux.hotplug_type = 2 (0x2)
>  usb.device_class = 0 (0x0)
>  usb.bus_number = 4 (0x4)
>  linux.subsystem = 'usb'
>
>  1: udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial'
>  info.subsystem = 'usb_device'
>  info.linux.driver = 'usb'
>  usb_device.product = 'USB to Serial'
>  linux.device_file = '/dev/bus/usb/004/007' <<- That's it
>  usb_device.linux.sysfs_path =
> '/sys/devices/pci:00/:00:1d.0/usb4/4-1'
>  info.product = 'USB to Serial'
>  usb_device.device_revision_bcd = 0 (0x0)
>  usb_device.configuration_value = 1 (0x1)
>  usb_device.max_power = 100 (0x64)
>
>  info.udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial'
>  usb_device.num_configurations = 1 (0x1)
>  usb_device.num_ports = 0 (0x0)
>  usb_device.num_interfaces = 1 (0x1)
>  usb_device.linux.device_number = 7 (0x7)
>  usb_device.device_class = 0 (0x0)
>  linux.sysfs_path = '/sys/devices/pci:00/:00:1d.0/usb4/4-1'
>  usb_device.device_subclass = 0 (0x0)
>  info.vendor = 'Powercom Co., Ltd'
>  usb_device.speed = 1.5
>  info.parent =
> '/org/freedesktop/Hal/devices/usb_device_1d6b_1__00_1d_0'
>  usb_device.device_protocol = 0 (0x0)
>  usb_device.version = 1.0
>  usb_device.vendor_id = 3487 (0xd9f)
>  usb_device.is_self_powered = false
>  usb_device.product_id = 2 (0x2)
>  usb_device.can_wake_up = false
>  linux.hotplug_type = 2 (0x2)
>  usb_device.vendor = 'Powercom Co., Ltd'
>  usb_device.bus_number = 4 (0x4)
>  linux.subsystem = 'usb'
>
> For some reason, the printout did not include this:
>
> Drivers
>   Modules
>  Active: Yes
>  modprobe: Yes
>  modules
>   modprobe cypress_m8
> Drivers
>   Modules
>  Active: Yes
>  modprobe: Yes
>  modules
>   modprobe usbhid
>
> I installed nut. It has a configuration file, /etc/ups/ups.conf, which
> requires this:
>
> [upsname]
>  driver = 
>   port = 
>< any other directives here >
>
> The critical items are drivername and portname.
> The nut documentation suggests the use of /dev/hiddev0 for portname,
> however I don't have any /dev/hiddev0, 1, 2 ... entries. (nor do they
> exist in some sub-direcory).
>
> As an inspired (?) guess, I tried driver = powercom and port = /dev/ttyS0.
>
> The upsd daemon started , but was unable to communicate with the device:
> Here are the last few entries from syslog:
>
> Aug 18 13:40:11 danny upsmon[15804]: Poll UPS [my...@localhost] failed -
> Data stale
>
> Aug 18 13:40:12 danny powercom[15796]: data receiving error (-1 instead
> of 11 bytes)
>
> Aug 18 13:40:16 danny upsmon[15804]: Poll UPS [my...@localhost] failed -
> Data stale
>
> Aug 18 13:40:17 danny powercom[15796]: data receiving error (-1 instead
> of 11 bytes)
>
>
> It's easy to see what's happening: Th

Connecting a USB UPS

2009-08-19 Thread Daniel Feiglin
Hello folks!

I use a SL1000 UPS. The model is marketed by Advice, and looks like
their continuation of the Sustainer UPS line. It comes with both a
serial and USB port. The serial version of the SL line always worked OK
under Linux with their grotty (but adequate) UPSMON program, which comes
with the unit (or may be downloaded from the Powercom site.
www dot pcmups dot com dot tw).

My current workstation does not have any serial ports, so the supplied
UPSMON will not work.

As proof of hardware integrity for what follows, I ran up the supplied
Windows UPS software on an XP client running under VMware. The new USB
device was detected and everything worked as it should.

Back to Linux:
I'm running openSUSE 11.1 with KDE 3.5 fully updated.

First, the relevant line from lsusb:

Bus 004 Device 008: ID 0d9f:0002 Powercom Co., Ltd

Next, an extract from the YAST hardware Information module:

- hal device list -
  0: udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial_if0'
  info.subsystem = 'usb'
  usb.interface.number = 0 (0x0)
  info.linux.driver = 'usbhid'
  usb.product = 'USB HID Interface'
  usb.device_subclass = 0 (0x0)
  usb.interface.class = 3 (0x3)
  info.product = 'USB HID Interface'
  usb.linux.sysfs_path =
'/sys/devices/pci:00/:00:1d.0/usb4/4-1/4-1:1.0'
  usb.speed = 1.5
  usb.interface.subclass = 0 (0x0)

  info.udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial_if0'
  usb.device_revision_bcd = 0 (0x0)
  usb.device_protocol = 0 (0x0)
  usb.interface.protocol = 0 (0x0)
  usb.configuration_value = 1 (0x1)
  usb.version = 1.0
  usb.max_power = 100 (0x64)
  usb.vendor_id = 3487 (0xd9f)
  linux.sysfs_path = '/sys/devices/pci:00/:00:1d.0/usb4/4-1/4-1:1.0'
  usb.num_configurations = 1 (0x1)
  usb.is_self_powered = false
  info.parent = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial'
  usb.num_ports = 0 (0x0)
  usb.product_id = 2 (0x2)
  usb.num_interfaces = 1 (0x1)
  usb.can_wake_up = false
  usb.linux.device_number = 7 (0x7)
  usb.vendor = 'Powercom Co., Ltd'
  linux.hotplug_type = 2 (0x2)
  usb.device_class = 0 (0x0)
  usb.bus_number = 4 (0x4)
  linux.subsystem = 'usb'

  1: udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial'
  info.subsystem = 'usb_device'
  info.linux.driver = 'usb'
  usb_device.product = 'USB to Serial'
  linux.device_file = '/dev/bus/usb/004/007' <<- That's it
  usb_device.linux.sysfs_path =
'/sys/devices/pci:00/:00:1d.0/usb4/4-1'
  info.product = 'USB to Serial'
  usb_device.device_revision_bcd = 0 (0x0)
  usb_device.configuration_value = 1 (0x1)
  usb_device.max_power = 100 (0x64)

  info.udi = '/org/freedesktop/Hal/devices/usb_device_d9f_2_noserial'
  usb_device.num_configurations = 1 (0x1)
  usb_device.num_ports = 0 (0x0)
  usb_device.num_interfaces = 1 (0x1)
  usb_device.linux.device_number = 7 (0x7)
  usb_device.device_class = 0 (0x0)
  linux.sysfs_path = '/sys/devices/pci:00/:00:1d.0/usb4/4-1'
  usb_device.device_subclass = 0 (0x0)
  info.vendor = 'Powercom Co., Ltd'
  usb_device.speed = 1.5
  info.parent =
'/org/freedesktop/Hal/devices/usb_device_1d6b_1__00_1d_0'
  usb_device.device_protocol = 0 (0x0)
  usb_device.version = 1.0
  usb_device.vendor_id = 3487 (0xd9f)
  usb_device.is_self_powered = false
  usb_device.product_id = 2 (0x2)
  usb_device.can_wake_up = false
  linux.hotplug_type = 2 (0x2)
  usb_device.vendor = 'Powercom Co., Ltd'
  usb_device.bus_number = 4 (0x4)
  linux.subsystem = 'usb'

For some reason, the printout did not include this:

Drivers
   Modules
  Active: Yes
  modprobe: Yes
  modules
   modprobe cypress_m8
Drivers
   Modules
  Active: Yes
  modprobe: Yes
  modules
   modprobe usbhid

I installed nut. It has a configuration file, /etc/ups/ups.conf, which
requires this:

[upsname]
  driver = 
   port = 
< any other directives here >

The critical items are drivername and portname.
The nut documentation suggests the use of /dev/hiddev0 for portname,
however I don't have any /dev/hiddev0, 1, 2 ... entries. (nor do they
exist in some sub-direcory).

As an inspired (?) guess, I tried driver = powercom and port = /dev/ttyS0.

The upsd daemon started , but was unable to communicate with the device:
Here are the last few entries from syslog:

Aug 18 13:40:11 danny upsmon[15804]: Poll UPS [my...@localhost] failed -
Data stale

Aug 18 13:40:12 danny powercom[15796]: data receiving error (-1 instead
of 11 bytes)

Aug 18 13:40:16 danny upsmon[15804]: Poll UPS [my...@localhost] failed -
Data stale

Aug 18 13:40:17 danny powercom[15796]: data receiving error (-1 instead
of 11 bytes)


It's easy to see what's happening: The poller sends a Ctl A (I think) to
the UPS and should get back 11 bytes of status data.


And so to the $64,000 question: What should I be using for these two
parameters?


An RTFM would be fine, but go find the FM to R!


Daniel





begin:vcard
fn:Daniel Feiglin
n:Feiglin;Daniel
adr