<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">On Nov 12, 2014, at 3:53 AM, Maksym Bodaniuk <<a href="mailto:max.bodaniuk@gmail.com">max.bodaniuk@gmail.com</a>> wrote:<br><div><br class="Apple-interchange-newline"><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Hi Charles,<br><br><blockquote type="cite"><pre wrap="">Sigh, I wish the vendors wouldn't change operation without changing identifiers.

Do you have any recommendations on how the driver should decide whether it is an old 0x0004 or new 0x0004 device?</pre></blockquote><div class="moz-cite-prefix"><br></div>No-no, there is no an old 0x0004 or new 0x0004 device, I guess that we have to handle general case for all 0d9f:0x0004 devices.<br></div></blockquote><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">You're right, I jumped to the wrong conclusion on that one.</div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">There was another thread about this, where it seems there are other mismatches between the report descriptor sizes, and what the UPS expects:</div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><a href="http://article.gmane.org/gmane.comp.monitoring.nut.user/7662">http://article.gmane.org/gmane.comp.monitoring.nut.user/7662</a></div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">From PCM_USB_LIST_device2014.pdf attached by Alexey Morozov:<br>"(VGD, VRT, RPT, .. and new UPS etc.) - 0X04.". According to this doc we can expect that all new PowerCOM devices will be shipped with ID 0X0d9f:0X04. For example, my Imperial IMD-825AP LCD has 0x0004, but an old examples of this model have 0Xa2.<br><br>Also, lets take a look inside PCM_USB_protocol_2014.pdf:<br>"16 0x8456 Delay Before Startup R/W<span class="Apple-converted-space"> </span><b>5 Byte</b>"<br>And old specs for BNT protocol:<br>"16  8456  DelayBeforeStartup ***<span class="Apple-converted-space"> </span>R/W<span class="Apple-converted-space"> </span><b>2 Byte</b>"<br>So, the length for DelayBeforeStartup report changed from 2 to 5 bytes.<br></div></blockquote><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">From the 2012 thread, it looks like the DelayBeforeStartup report might be encoded as hexadecimal:</div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div bgcolor="#FFFFFF" text="#000000" style="orphans: auto; text-align: start; text-indent: 0px; widows: auto;"><div bgcolor="#FFFFFF" text="#000000">   0.440981<span class="Apple-tab-span" style="white-space: pre;">    </span>refresh_report_buffer: expected 3 bytes, but got 2 instead</div><div bgcolor="#FFFFFF" text="#000000">   0.441006<span class="Apple-tab-span" style="white-space:pre"> </span>Report[err]: (2 bytes) => 0f 00</div><div bgcolor="#FFFFFF" text="#000000">   0.441024<span class="Apple-tab-span" style="white-space:pre"> </span>Path: UPS.PowerSummary.DelayBeforeShutdown, Type: Feature, ReportID: 0x0f, Offset: 0, Size: 16, Value: 0</div><div bgcolor="#FFFFFF" text="#000000"><br></div><div bgcolor="#FFFFFF" text="#000000">   0.445020<span class="Apple-tab-span" style="white-space:pre">     </span>Report[get]: (<b>5 bytes</b>) => 10 <b>30 30 30 30</b></div><div bgcolor="#FFFFFF" text="#000000">   0.445051<span class="Apple-tab-span" style="white-space:pre">  </span>Path: UPS.PowerSummary.<b>DelayBeforeStartup</b>, Type: Feature, ReportID: 0x10, Offset: 0, Size: 32, Value: 12336</div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;">You can try various encodings in drivers/powercom-hid.c:powercom_startup_fun().</div></div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Or there was added a new report for example:<br>"44 0x8436 Temperature R/O 2 Byte"<br>This was missed in the old specification.<br></div></blockquote><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">You might be able to use "explore" mode in usbhid-ups to dump all of the variables to see what is missing from the driver.</div><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><br></div><blockquote type="cite"><div bgcolor="#FFFFFF" text="#000000" style="font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">All these things lead me to thought that powercom hid driver should handle 0x0004 case more careful.<br><br><blockquote type="cite"><pre wrap="">Here is an older Powercom device with productId 00a2 - how does your output of 'upsc' compare?</pre></blockquote><br>Here is my output for 0x0004:<br><br>:/etc/nut$ upsc powercom<br>battery.charge: 100<br>battery.charge.low: 15<br>battery.charge.warning: 30<br>battery.date: 2010/12/20<br>battery.runtime: 800<br>battery.type: PbAc<br>device.mfr: POWERCOM Co.,LTD<br>device.model: HID UPS Battery<br>device.serial: 004-0D9F-000<br>device.type: ups<br>driver.flag.ignorelb: enabled<br>driver.name: usbhid-ups<br>driver.parameter.offdelay: 10<br>driver.parameter.ondelay: 100<br>driver.parameter.pollfreq: 30<br>driver.parameter.pollinterval: 2<br>driver.parameter.port: auto<br>driver.version: 2.6.4<br>driver.version.data: PowerCOM HID 0.3<br>driver.version.internal: 0.37<br>input.frequency: 50.0<br>input.voltage: 214.0<br>input.voltage.nominal: 220<br>output.frequency: 50.0<br>output.voltage: 214.0<br>output.voltage.nominal: 220<br>ups.beeper.status: enabled<br>ups.date: 2010/12/20<br>ups.delay.shutdown: 20<br>ups.delay.start: 60<br>ups.load: 0<br>ups.mfr: POWERCOM Co.,LTD<br>ups.model: HID UPS Battery<br>ups.productid: 0004<br>ups.serial: 004-0D9F-000<br>ups.status: OL<br>ups.test.result: Done and passed<br>ups.timer.shutdown: 0<br>ups.timer.start: 0<br>ups.vendorid: 0d9f<br><br><div class="moz-cite-prefix">On 11/12/2014 03:05 AM, Charles Lepple wrote:<br></div><blockquote cite="mid:CE313BA7-2FB5-4E90-A35B-2796E1261B4E@gmail.com" type="cite"><pre wrap="">On Nov 11, 2014, at 3:30 PM, Maksym Bodaniuk <a class="moz-txt-link-rfc2396E" href="mailto:max.bodaniuk@gmail.com" style="color: rgb(0, 0, 255);"><max.bodaniuk@gmail.com></a> wrote:

</pre><blockquote type="cite"><pre wrap="">Dear Charles and Artem,

I've recently bought a new PowerCom Imperial IMD825-AP LCD which identifies itself as 0x0d9f:0x0004.
At first glance it seems that usbhid-ups driver works fine. But when I tried to shutdown UPS via DelayBeforeShutdown it started double beeping every couple seconds for indefinite time (the same problem described by Vincenzo Colonnella here: <a class="moz-txt-link-freetext" href="http://lists.alioth.debian.org/pipermail/nut-upsdev/2013-February/006403.html" style="color: rgb(0, 0, 255);">http://lists.alioth.debian.org/pipermail/nut-upsdev/2013-February/006403.html</a>). 

I suppose that recent protocol change affects a protocol specifications for DelayBeforeShutdown and powercom_shutdown_info methods should be modified to support 0x0004 devices. But unfortunately the protocol specifications attached by Alexey Morozov didn't clarify much for me.
My assumption here that PowerCom developers made a new devices with ID 0x0d9f:0x0004 more compatible with USB HID PDC and therefore we do not need any specific conversions for passed values anymore.
</pre></blockquote><pre wrap="">Sigh, I wish the vendors wouldn't change operation without changing identifiers.

Do you have any recommendations on how the driver should decide whether it is an old 0x0004 or new 0x0004 device?

Here is an older Powercom device with productId 00a2 - how does your output of 'upsc' compare?

</pre></blockquote><br>Best Regards,<br>Maskym Bodaniuk<br></div></blockquote></div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px;"><div>-- </div><div>Charles Lepple</div><div>clepple@gmail</div><div><br></div></span><br class="Apple-interchange-newline">

</div>
<br></body></html>