Peter Selinger
2007-Feb-08 17:43 UTC
[Nut-upsdev] Re: [nut-commits] svn commit r801 - in branches/megatec-usb: . drivers
Hi Alexander, thanks for your good work on the megatec_usb driver. I have made a few more (cosmetic) changes. Is the driver now working stably for your device? In particular, do the instant commands (and particularly "upsdrvctl -k") work properly? In this case, we could hopefully mark the device as "supported" and merge the driver to the main branch. There is still the question of whether to keep separate code for Ablerex and Krauler. From what I understand, each of these subdrivers works for each of the devices. But the Krauler driver is now more advanced (with the retry feature), so we could remove the Ablerex subdriver (provided Jon tests the Krauler one to make sure it still works for the Ablerex device). If I understand correctly, the only change needed would be to change {0xffff, 0x0000, get_data_ablerex, set_data_ablerex}, to {0xffff, 0x0000, get_data_krauler, set_data_krauler}, is that correct? -- Peter Alexander Gordeev wrote:> > Author: agordeev-guest > Date: Thu Feb 8 16:43:43 2007 > New Revision: 801 > > Modified: > branches/megatec-usb/ChangeLog > branches/megatec-usb/drivers/megatec_usb.c > Log: > - drivers/megatec_usb.c: fixed the problem with report descriptor retrieval at driver startups which caused failures. Since none of the subdrivers needs this descriptor it isn't retrieved at all. > > > Modified: branches/megatec-usb/ChangeLog > =============================================================================> --- branches/megatec-usb/ChangeLog (original) > +++ branches/megatec-usb/ChangeLog Thu Feb 8 16:43:43 2007 > @@ -1,3 +1,9 @@ > +Thu Feb 8 15:43:00 UTC 2007 / Alexander I. Gordeev <lasaine@lvk.cs.msu.su> > + > + - drivers/megatec_usb.c: fixed the problem with report descriptor > + retrieval at driver startups which caused failures. Since none of the > + subdrivers needs this descriptor it isn't retrieved at all. > + > Thu Feb 8 15:26:37 UTC 2007 / Alexander I. Gordeev <lasaine@lvk.cs.msu.su> > > - drivers/megatec_usb.c: fixed "UPS No Ack" issue and optimized > > Modified: branches/megatec-usb/drivers/megatec_usb.c > =============================================================================> --- branches/megatec-usb/drivers/megatec_usb.c (original) > +++ branches/megatec-usb/drivers/megatec_usb.c Thu Feb 8 16:43:43 2007 > @@ -152,7 +152,7 @@ > } > } > > - ret = usb->open(&udev,&hiddevice,&match,u.report_desc,MODE_OPEN); > + ret = usb->open(&udev,&hiddevice,&match,u.report_desc,MODE_REOPEN); > if (ret<0) > usb_open_error(port); > > > _______________________________________________ > nut-commits mailing list > nut-commits@lists.alioth.debian.org > http://lists.alioth.debian.org/mailman/listinfo/nut-commits >
Jon Gough
2007-Feb-08 19:04 UTC
[Nut-upsdev] Re: [nut-commits] svn commit r801 - in branches/megatec-usb: . drivers
Peter, Yep, at the moment the Krauler driver works OK for me. So if you want to make the change that is fine. Regards Jon At 03:42 9/02/2007, Peter Selinger wrote:>Hi Alexander, > >thanks for your good work on the megatec_usb driver. I have made a few >more (cosmetic) changes. > >Is the driver now working stably for your device? In particular, do >the instant commands (and particularly "upsdrvctl -k") work properly? >In this case, we could hopefully mark the device as "supported" and >merge the driver to the main branch. > >There is still the question of whether to keep separate code for >Ablerex and Krauler. From what I understand, each of these subdrivers >works for each of the devices. But the Krauler driver is now more >advanced (with the retry feature), so we could remove the Ablerex >subdriver (provided Jon tests the Krauler one to make sure it still >works for the Ablerex device). > >If I understand correctly, the only change needed would be to change > > {0xffff, 0x0000, get_data_ablerex, set_data_ablerex}, > >to > > {0xffff, 0x0000, get_data_krauler, set_data_krauler}, > >is that correct? -- Peter > >Alexander Gordeev wrote: > > > > Author: agordeev-guest > > Date: Thu Feb 8 16:43:43 2007 > > New Revision: 801 > > > > Modified: > > branches/megatec-usb/ChangeLog > > branches/megatec-usb/drivers/megatec_usb.c > > Log: > > - drivers/megatec_usb.c: fixed the problem with report descriptor > retrieval at driver startups which caused failures. Since none of > the subdrivers needs this descriptor it isn't retrieved at all. > > > > > > Modified: branches/megatec-usb/ChangeLog > > > =============================================================================> > --- branches/megatec-usb/ChangeLog (original) > > +++ branches/megatec-usb/ChangeLog Thu Feb 8 16:43:43 2007 > > @@ -1,3 +1,9 @@ > > +Thu Feb 8 15:43:00 UTC 2007 / Alexander I. Gordeev > <lasaine@lvk.cs.msu.su> > > + > > + - drivers/megatec_usb.c: fixed the problem with report descriptor > > + retrieval at driver startups which caused failures. Since none of the > > + subdrivers needs this descriptor it isn't retrieved at all. > > + > > Thu Feb 8 15:26:37 UTC 2007 / Alexander I. Gordeev > <lasaine@lvk.cs.msu.su> > > > > - drivers/megatec_usb.c: fixed "UPS No Ack" issue and optimized > > > > Modified: branches/megatec-usb/drivers/megatec_usb.c > > > =============================================================================> > --- branches/megatec-usb/drivers/megatec_usb.c (original) > > +++ branches/megatec-usb/drivers/megatec_usb.c Thu Feb 8 > 16:43:43 2007 > > @@ -152,7 +152,7 @@ > > } > > } > > > > - ret = usb->open(&udev,&hiddevice,&match,u.report_desc,MODE_OPEN); > > + ret = usb->open(&udev,&hiddevice,&match,u.report_desc,MODE_REOPEN); > > if (ret<0) > > usb_open_error(port); > > > > > > _______________________________________________ > > nut-commits mailing list > > nut-commits@lists.alioth.debian.org > > http://lists.alioth.debian.org/mailman/listinfo/nut-commits > >--- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000712-1, 08/02/2007 Tested on: 9/02/2007 5:04:20 AM avast! is copyright (c) 2000-2007 ALWIL Software. http://www.avast.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20070209/4b1a0e16/attachment.htm
Jon Gough
2007-Feb-08 19:06 UTC
[Nut-upsdev] Re: [nut-commits] svn commit r801 - in branches/megatec-usb: . drivers
Peter, I am still trying to get more information from the manufacturers, but they did send this through to me. I am not going to have time to look into it before Tuesday next week. But I thought I should post it anyway. My VendorID is -1 rather than 1, but.................... Regards Jon HID Device ******************************************************************************* VendorID =1 ProductID=0 Use API function ******************************************************************************* SetFeature () GetFeature () Tx Data (use SetFeature function) ******************************************************************************* [5][0][len][ask.......] -response data ask: [Q][1][D13] [I][D13] [F][D13] ex: Ask TxData=> [5][0][3][Q][1][D13][0][0]............. ( Feature Report Byte Length ) "Q1" [5][2][len][ask.......] -don't response data => Control or Command ask: [T][D13] ........ ex: Ask TxData=> [5][2][2][T][D13][0][0]................ ( Feature Report Byte Length ) "T" Rx Data (use GetFeature function) ******************************************************************************* ex: after Tx "Q1" RxData=> [(][2][0][8][.][4][ ][1][4][0].......... ( Feature Report Byte Length ) "(208.4 140.0 208.4 034 59.9 2.05 35.0 00110000" steps ******************************************************************************* 1.Get HID Device ( VendorID =1,ProductID=0). 2.use setfeature function to Tx Data. 3.use getfeature function to get data. %% Information consult => MegaTec Communication Protocols for UPS %% D:decimal At 03:42 9/02/2007, Peter Selinger wrote:>Hi Alexander, > >thanks for your good work on the megatec_usb driver. I have made a few >more (cosmetic) changes. > >Is the driver now working stably for your device? In particular, do >the instant commands (and particularly "upsdrvctl -k") work properly? >In this case, we could hopefully mark the device as "supported" and >merge the driver to the main branch. > >There is still the question of whether to keep separate code for >Ablerex and Krauler. From what I understand, each of these subdrivers >works for each of the devices. But the Krauler driver is now more >advanced (with the retry feature), so we could remove the Ablerex >subdriver (provided Jon tests the Krauler one to make sure it still >works for the Ablerex device). > >If I understand correctly, the only change needed would be to change > > {0xffff, 0x0000, get_data_ablerex, set_data_ablerex}, > >to > > {0xffff, 0x0000, get_data_krauler, set_data_krauler}, > >is that correct? -- Peter--- avast! Antivirus: Outbound message clean. Virus Database (VPS): 000712-1, 08/02/2007 Tested on: 9/02/2007 5:06:38 AM avast! is copyright (c) 2000-2007 ALWIL Software. http://www.avast.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20070209/bdb240d4/attachment.html
Alexander I. Gordeev
2007-Feb-09 14:02 UTC
[Nut-upsdev] Re: [nut-commits] svn commit r801 - in branches/megatec-usb: . drivers
On Thu, 08 Feb 2007 19:42:26 +0300, Peter Selinger <selinger@mathstat.dal.ca> wrote:> Hi Alexander, > > thanks for your good work on the megatec_usb driver. I have made a few > more (cosmetic) changes. > > Is the driver now working stably for your device? In particular, do > the instant commands (and particularly "upsdrvctl -k") work properly?I've just implemented most instant commands. However, some of them are not implemented because I'm not sure about them. I think, some more investigation and testing is required. Please, Jon, test these descriptors: 0x6 T<n> (don't know how to pass the parameter) 0x68 and 0x69 both cause shutdown after an undefined interval A know nothing also about "C" command. Windows driver doesn't implement it.> In this case, we could hopefully mark the device as "supported" and > merge the driver to the main branch. >Well, there are still some things that we need to do: - fix matching code, add regex matcher (at teh moment only "auto" works) - make "I" request to support Jon's device as well as mine - test the driver more to adjust the number of retries to work for every device supported (well, I mean Jon's one :) ) About the latter: I realized yesterday that I've only tested "Q1" request before. But "I" and "F" requests need to be tested too, because they are necessary for the driver proper startup. My most recent tests show, that percents of fails for these requests aren't very promising: F 81% (!!!) I 15% So the "UPS No Ack" problem is much more uncertain. I've corrected the number of retries for these requests, they are: F 31 I 15 These values are quite big, but since thess requests are performed only once, at driver startup, it is not very harmful. Well, I believe, the current code works well for me, but surely more testing is needed. If you think that the current state is enough, well, let's move it to trunc!> There is still the question of whether to keep separate code for > Ablerex and Krauler. From what I understand, each of these subdrivers > works for each of the devices. But the Krauler driver is now more > advanced (with the retry feature), so we could remove the Ablerex > subdriver (provided Jon tests the Krauler one to make sure it still > works for the Ablerex device). >Well, I think, there is no need to keep the code separate if Jon confirms his UPS is supported.> If I understand correctly, the only change needed would be to change > > {0xffff, 0x0000, get_data_ablerex, set_data_ablerex}, > > to > > {0xffff, 0x0000, get_data_krauler, set_data_krauler}, > > is that correct? -- Peter >That's right. -- Alexander
Apparently Analagous Threads
- Voltage override in megatec and megatec-over-usb [was: Re: nut-2.0.5 megatec + Online Xanto]
- Re: [Nut-upsuser] Ablerex 625L USB version
- Unsupported UPS using megatec_usb
- megatec over USB - new driver patch
- [nut-commits] svn commit r1136 - in trunk: . drivers