Multifunktionsladegerät via USB HID-Instanz in IP-Symcon integrieren

PROBLEM :: Zwei HID Instanzen deren Geräte sich nicht unterscheiden auf Raspberry Pi

Ich habe mir das Modellbau-Multifunktionsladegerät VOLTCRAFT V-Charge 100 Duo gekauft.
Dieses Ladegerät besitzt zwei komplett getrennte Ladeeinheiten mit je einem USB Anschluss.
Dieser USB Anschluss hat natürlich gleich mein Interesse geweckt und ich habe in den letzten Abendstunden das Protokoll via „Reverse Engineering“ so weit unter Kontrolle gebracht, das ich alle wichtigen Funktion mit IP-Symcon v5.0 auslesen bzw. steuern kann. Für diejenigen die das interessiert habe ich ganz und mal Screenshot angehängt. Ist eigentlich super cool wenn man den Ladevorgang bzw. auch den Entladevorgang der Akkus ganz genau verfolgen kann.

Aber jetzt zu meinem Problem. Wenn ich eine Ladeeinheit via USB am Raspberry Pi anschließe funktioniert das super.
Das VOLTCRAFT V-Charge 100 Duo wird als ‚HID Gerät‘ erkannt und ich kann problemlos mit einer IP-Symcon „HID Instanz“ mit dem Gerät kommunizieren.
Schließe ich aber gleichzeitig die zweite Ladeeinheit via USB am Raspberry an, sehe ich zwar sofort ein zweites Gerät in der IP-Symcon „HID Instanz“ aber egal was ich für ein Gerät auswähle, es wird immer nur mit einer Ladeeinheit kommuniziert.


Natürlich bin ich dem Problem auf die Spur gegangen -> beide USB Geräte melden sich mit

[ul]
[li] Vendor=0000 [/li][li] ProdID=0001[/li][li] Manufacturer=SILICON LABORATORIES[/li][/ul]

Da sich die beiden USB Geräte wirklich ganz ident melden denke ich, dass IP-Symcon die beiden nicht getrennt handhaben kann.
Ich hab verschiedene Sachen probiert -> erstellen von einem SYMLINK via udev rules, … aber all dies dürfte IP-Symcon nicht auswerten.

Leider hat IPS bei der „HID Instanz“ nur die Eigenschaften „DeviceVendorID, DeviceProductID, DeviceSerial“ und diese sind beim VOLTCRAFT 100 DUO eben komplett gleich. Wenn die „HID Instanz“ eine Eigenschaft „Port“ hätte (so wie der Serial Port) könnte ich wahrscheinlich mit folgenden Befehlen zum gewünschten Ziel kommen:

  • IPS_SetProperty(integer $InstanzID, ‚Port‘, ‚/dev/hidraw0‘);
  • IPS_SetProperty(integer $InstanzID, ‚Port‘, ‚/dev/hidraw1‘); .

FRAGEN:

[ul]
[li] Hat einer von euch eine Idee wie ich das Problem umgehen kann? Ist es per udev rules möglich „DeviceVendorID, DeviceProductID, DeviceSerial“ zu ändern so das IPS die beiden Geräte auseinander halten kann[/li]
[li] Gibt es eine Möglichkeit via Treiber am Raspberry einen bestimmten hidraw Port auf einen Serial Port zu bekommen damit ich dann aus IPS via Serieller Schnittstelle mit dem Gerät kommunizieren kann[/li]
[li] Oder noch besser, kann das IP-Symcon Team hier eine Lösung einbringen? Viele neue Geräte stellen via USB jetzt ein „HID Gerät“ zur Verfügung und keinen „USB-COM Port“ mehr. Somit wäre hier eine Lösung sicher zukunftssicherer …[/li][/ul]

Damit ihr dieses Problem besser sehen könnt, hier einige Details Infos dazu:

Ausgabe von „lsusb -t“ am Raspberry. Die zwei Geräte von meinem Ladegerät sind Port 2 & 3


/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/3p, 480M
        |__ Port 1: Dev 3, If 0, Class=Vendor Specific Class, Driver=smsc95xx, 480M
        |__ Port 2: Dev 4, If 0, Class=Human Interface Device, Driver=usbhid, 12M
        |__ Port 3: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 12M

Ausgabe von ‚usb-devices‘ am Raspberry. Hier ist gut zu sehen das sich die zwei Geräte nur am Port unterscheiden


T:  Bus=01 Lev=02 Prnt=02 Port=01 Cnt=02 Dev#=  4 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0001 Rev=00.00
S:  Manufacturer=SILICON LABORATORIES
S:  Product=C8051F3xx Development Board
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=64mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid

T:  Bus=01 Lev=02 Prnt=02 Port=02 Cnt=03 Dev#=  5 Spd=12  MxCh= 0
D:  Ver= 1.10 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=0000 ProdID=0001 Rev=00.00
S:  Manufacturer=SILICON LABORATORIES
S:  Product=C8051F3xx Development Board
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=64mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=03(HID  ) Sub=01 Prot=02 Driver=usbhid

Detailausgabe von: udevadm info --name=/dev/hidraw0 --attribute-walk


devadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:0000:0001.0001/hidraw/hidraw0':
    KERNEL=="hidraw0"
    SUBSYSTEM=="hidraw"
    DRIVER==""

  looking at parent device '/devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.0/0003:0000:0001.0001':
    KERNELS=="0003:0000:0001.0001"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="00"

  looking at parent device '/devices/platform/soc/20980000.usb/usb1/1-1/1-1.2/1-1.2:1.0':
    KERNELS=="1-1.2:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{authorized}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceProtocol}=="02"
    ATTRS{bInterfaceSubClass}=="01"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/platform/soc/20980000.usb/usb1/1-1/1-1.2':
    KERNELS=="1-1.2"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="64mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0000"
    ATTRS{bmAttributes}=="80"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="4"
    ATTRS{devpath}=="1.2"
    ATTRS{devspec}=="  (null)"
    ATTRS{idProduct}=="0001"
    ATTRS{idVendor}=="0000"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="SILICON LABORATORIES"
    ATTRS{maxchild}=="0"
    ATTRS{product}=="C8051F3xx Development Board"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="removable"
    ATTRS{speed}=="12"
    ATTRS{urbnum}=="3092"
    ATTRS{version}==" 1.10"

  looking at parent device '/devices/platform/soc/20980000.usb/usb1/1-1':
    KERNELS=="1-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="02"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="2mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0200"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="2"
    ATTRS{devpath}=="1"
    ATTRS{idProduct}=="9512"
    ATTRS{idVendor}=="0424"
    ATTRS{ltm_capable}=="no"
    ATTRS{maxchild}=="3"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{speed}=="480"
    ATTRS{urbnum}=="41"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/soc/20980000.usb/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{authorized_default}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0414"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{idProduct}=="0002"
    ATTRS{idVendor}=="1d6b"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 4.14.70+ dwc_otg_hcd"
    ATTRS{maxchild}=="1"
    ATTRS{product}=="DWC OTG Controller"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{serial}=="20980000.usb"
    ATTRS{speed}=="480"
    ATTRS{urbnum}=="25"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/soc/20980000.usb':
    KERNELS=="20980000.usb"
    SUBSYSTEMS=="platform"
    DRIVERS=="dwc_otg"
    ATTRS{busconnected}=="Bus Connected = 0x1"
    ATTRS{buspower}=="Bus Power = 0x1"
    ATTRS{bussuspend}=="Bus Suspend = 0x0"
    ATTRS{devspeed}=="Device Speed = 0x0"
    ATTRS{driver_override}=="(null)"
    ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
    ATTRS{fr_interval}=="Frame Interval = 0x1d4b"
    ATTRS{ggpio}=="GGPIO = 0x00000000"
    ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
    ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
    ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
    ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
    ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
    ATTRS{guid}=="GUID = 0x2708a000"
    ATTRS{gusbcfg}=="GUSBCFG = 0x20001700"
    ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"
    ATTRS{hcddump}=="HCD Dump"
    ATTRS{hnp}=="HstNegScs = 0x0"
    ATTRS{hnpcapable}=="HNPCapable = 0x1"
    ATTRS{hprt0}=="HPRT0 = 0x00001405"
    ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
    ATTRS{hsic_connect}=="HSIC Connect = 0x1"
    ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
    ATTRS{mode}=="Mode = 0x1"
    ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
    ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 1430 msecs (143 jiffies)"
    ATTRS{regdump}=="Register Dump"
    ATTRS{regoffset}=="0xffffffff"
    ATTRS{regvalue}=="invalid offset"
    ATTRS{rem_wakeup_pwrdn}==""
    ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
    ATTRS{spramdump}=="SPRAM Dump"
    ATTRS{srp}=="SesReqScs = 0x1"
    ATTRS{srpcapable}=="SRPCapable = 0x1"
    ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 670 msecs (67 jiffies)"

  looking at parent device '/devices/platform/soc':
    KERNELS=="soc"
    SUBSYSTEMS=="platform"
    DRIVERS==""
    ATTRS{driver_override}=="(null)"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

Detailausgabe von: udevadm info --name=/dev/hidraw1 --attribute-walk


Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

  looking at device '/devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:0000:0001.0002/hidraw/hidraw1':
    KERNEL=="hidraw1"
    SUBSYSTEM=="hidraw"
    DRIVER==""

  looking at parent device '/devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.0/0003:0000:0001.0002':
    KERNELS=="0003:0000:0001.0002"
    SUBSYSTEMS=="hid"
    DRIVERS=="hid-generic"
    ATTRS{country}=="00"

  looking at parent device '/devices/platform/soc/20980000.usb/usb1/1-1/1-1.3/1-1.3:1.0':
    KERNELS=="1-1.3:1.0"
    SUBSYSTEMS=="usb"
    DRIVERS=="usbhid"
    ATTRS{authorized}=="1"
    ATTRS{bAlternateSetting}==" 0"
    ATTRS{bInterfaceClass}=="03"
    ATTRS{bInterfaceNumber}=="00"
    ATTRS{bInterfaceProtocol}=="02"
    ATTRS{bInterfaceSubClass}=="01"
    ATTRS{bNumEndpoints}=="02"
    ATTRS{supports_autosuspend}=="1"

  looking at parent device '/devices/platform/soc/20980000.usb/usb1/1-1/1-1.3':
    KERNELS=="1-1.3"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="00"
    ATTRS{bDeviceProtocol}=="00"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="64mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0000"
    ATTRS{bmAttributes}=="80"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="5"
    ATTRS{devpath}=="1.3"
    ATTRS{devspec}=="  (null)"
    ATTRS{idProduct}=="0001"
    ATTRS{idVendor}=="0000"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="SILICON LABORATORIES"
    ATTRS{maxchild}=="0"
    ATTRS{product}=="C8051F3xx Development Board"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="removable"
    ATTRS{speed}=="12"
    ATTRS{urbnum}=="18"
    ATTRS{version}==" 1.10"

  looking at parent device '/devices/platform/soc/20980000.usb/usb1/1-1':
    KERNELS=="1-1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="02"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="2mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0200"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="2"
    ATTRS{devpath}=="1"
    ATTRS{idProduct}=="9512"
    ATTRS{idVendor}=="0424"
    ATTRS{ltm_capable}=="no"
    ATTRS{maxchild}=="3"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{speed}=="480"
    ATTRS{urbnum}=="41"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/soc/20980000.usb/usb1':
    KERNELS=="usb1"
    SUBSYSTEMS=="usb"
    DRIVERS=="usb"
    ATTRS{authorized}=="1"
    ATTRS{authorized_default}=="1"
    ATTRS{avoid_reset_quirk}=="0"
    ATTRS{bConfigurationValue}=="1"
    ATTRS{bDeviceClass}=="09"
    ATTRS{bDeviceProtocol}=="01"
    ATTRS{bDeviceSubClass}=="00"
    ATTRS{bMaxPacketSize0}=="64"
    ATTRS{bMaxPower}=="0mA"
    ATTRS{bNumConfigurations}=="1"
    ATTRS{bNumInterfaces}==" 1"
    ATTRS{bcdDevice}=="0414"
    ATTRS{bmAttributes}=="e0"
    ATTRS{busnum}=="1"
    ATTRS{configuration}==""
    ATTRS{devnum}=="1"
    ATTRS{devpath}=="0"
    ATTRS{idProduct}=="0002"
    ATTRS{idVendor}=="1d6b"
    ATTRS{interface_authorized_default}=="1"
    ATTRS{ltm_capable}=="no"
    ATTRS{manufacturer}=="Linux 4.14.70+ dwc_otg_hcd"
    ATTRS{maxchild}=="1"
    ATTRS{product}=="DWC OTG Controller"
    ATTRS{quirks}=="0x0"
    ATTRS{removable}=="unknown"
    ATTRS{serial}=="20980000.usb"
    ATTRS{speed}=="480"
    ATTRS{urbnum}=="25"
    ATTRS{version}==" 2.00"

  looking at parent device '/devices/platform/soc/20980000.usb':
    KERNELS=="20980000.usb"
    SUBSYSTEMS=="platform"
    DRIVERS=="dwc_otg"
    ATTRS{busconnected}=="Bus Connected = 0x1"
    ATTRS{buspower}=="Bus Power = 0x1"
    ATTRS{bussuspend}=="Bus Suspend = 0x0"
    ATTRS{devspeed}=="Device Speed = 0x0"
    ATTRS{driver_override}=="(null)"
    ATTRS{enumspeed}=="Device Enumeration Speed = 0x1"
    ATTRS{fr_interval}=="Frame Interval = 0x1d4b"
    ATTRS{ggpio}=="GGPIO = 0x00000000"
    ATTRS{gnptxfsiz}=="GNPTXFSIZ = 0x01000306"
    ATTRS{gotgctl}=="GOTGCTL = 0x001c0001"
    ATTRS{gpvndctl}=="GPVNDCTL = 0x00000000"
    ATTRS{grxfsiz}=="GRXFSIZ = 0x00000306"
    ATTRS{gsnpsid}=="GSNPSID = 0x4f54280a"
    ATTRS{guid}=="GUID = 0x2708a000"
    ATTRS{gusbcfg}=="GUSBCFG = 0x20001700"
    ATTRS{hcd_frrem}=="HCD Dump Frame Remaining"
    ATTRS{hcddump}=="HCD Dump"
    ATTRS{hnp}=="HstNegScs = 0x0"
    ATTRS{hnpcapable}=="HNPCapable = 0x1"
    ATTRS{hprt0}=="HPRT0 = 0x00001005"
    ATTRS{hptxfsiz}=="HPTXFSIZ = 0x02000406"
    ATTRS{hsic_connect}=="HSIC Connect = 0x1"
    ATTRS{inv_sel_hsic}=="Invert Select HSIC = 0x0"
    ATTRS{mode}=="Mode = 0x1"
    ATTRS{mode_ch_tim_en}=="Mode Change Ready Timer Enable = 0x0"
    ATTRS{rd_reg_test}=="Time to read GNPTXFSIZ reg 10000000 times: 1430 msecs (143 jiffies)"
    ATTRS{regdump}=="Register Dump"
    ATTRS{regoffset}=="0xffffffff"
    ATTRS{regvalue}=="invalid offset"
    ATTRS{rem_wakeup_pwrdn}==""
    ATTRS{remote_wakeup}=="Remote Wakeup Sig = 0 Enabled = 0 LPM Remote Wakeup = 0"
    ATTRS{spramdump}=="SPRAM Dump"
    ATTRS{srp}=="SesReqScs = 0x1"
    ATTRS{srpcapable}=="SRPCapable = 0x1"
    ATTRS{wr_reg_test}=="Time to write GNPTXFSIZ reg 10000000 times: 670 msecs (67 jiffies)"

  looking at parent device '/devices/platform/soc':
    KERNELS=="soc"
    SUBSYSTEMS=="platform"
    DRIVERS==""
    ATTRS{driver_override}=="(null)"

  looking at parent device '/devices/platform':
    KERNELS=="platform"
    SUBSYSTEMS==""
    DRIVERS==""

Und hier die versprochenen Screenshots. Wenn Interesse besteht, kann ich auch gern mal Protokoll Details zur Verfügung stellen.


Modellbau-Multifunktionsladegerät VOLTCRAFT V-Charge 100 Duo
modellbau-multifunktionsladegeraet-12-v-230-v-10-a-voltcraft-v-charge-100-duo (1).jpg modellbau-multifunktionsladegeraet-12-v-230-v-10-a-voltcraft-v-charge-100-duo.jpg