- Notifications
You must be signed in to change notification settings - Fork0
mwuertinger/ut61ep
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
TheUni-T UT61E+digital multimeter can be connected to a PC through the built-in CP2110 UART-USB bridge. This repository contains aclient library for its proprietary protocol.
The library is using the cross-platform HIDAPI to communicate with the device. On a Debian based system installing thefollowing packages should be sufficient:
sudo apt install libhidapi-dev libudev-dev
The library is also available for other operating systems but this is untested.
dev,err:=ut61ep.Open("")iferr!=nil {log.Fatalf("open: %v",err)}message,err:=dev.ReadMessage()iferr!=nil {log.Fatalf("readMessage: %v",err)}log.Printf("%f %s",message.Value,message.Unit.String())
Before any communication with the multimeter can take place the CP2110 UART-USB bridge chip has to be configured by sending feature reports:
// Enable UART0x41, 0x01// Configure UART (9600 baud, parity=NONE, 8 Bit, hardware Flow Control disabled, stop bits short)0x50, 0x00, 0x00, 0x25, 0x80, 0x00, 0x00, 0x03, 0x00, 0x00
Data can be requested by sending the following byte sequence:
0x06, 0xab, 0xcd, 0x03, 0x5e, 0x01, 0xd9
The device always sends two bytes at a time, the first of which is always a 1 and the second one containing the actualdata byte. The following message description ignores the first byte and shows only the actual data bytes.
The device responds with a 19 byte long message. The first two bytes are constant, the following byte contains themessage length and the remainder is the actual data.
01 AB CD 10 00 00 30 20 30 2e 30 38 35 30 00 01 30 30 30 03-- ----- -- -- -- ----------------- -- | | | | | | | | | | | | | | | | | | | | | | | | | | | ------ sign / sub-mode | | | | | ----------------------------- value | | | | ------------------------------------------ range | | | --------------------------------------------- mode | | --------------------------------------------------- length of the following message | -------------------------------------------------------- constant preamble ------------------------------------------------------------ message type
For many of the bytes only the least significant 4-bits are relevant and the most significant 4-bits are 0x30.
- This library was inspired by asimilar project for a different Uni-T multimeter
- CP2110 datasheet