Reading data from a Tenma 72-7732 multimeter using PyUSB

I am trying to read voltages from a Tenma 72-7732 multimeter with a HID USB connection using PyUSB and libusb. This is my code:

def main(): import usb.core import usb.util import usb.backend import sys #find device dev = usb.core.find(idVendor=0x1a86, idProduct=0xe008) # did you find it? if dev is None: raise ValueError('Device not found') else: print "Device found" dev.set_configuration() endpoint = dev[0][(0,0)][0] data = dev.read(endpoint.bEndpointAddress, endpoint.wMaxPacketSize, 0, 100000) print data main() 

This finds the device, but when it tries to read the data, it gives a timeout error. The multimeter has very poor documentation and support, so I can not ask for help. How can I read the device successfully?

+4
source share
1 answer

I use a simple IR adapter for RS232, which consists of an IR detector attached by an anode to pin 4 and a cathode to pin 2 (RX data). When connected to a computer with a simple terminal set to 2400 baud, 7 Data 1 Stop, No parity, No handshake, it produces the following line

013651211

which repeats approximately every 400 ms. The first 5 digits are indicated on the counter, digit 6 is the decimal point, digit 8 is the functional position

VDC = 1 AmpDC = 9

The last digit seems automatic / manual mixed with a sign; I don’t need the rest (for now).

0
source

Source: https://habr.com/ru/post/1491879/


All Articles