ich möchte die Daten eines Multimeter auslesen.
Ich bin Neuling im Programmieren und Neuling auf Python.
Ich habe eine Software gefunden mit der das Auselesen eines Multimeters über ein RS232 Kabel geht.
https://github.com/swharden/pyTENMA/blo ... pyTENMA.py
Mein Multimeter hat aber ein USB Kabel dabei.
Bisher konnte ich zumindest feststellen das das multimeter da ist.
mit diesem CODE: (allerdings brauch ich hier SUDO rechte zum ausführen, das sollte später auch ohne diese rechte funktionieren)
Code: Alles auswählen
import usb.core
dev=usb.core.find(idVendor=0x1a86,idProduct=0xe008)
ep=dev[0].interfaces()[0].endpoints()[0]
i=dev[0].interfaces()[0].bInterfaceNumber
dev.reset
if dev.is_kernel_driver_active(i): #missing interface
dev.detach_kernel_driver(i)
print("OK!")
else:
print("notOK")
Meine Direkte Anfrage an Scott W Harden war erfolglos, er hat keine Zeit dafür.
Ich solle in einem Forum fragen...(das tue ich hier)
Der erste Teil ist das Anzeigen von einem Multimeter
Der zweite Teil - danach möchte ich zwei Gleichzeitig anzeigen um eine Ladekurve (Strom uns Spannung) aufzuzeichnen.
zur Info noch:
Code: Alles auswählen
mx@mx:~
$ $ lsusb -D /dev/bus/usb/004/006
$: command not found
mx@mx:~
$ lsusb
Bus 008 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 003: ID 045e:007d Microsoft Corp. Notebook Optical Mouse
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 006: ID 1a86:e008 QinHeng Electronics HID-based serial adapater
Bus 004 Device 004: ID 25a7:fa23 Areson Technology Corp 2.4G Receiver
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
mx@mx:~
$ $ lsusb -D /dev/bus/usb/004/006
$: command not found
mx@mx:~
$ lsusb -D /dev/bus/usb/004/006
Device: ID 1a86:e008 QinHeng Electronics HID-based serial adapater
Couldn't open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 8
idVendor 0x1a86 QinHeng Electronics
idProduct 0xe008 HID-based serial adapater
bcdDevice 14.00
iManufacturer 1 WCH.CN
iProduct 2 USB to Serial
iSerial 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 0x0029
bNumInterfaces 1
bConfigurationValue 1
iConfiguration 4
bmAttributes 0x80
(Bus Powered)
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 2
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 37
Report Descriptors:
** UNAVAILABLE **
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 5
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x02 EP 2 OUT
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0008 1x 8 bytes
bInterval 5
mx@mx:~
$