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

Ulisses Guedes uli1958 at hotmail.com
Thu Jan 31 00:31:00 UTC 2013




----------------------------------------
> Subject: Re: [Nut-upsdev] nut driver for SMS (brazil) UPS
> From: clepple at gmail.com
> Date: Fri, 25 Jan 2013 08:08:35 -0500
> CC: nut-upsdev at lists.alioth.debian.org
> To: uli1958 at hotmail.com
>
> 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.)


I see. I will remove.


>
>> 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?

from tar.gz. Yes I have git here but I downloaded the file from web page.

>
>> 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.

some sms models have automatic input voltage selection, but the firmware did not provide what voltage is using. The answer 115/220 comes from UPS using one query type and the input voltage is an answer from another query type. I will let to fill the nominal voltage after input.voltage is available. 


>
>> 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.

I'm trying to avoid the "cable disconnected" problem, as is requested/suggested by nut docs. 
Another solution could be check directly the USB bus (libusb) when I have no reply after a request.
I guess that this solution is more portable than that implemented one.

Am I complicating? 



>
> --
> Charles Lepple
> clepple at gmail
>
>
>
 		 	   		  


More information about the Nut-upsdev mailing list