Giter VIP home page Giter VIP logo

ut61ep's Introduction

Uni-T UT61E+ USB Protocol Client

The Uni-T UT61E+ digital multimeter can be connected to a PC through the built-in CP2110 UART-USB bridge. This repository contains a client library for its proprietary protocol.

Using the library

Dependencies

The library is using the cross-platform HIDAPI to communicate with the device. On a Debian based system installing the following packages should be sufficient:

sudo apt install libhidapi-dev libudev-dev

The library is also available for other operating systems but this is untested.

Example

dev, err := ut61ep.Open("")
if err != nil {
    log.Fatalf("open: %v", err)
}
message, err := dev.ReadMessage()
if err != nil {
    log.Fatalf("readMessage: %v", err)
}
log.Printf("%f %s", message.Value, message.Unit.String())

Protocol Description

Configuring CP2110

Before any communication with the multimeter can take place the CP2110 UART-USB bridge chip has to be configured by sending feature reports:

// Enable UART
0x41, 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

Requesting data from the device

Data can be requested by sending the following byte sequence:

0x06, 0xab, 0xcd, 0x03, 0x5e, 0x01, 0xd9

Reply from the device

The device always sends two bytes at a time, the first of which is always a 1 and the second one containing the actual data 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 the message 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.

References

ut61ep's People

Contributors

mwuertinger avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.