Brian R. Smith
2010-Sep-24 03:57 UTC
[Nut-upsdev] Dynamix 650 VA USB - broken, have rough fix
Like Glen Ogilvie, I got a newer Dynamix 650 VA with USB connection, and was having trouble getting NUT to communicate with it. This appears to be the UPS that megatec_usb was built for - Vendor: 0x0001, Product: 0x0000, uses Megatec's software, has USB chip attached to internal serial lines, and has terrible USB implementation with fake HID tables. But megatec_usb would consistently fail. After spending a week (hey, I'm unemployed) reading USB docs and poking at it from various directions, I now understand what's wrong, though not necessarily the best place to fix it. megatec_usb communicates primarily with the UPS via libusb 0.1's usb_get_string_simple. usb_get_string_simple begins by requesting supported LANGIDs from the UPS -- which fails, ending communication. (Megatec's USB implementation is not a good effort.) If you skip that step and go directly to usb_get_string with some arbitrary LANGID (I tried 0x0409 and 0x0000, both worked), the UPS happily responds. I got it working for now by hacking away at libusb.c/libusb_get_string and switching it to usb_get_string. I expect this isn't the best long-term solution, because it may change the behavior of some other USB UPSs. Should megatec_usb.c/set_data_krauler just skip the "usb" subdriver function table and go straight for usb_get_string? Or should the usb subdriver be extended with a call that doesn't go through usb_get_string_simple? -- Brian R. Smith bsmith at furbium.com
Arjen de Korte
2010-Sep-24 09:43 UTC
[Nut-upsdev] Dynamix 650 VA USB - broken, have rough fix
Citeren "Brian R. Smith" <bsmith op furbium.com>:> Should megatec_usb.c/set_data_krauler just skip the "usb" subdriver > function table and go straight for usb_get_string? Or should the > usb subdriver be extended with a call that doesn't go through > usb_get_string_simple?The 'megatec_usb' driver is no longer maintained and has been replaced by the 'blazer_usb' driver. This uses direct calls to the libusb library, so the fix you recommend should be much easier to implement. Please post some debug output before and after making these changes by running the driver with -DDD enabled (not more). Best regards, Arjen -- Please keep list traffic on the list (off-list replies will be rejected)