[Nut-upsdev] nut driver for SMS (brazil) UPS

Charles Lepple clepple at gmail.com
Fri Jan 25 13:08:35 UTC 2013


On Jan 25, 2013, at 7:21 AM, Ulisses Guedes wrote:

> [root at torrinha drivers]# upsc sms
> battery.charge: 100.0
> battery.charge.low: 30
> battery.charge.restart: 25
> battery.charge.warning: 40
> battery.voltage.nominal: 012
> device.mfr: SMS Brasil
> device.model: Monophase:  :NET4+  1.0
> device.serial: Cypress HID->COM

For device.serial, the usual interpretation is the unique serial number of a device, rather than the type of serial port. (Many UPS protocols do not provide a serial number, so leaving it out is not a problem.)

> device.type: ups
> driver.name: smsbrasil
> driver.parameter.pollinterval: 2
> driver.parameter.port: /dev/ttyUSB0
> driver.version: 2.6.5-Unversioned directory

The driver.version line is auto-generated, but I am curious as to why it did not just print "2.6.5" (probably a bug in my code). Are you building from nut-2.6.5.tar.gz? Do you have git or svn installed on that system?

> driver.version.internal: 0.02
> input.current: 2.055
> input.frequency: 60.0
> input.frequency.nominal: 60
> input.voltage: 218.0
> input.voltage.maximum: 220.0
> input.voltage.minimum: 215.0
> input.voltage.nominal: 115/220

If it is not possible to determine whether the nominal voltage is 115 or 220, I would not set this variable. Graphical NUT clients would use this to scale the voltage display, and expect a single value.

> ups.productid: 5500
...
> ups.vendorid: 04b4


Eventually, for non-Linux systems such as FreeBSD, we should conditionally include the USB-to-serial converter checking code. I think I understand what you are trying to do (checking to make sure that /dev/ttyUSB0 is, in fact, the UPS), but it might be better to include a udev rule that creates a new dev node like /dev/ttyUSB.ups. It might still conflict with other Cypress USB-to-serial devices, but in any case, the check shouldn't be fatal.

-- 
Charles Lepple
clepple at gmail






More information about the Nut-upsdev mailing list