Re: [Nut-upsuser] Junda-tech
Any other inputs or suggestions? I got some info from junda-tech in mandarin about the JD09U04, which is the technical information of a chip with that number. I have sent them another message, but no response so far. On 17/10/17 15:34, LLSJ Krüger wrote: > Bus 003 Device 003: ID 3344:0025 Leaguer Microelectronics (LME) > Device Descriptor: > bLength 18 > bDescriptorType 1 > bcdUSB 1.10 > bDeviceClass 0 > bDeviceSubClass 0 > bDeviceProtocol 0 > bMaxPacketSize0 8 > idVendor 0x3344 Leaguer Microelectronics (LME) > idProduct 0x0025 > bcdDevice 0.01 > iManufacturer 3 (error) > iProduct 4 HID-UPS > iSerial 2 JD09U04 > bNumConfigurations 1 > Configuration Descriptor: > bLength 9 > bDescriptorType 2 > wTotalLength 34 > bNumInterfaces 1 > bConfigurationValue 1 > iConfiguration 0 > bmAttributes 0x80 > (Bus Powered) > MaxPower 100mA > Interface Descriptor: > bLength 9 > bDescriptorType 4 > bInterfaceNumber 0 > bAlternateSetting 0 > bNumEndpoints 1 > bInterfaceClass 3 Human Interface Device > bInterfaceSubClass 0 > bInterfaceProtocol 0 > iInterface 0 > HID Device Descriptor: > bLength 9 > bDescriptorType 33 > bcdHID 1.00 > bCountryCode 0 Not supported > bNumDescriptors 1 > bDescriptorType 34 Report > wDescriptorLength 136 > Report Descriptor: (length is 136) > Item(Global): Usage Page, data= [ 0x84 ] 132 > Power Device Page > Item(Local ): Usage, data= [ 0x04 ] 4 > UPS > Item(Main ): Collection, data= [ 0x01 ] 1 > Application > Item(Local ): Usage, data= [ 0x24 ] 36 > Power Summary > Item(Main ): Collection, data= [ 0x02 ] 2 > Logical > Item(Global): Report ID, data= [ 0x01 ] 1 > Item(Local ): Usage, data= [ 0xfd ] 253 > iManufacturer > Item(Local ): String Index, data= [ 0x01 ] 1 > Item(Global): Report Size, data= [ 0x08 ] 8 > Item(Global): Report Count, data= [ 0x01 ] 1 > Item(Global): Logical Minimum, data= [ 0x00 ] 0 > Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255 > Item(Main ): Feature, data= [ 0x22 ] 34 > Data Variable Absolute No_Wrap Linear > No_Preferred_State No_Null_Position > Non_Volatile Bitfield > Item(Global): Report ID, data= [ 0x02 ] 2 > Item(Local ): Usage, data= [ 0xfe ] 254 > iProduct > Item(Local ): String Index, data= [ 0x02 ] 2 > Item(Main ): Feature, data= [ 0x22 ] 34 > Data Variable Absolute No_Wrap Linear > No_Preferred_State No_Null_Position > Non_Volatile Bitfield > Item(Global): Report ID, data= [ 0x03 ] 3 > Item(Local ): Usage, data= [ 0xff ] 255 > iSerialNumber > Item(Local ): String Index, data= [ 0x03 ] 3 > Item(Main ): Feature, data= [ 0x22 ] 34 > Data Variable Absolute No_Wrap Linear > No_Preferred_State No_Null_Position > Non_Volatile Bitfield > Item(Global): Usage Page, data= [ 0x85 ] 133 > Battery System Page > Item(Global): Report ID, data= [ 0x06 ] 6 > Item(Local ): Usage, data= [ 0x8b ] 139 > Rechargeable > Item(Main ): Feature, data= [ 0x22 ] 34 > Data Variable Absolute No_Wrap Linear > No_Preferred_State No_Null_Position > Non_Volatile Bitfield > Item(Local ): Usage, data= [ 0x2c ] 44 > Capacity Mode > Item(Main ): Feature, data= [ 0x22 ] 34 > Data Variable Absolute No_Wrap Linear > No_Preferred_State No_Null_Position > Non_Volatile Bitfield > Item(Global): Report ID, data= [ 0x04 ] 4 > Item(Local ): Usage, data= [ 0x83 ] 131 > Design Capacity > Item(Global): Logical Maximum, data= [ 0x64 ] 100 > Item(Main ): Feature, data= [ 0x22 ] 34 > Data Variable Absolute No_Wrap Linear >
Re: [Nut-upsuser] Junda-tech
Sorry for the late reply, I've first used the incorrect sending address. On 17/10/17 15:15, Charles Lepple wrote: > On Oct 17, 2017, at 8:48 AM, LLSJ Krüger wrote: >> Results of 'lsusb -vvv -d 3344:' > [...] >> wDescriptorLength 136 >> Report Descriptors: >>** UNAVAILABLE ** >> > Can you please re-run lsusb, possibly as root, to grab the contents of the > "Report Descriptors" section? Bus 003 Device 003: ID 3344:0025 Leaguer Microelectronics (LME) Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 0 bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x3344 Leaguer Microelectronics (LME) idProduct 0x0025 bcdDevice 0.01 iManufacturer 3 (error) iProduct 4 HID-UPS iSerial 2 JD09U04 bNumConfigurations 1 Configuration Descriptor: bLength 9 bDescriptorType 2 wTotalLength 34 bNumInterfaces 1 bConfigurationValue 1 iConfiguration 0 bmAttributes 0x80 (Bus Powered) MaxPower 100mA Interface Descriptor: bLength 9 bDescriptorType 4 bInterfaceNumber 0 bAlternateSetting 0 bNumEndpoints 1 bInterfaceClass 3 Human Interface Device bInterfaceSubClass 0 bInterfaceProtocol 0 iInterface 0 HID Device Descriptor: bLength 9 bDescriptorType 33 bcdHID 1.00 bCountryCode 0 Not supported bNumDescriptors 1 bDescriptorType 34 Report wDescriptorLength 136 Report Descriptor: (length is 136) Item(Global): Usage Page, data= [ 0x84 ] 132 Power Device Page Item(Local ): Usage, data= [ 0x04 ] 4 UPS Item(Main ): Collection, data= [ 0x01 ] 1 Application Item(Local ): Usage, data= [ 0x24 ] 36 Power Summary Item(Main ): Collection, data= [ 0x02 ] 2 Logical Item(Global): Report ID, data= [ 0x01 ] 1 Item(Local ): Usage, data= [ 0xfd ] 253 iManufacturer Item(Local ): String Index, data= [ 0x01 ] 1 Item(Global): Report Size, data= [ 0x08 ] 8 Item(Global): Report Count, data= [ 0x01 ] 1 Item(Global): Logical Minimum, data= [ 0x00 ] 0 Item(Global): Logical Maximum, data= [ 0xff 0x00 ] 255 Item(Main ): Feature, data= [ 0x22 ] 34 Data Variable Absolute No_Wrap Linear No_Preferred_State No_Null_Position Non_Volatile Bitfield Item(Global): Report ID, data= [ 0x02 ] 2 Item(Local ): Usage, data= [ 0xfe ] 254 iProduct Item(Local ): String Index, data= [ 0x02 ] 2 Item(Main ): Feature, data= [ 0x22 ] 34 Data Variable Absolute No_Wrap Linear No_Preferred_State No_Null_Position Non_Volatile Bitfield Item(Global): Report ID, data= [ 0x03 ] 3 Item(Local ): Usage, data= [ 0xff ] 255 iSerialNumber Item(Local ): String Index, data= [ 0x03 ] 3 Item(Main ): Feature, data= [ 0x22 ] 34 Data Variable Absolute No_Wrap Linear No_Preferred_State No_Null_Position Non_Volatile Bitfield Item(Global): Usage Page, data= [ 0x85 ] 133 Battery System Page Item(Global): Report ID, data= [ 0x06 ] 6 Item(Local ): Usage, data= [ 0x8b ] 139 Rechargeable Item(Main ): Feature, data= [ 0x22 ] 34 Data Variable Absolute No_Wrap Linear No_Preferred_State No_Null_Position Non_Volatile Bitfield Item(Local ): Usage, data= [ 0x2c ] 44 Capacity Mode Item(Main ): Feature, data= [ 0x22 ] 34 Data Variable Absolute No_Wrap Linear No_Preferred_State No_Null_Position Non_Volatile Bitfield Item(Global): Report ID, data= [ 0x04 ] 4 Item(Local ): Usage, data= [ 0x83 ] 131 Design Capacity Item(Global): Logical Maximum, data= [ 0x64 ] 100 Item(Main ): Feature, data= [ 0x22 ] 34 Data Variable Absolute No_Wrap Linear No_Preferred_State No_
Re: [Nut-upsuser] Junda-tech
On Oct 17, 2017, at 8:48 AM, LLSJ Krüger wrote: > Results of 'lsusb -vvv -d 3344:' [...] > wDescriptorLength 136 > Report Descriptors: >** UNAVAILABLE ** > Can you please re-run lsusb, possibly as root, to grab the contents of the "Report Descriptors" section? (Running "usbhid-ups" should have detached the kernel driver already, which should allow lsusb to retrieve that descriptor -- but if you have disconnected+reconnected the USB cable since testing, you will need to re-run "usbhid-ups" before "lsusb".) > ran usbhid-ups - -u root -x explore -x vendorid=3344 -x port=auto -a > myups >& /tmp/junda-tech.txt > > and then > > gen-usbhid-subdriver.sh < /tmp/junda-tech.txt' : > [...] > /* --- */ > /* HID2NUT lookup table*/ > /* --- */ > > static hid_info_t jundatech_hid2nut[] = { > > { "unmapped.ups.powersummary.capacitymode", 0, 0, > "UPS.PowerSummary.CapacityMode", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.designcapacity", 0, 0, > "UPS.PowerSummary.DesignCapacity", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.fullchargecapacity", 0, 0, > "UPS.PowerSummary.FullChargeCapacity", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.presentstatus.acpresent", 0, 0, > "UPS.PowerSummary.PresentStatus.ACPresent", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.presentstatus.charging", 0, 0, > "UPS.PowerSummary.PresentStatus.Charging", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.presentstatus.discharging", 0, 0, > "UPS.PowerSummary.PresentStatus.Discharging", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.rechargeable", 0, 0, > "UPS.PowerSummary.Rechargeable", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.remainingcapacity", 0, 0, > "UPS.PowerSummary.RemainingCapacity", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.imanufacturer", 0, 0, > "UPS.PowerSummary.iManufacturer", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.iproduct", 0, 0, > "UPS.PowerSummary.iProduct", NULL, "%.0f", 0, NULL }, > { "unmapped.ups.powersummary.iserialnumber", 0, 0, > "UPS.PowerSummary.iSerialNumber", NULL, "%.0f", 0, NULL }, This part looks promising - the UPS appears to implement a portion of the HID Power Device Class specification, rather than just being a HID-enabled USB-to-serial adapter. In the generated code, the capitalized names are HID PDC names, which you can search for in the nut/drivers/ directory to see how other vendors use them. The script just maps them to generic numbers, but the values are most useful if mapped to proper types. For instance: $ git grep UPS.PowerSummary.PresentStatus.ACPresent drivers/apc-hid.c: { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.ACPresent", NULL, NULL, HU_FLAG_QUICK_POLL, online_info }, drivers/belkin-hid.c: { "BOOL", 0, 0, "UPS.PowerSummary.PresentStatus.ACPresent", NULL, NULL, HU_FLAG_QUICK_POLL, liebert_online_info }, ... This indicates that the APC models tend to follow the spec, but that we had to add a custom mapping function for Belkin/Liebert since their boolean True value is often 1e-7 instead of 1. I would recommend checking the values to make sure that they match the labels, but static attributes such as CapacityMode, DesignCapacity, FullChargeCapacity and Rechargeable can get a HU_FLAG_STATIC or HU_FLAG_SEMI_STATIC flag (see drivers/usbhid-ups.h) so that the driver does not waste time polling them. Some values like iManufacturer, iProduct and iSerialNumber are likely duplicates of the values in the USB device descriptor, and do not need to be included. >>> >> Which part of the website? > As below except with some minor changes, like -a instead of -s Ah, right - I will add a note to the text that `-s` might not be available yet. ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser
Re: [Nut-upsuser] Junda-tech
[please use Reply-All to include the list, thanks!] > On Oct 11, 2017, at 12:20 PM, Louis LSJ Krüger wrote: > > Hi, > > I have an UPS with only the marking D1000 on it and it came with > Junda-Tech's UpsMate. Not sure we have had any reports of Junda-Tech before. Is there a URL for the software? > Its USB id is 3344:0025, which is apparently a microprocessor. > > I've could get some of the HID interactions as described on the website, > but there are some outstanding. Which part of the website? This section has some information: http://networkupstools.org/docs/developer-guide.chunked/ar01s04.html#hid-subdrivers There is a typo that affects this section: https://github.com/networkupstools/nut/commit/5c9b57f105f5e81334450c378499bbb0c8ec74e4#diff-559ace1283bb758aa77e37c6a74dde4bR136 (basically, the "auto" at the end of the "usbhid-ups" command line should be "-x port=auto -s ups") Also, can you send the output of "lsusb -vvv -d 3344:"? ___ Nut-upsuser mailing list Nut-upsuser@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser