Peter van Valderen
2007-May-20 03:23 UTC
[Nut-upsuser] Sweex 1000VA UPS (was: powermust usb)
--- Arjen de Korte <nut+users at de-korte.org> wrote:> > > I also did: > > > > # ./megatec_usb -DDDDD -x vendor=06da -x mfr=OMRON > > /dev/usb/hiddev0 > > Please have a look at 'man 8 megatec_usb' again. > > You probably need to specify the '-x vendorid' and > '-x productid' options > and most likely, the 'subdriver' as well. I think > the following might be > more appropriate: > > ./megatec_usb -DDDDD -x vendorid=06da -x > productid=0003 subdriver=agiler > (or krauler) > > Note that using the serial interface, is for the > moment probably the best > option.Recently I purchased a Sweex 1000 VA UPS, which apparently is not like the Sweex that was already supported by Nut. This one has an USB interface only... Nothing really seemed to work, until I ran across this topic. megatec_usb seems to do _something_ to it, which is more than I can say of any of the other drivers I tried. However, it seems the protocol this UPS uses is not yet supported. Here is the output I got from megatec_usb: # /usr/local/ups/bin/megatec_usb -DDDDD -x vendorid=0925 -x productid=1234 -x subdriver=agiler /dev/hiddev0 Network UPS Tools 2.1.0 - Megatec protocol driver 1.5.3 [megatec_usb] Carlos Rodrigues (c) 2003-2007 Serial-over-USB transport layer for Megatec protocol driver [megatec_usb] debug level is '5' Checking device (0925/1234) (001/005) - VendorID: 0925 - ProductID: 1234 - Manufacturer: ? - Product: UPS USB MON V1.4 - Serial Number: unknown - Bus: 001 Trying to match device Device matches failed to claim USB device, trying 2 more time(s)... detaching kernel driver from USB device... trying again to claim USB device... Starting UPS detection process... Attempting to detect the UPS... Sending "Q1" command... Wrong answer to "Q1" command. Attempting to detect the UPS... Sending "Q1" command... Wrong answer to "Q1" command. Attempting to detect the UPS... Sending "Q1" command... Wrong answer to "Q1" command. Attempting to detect the UPS... Sending "Q1" command... Wrong answer to "Q1" command. Attempting to detect the UPS... Sending "Q1" command... Wrong answer to "Q1" command. 5 out of 5 detection attempts failed (minimum failures: 2). Megatec protocol UPS not detected. # /usr/local/ups/bin/megatec_usb -DDDDD -x vendorid=0925 -x productid=1234 -x subdriver=krauler /dev/hiddev0 Network UPS Tools 2.1.0 - Megatec protocol driver 1.5.3 [megatec_usb] Carlos Rodrigues (c) 2003-2007 Serial-over-USB transport layer for Megatec protocol driver [megatec_usb] debug level is '5' Checking device (0925/1234) (001/005) - VendorID: 0925 - ProductID: 1234 - Manufacturer: ? - Product: UPS USB MON V1.4 - Serial Number: unknown - Bus: 001 Trying to match device Device matches Starting UPS detection process... Attempting to detect the UPS... Sending "Q1" command... get_data_krauler: got data: ( Wrong answer to "Q1" command. Attempting to detect the UPS... Sending "Q1" command... get_data_krauler: got data: ( Wrong answer to "Q1" command. Attempting to detect the UPS... Sending "Q1" command... get_data_krauler: got data: ( Wrong answer to "Q1" command. Attempting to detect the UPS... Sending "Q1" command... get_data_krauler: got data: ( Wrong answer to "Q1" command. Attempting to detect the UPS... Sending "Q1" command... get_data_krauler: got data: ( Wrong answer to "Q1" command. 5 out of 5 detection attempts failed (minimum failures: 2). Megatec protocol UPS not detected. I tried to do some reverse engineering myself, however I am a very novice programmer so that didn't do a whole lot of good. Does anyone have any idea where I could go from here? Thanks, Peter van Valderen Eindhoven
Alexander I. Gordeev
2007-May-31 11:27 UTC
[Nut-upsdev] [Nut-upsuser] Sweex 1000VA UPS (was: powermust usb)
On Thu, 24 May 2007 19:54:05 +0400, Peter van Valderen <p.v.valderen at probu.nl> wrote:> Thanks for the instructions, attached you will find lakeview.patch. > Alternatively you can get it at: > http://www.probu.nl/~p.v.valderen/lakeview.patch > > In the file you will find patches for lakeview_usb.c, lakeview_usb.h, > nut_usb.c and Makefile.am. > > sweex_usb is not the best name for the driver as discussed, for that > reason I renamed it to lakeview_usb. >Sorry for the delay, I was busy with my university exams. Your patch should be fixed: driver fails to build. Please test patches before sending them. This line +lakeview_usb_LDADD = $(LDADD_DRIVER) $(LIBUSB_LDFLAGS) should be replaced with +lakeview_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LDFLAGS) The complete fixed Makefile.am diff: Index: Makefile.am ==================================================================--- Makefile.am (revision 939) +++ Makefile.am (working copy) @@ -21,7 +21,7 @@ mge-shut mge-utalk newmge-shut nitram oneac optiups powercom rhino \ safenet skel solis tripplite tripplitesu upscode2 victronups powerpanel SNMP_DRIVERLIST = snmp-ups -USB_LIBUSB_DRIVERLIST = usbhid-ups bcmxcp_usb tripplite_usb megatec_usb +USB_LIBUSB_DRIVERLIST = usbhid-ups bcmxcp_usb lakeview_usb tripplite_usb megatec_usb USB_HIDDEV_DRIVERLIST = energizerups USB_DRIVERLIST = $(USB_LIBUSB_DRIVERLIST) $(USB_HIDDEV_DRIVERLIST) HAL_DRIVERLIST = hald-addon-usbhid-ups hald-addon-bcmxcp_usb hald-addon-tripplite_usb hald-addon-megatec_usb @@ -121,6 +121,9 @@ energizerups_SOURCES = energizerups.c energizerups_LDADD = $(LDADD_DRIVERS) +lakeview_usb_SOURCES = lakeview_usb.c nut_usb.c +lakeview_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LDFLAGS) + tripplite_usb_SOURCES = tripplite_usb.c libhid.c libusb.c hidparser.c tripplite_usb_LDADD = $(LDADD_DRIVERS) $(LIBUSB_LDFLAGS) -lm @@ -173,8 +176,8 @@ masterguard.h megatec.h metasys.h mge-hid.h mgemib.h mge-shut.h \ mge-utalk.h netvisionmib.h usbhid-ups.h nitram.h nut_usb.h \ oneac.h optiups.h powercom.h pwmib.h safenet.h serial.h \ - snmp-ups.h solis.h tripplite.h tripplite-hid.h tripplitesu.h \ - upscode2.h victronups.h powerpanel.h + snmp-ups.h solis.h lakeview_usb.h tripplite.h tripplite-hid.h \ + tripplitesu.h upscode2.h victronups.h powerpanel.h # Define a dummy library so that Automake builds rules for the # corresponding object files. This library is not actually built, Have you switched from nut_usb.c interface to libusb.c/libhid.c as Peter proposed? -- Alexander
Apparently Analagous Threads
- Sweex 1000VA UPS (was: powermust usb)
- Mustek Powermust 600VA
- Voltage override in megatec and megatec-over-usb [was: Re: nut-2.0.5 megatec + Online Xanto]
- Sweex 1000VA UPS (Lakeview Research)
- USB support for Sweex 1000 VA UPS (was: Help with USB support for a Kebo UPS-650D)