A couple of months ago, I received a new digital multimeter UNI-T UT61E that can send data to a computer via a serial cable, and allows you draw some nice charts. I’ve already done that in Windows 7 with the provided tools, and reported on the power consumption of some Chinese Android TV boxes. However, since I use Ubuntu 14.04 as my main operating system, Linux based tools would be more convenient, and open source sigrok-cli command line client and its graphical interface pulseview are supposed to support UT61E DMM, so I had to give it a try.
A Quick Look at UNI-T UT61 Digital Multimeter
Before going into Sigrok, I’ll quickly show what the multimeter received from DealExtreme . It took longer than expected to ship because of of included 9V battery, and at the first shipping attempt it was returned to DX, but after 8 weeks or so, I finally received the package.
The multimeter came with test leads, an adapter for transistor and capacitor, D02 serial cable to connect between the multimeter and the serial port of your PC, and an operating manual in English. Most sellers don’t include the required 9V PP3, but DX did. It seemed more convenient at the time of purchased, but as mentioned above custom issues completely ruined this little convenience.
I had read review saying test leads where pretty poor, so I performed a continuity test, and the results were pretty bad, so I asked a partial refund from DX to buy another pair of test leads which are much better.
Linux issues with CH340/CH341 USB to Serial Adapters
DB9 serial connector are a thing of the past in most computers and laptops, so I had to use that RS232 to Serial USB adapter between UNI-T D02 cable and a USB port of my computer. I’ve been using with Wandboard and SABRE Lite boards a few time without any issues, but when I started run sigrok-cli, I got some error messages:
1 2 3 4 5 6 7 8 |
sigrok-cli --driver=uni-t-ut61e-ser:conn=/dev/ttyUSB1 --scan sr: es51922: Invalid function byte: 0xb3. sr: es51922: Invalid function byte: 0xb0. sr: es51922: Both AC and DC flags detected in packet. sr: es51922: Invalid function byte: 0xb0. sr: es51922: Invalid function byte: 0xb0. sr: es51922: Invalid function byte: 0x0d. sr: serial: Didn't find a valid packet (read 20 bytes). |
So I mentioned the issue to Sigrok developers, who could not reproduce the issue. But then I shared some details about the adapter:
1 2 3 4 5 6 7 8 9 10 11 12 |
lsusb -v -d 1a86:7523 Bus 003 Device 007: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter Device Descriptor: bLength 18 bDescriptorType 1 bcdUSB 1.10 bDeviceClass 255 Vendor Specific Class bDeviceSubClass 0 bDeviceProtocol 0 bMaxPacketSize0 8 idVendor 0x1a86 QinHeng Electronics idProduct 0x7523 HL-340 USB-Serial adapter |
And HL-340 USB-Serial adapter are known not to work properly. Why is that? While in most case you’d use some baud rate with 8N1 (8-bit / no parity / 1-stop bit), UNI-T multimeters are using 19200 7O1 connection (with odd parity), and so far the parity bit is simply ignored in ch341.ko driver, so my PC would just receive incorrect data.
Luckily there’s now a patch, and I’ve shown how to build the driver for Ubuntu 14.04 with Linux kernel 3.18, and that part is working fine.
Sigrok-cli Command Line
Installing sigrok-cli command is very easy as sigrok is part of Ubuntu 14.04 package repositories:
1 |
sudo apt-get install sigrok |
At first, you may want to check the vesion as it will also list supported drivers, and available options:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
sigrok-cli --version sigrok-cli 0.4.0 Using libsigrok 0.2.0 (lib version 1:0:0). Using libsigrokdecode 0.2.0 (lib version 1:0:0). Supported hardware drivers: brymen-bm857 Brymen BM857 colead-slm Colead SLM demo Demo driver and pattern generator lascar-el-usb Lascar EL-USB mic-98581 MIC 98581 mic-98583 MIC 98583 ols Openbench Logic Sniffer rigol-ds1xx2 Rigol DS1xx2 tondaj-sl-814 Tondaj SL-814 victor-dmm Victor DMMs zeroplus-logic-cube ZEROPLUS Logic Cube LAP-C series asix-sigma ASIX SIGMA/SIGMA2 chronovu-la8 ChronoVu LA8 alsa ALSA driver fx2lafw fx2lafw (generic driver for FX2 based LAs) hantek-dso Hantek DSO agilent-dmm Agilent U12xx series DMMs fluke-dmm Fluke 18x/28x series DMMs digitek-dt4000zc Digitek DT4000ZC tekpower-tp4000zc TekPower TP4000ZC metex-me31 Metex ME-31 peaktech-3410 PeakTech 3410 mastech-mas345 MASTECH MAS345 va-va18b V&A VA18B metex-m3640d Metex M-3640D peaktech-4370 PeakTech 4370 pce-pce-dm32 PCE PCE-DM32 radioshack-22-168 RadioShack 22-168 radioshack-22-805 RadioShack 22-805 radioshack-22-812 RadioShack 22-812 tecpel-dmm-8060-ser Tecpel DMM-8060 (UT-D02 cable) tecpel-dmm-8061-ser Tecpel DMM-8061 (UT-D02 cable) voltcraft-vc820-ser Voltcraft VC-820 (UT-D02 cable) voltcraft-vc840-ser Voltcraft VC-840 (UT-D02 cable) uni-t-ut61d-ser UNI-T UT61D (UT-D02 cable) uni-t-ut61e-ser UNI-T UT61E (UT-D02 cable) tecpel-dmm-8060 Tecpel DMM-8060 tecpel-dmm-8061 Tecpel DMM-8061 uni-t-ut61d UNI-T UT61D uni-t-ut61e UNI-T UT61E voltcraft-vc820 Voltcraft VC-820 voltcraft-vc840 Voltcraft VC-840 Supported input formats: vcd Value Change Dump chronovu-la8 ChronoVu LA8 wav WAV file binary Raw binary Supported output formats: bits Bits hex Hexadecimal ascii ASCII binary Raw binary vcd Value Change Dump (VCD) ols OpenBench Logic Sniffer gnuplot Gnuplot chronovu-la8 ChronoVu LA8 csv Comma-separated values (CSV) analog Analog data Supported protocol decoders: edid Extended Display Identification Data ds1307 Dallas DS1307 usb_signalling Universal Serial Bus (LS/FS) signalling usb_protocol Universal Serial Bus (LS/FS) protocol spi Serial Peripheral Interface can Controller Area Network lm75 National LM75 jtag_stm32 Joint Test Action Group / ST STM32 rtc8564 Epson RTC-8564 JE/NB avr_isp AVR In-System Programming onewire_link 1-Wire serial communication bus (link layer) i2s Integrated Interchip Sound i2c Inter-Integrated Circuit lpc Low-Pin-Count onewire_network 1-Wire serial communication bus (network layer) transitioncounter Pin transition counter i2cdemux I2C demultiplexer mlx90614 Melexis MLX90614 jtag Joint Test Action Group (IEEE 1149.1) uart_dump UART dump sdcard_spi Secure Digital card (SPI mode) maxim_ds28ea00 Maxim DS28EA00 1-Wire digital thermometer i2cfilter I2C filter mx25lxx05d Macronix MX25Lxx05D uart Universal Asynchronous Receiver/Transmitter pan1321 Panasonic PAN1321 mxc6225xu MEMSIC MXC6225XU nunchuk Nintendo Wii Nunchuk dcf77 DCF77 time protocol tlc5620 Texas Instruments TLC5620 |
The libraries version are still 0.2.0, while the latest release is 0.3.0. So I tried to build sigrok-cli 0.5.0 from github instead with 0.3.0 version libs (more on that later), but it failed to scan my DMM, so I kept using the version packaged for Ubuntu 14.04.
The good news is that the client can detect UT61e:
1 2 3 |
sigrok-cli --driver=uni-t-ut61e-ser:conn=/dev/ttyUSB0 --scan The following devices were found: uni-t-ut61e-ser - UNI-T UT61E (UT-D02 cable) with 1 probe: P1 |
and even better I could capture a few samples
1 2 3 4 5 6 7 8 9 10 11 |
sigrok-cli --driver=uni-t-ut61e-ser:conn=/dev/ttyUSB0 -O analog --samples 10 P1: inf Ω P1: 0.000000 Ω P1: 1.225500 kΩ P1: 190.000000 Ω P1: 0.000000 Ω P1: 1.491800 MΩ P1: 0.170000 Ω P1: inf Ω P1: 2.913000 MΩ P1: 2.723000 MΩ |
If you want to capture more, simply changed the samples value, or use “continuous” instead.
But if you want to draw a chart in a spreadsheet, or other software the analog output is not really suitable. Fortunately sigrok-cli support multiple output formats with csv (comma-separated values), gnuplot, or its own default format that can be loaded in pulseview GUI. In theory, you could capture 10 sample in csv format and load the resulting file into a spreadsheet with the following command.
1 |
sigrok-cli --driver=uni-t-ut61e-ser:conn=/dev/ttyUSB0 --samples 10 -O csv -o voltage.csv |
But in my case, all formats others than Analog failed, and all I got was empty files.
Pulseview in Ubuntu 14.04
Contrary to sigrok, pulseview graphical user interface is not part of Ubuntu 14.04 packages, and can only be found in Ubuntu Utopic (14.10) or Vidid (15.04):
1 |
sudo apt-get install pulseview |
I completely forgot to look for PPA before I built from source, and there’s already pulseview & sigrok packages for Ubuntu 13.10 and 14.04, so that would make it much easier. Instead I decided to build, as I though it should probably straightforward, but it turned out there are quite a few dependencies, and libraries to buid, and that’s the steps I had to follow in Ubuntu 14.04:
- Install dependencies
sudo apt-get install build-essential cmake git autoconf-archive qt4-dev-tools libboost-dev libboost-system-dev libboost-filesystem-dev libboost-thread-dev libboost-test-dev libglibmm-2.4-dev doxygen python-gobject-dev swig clang python-numpy
- Retrieve libsigrok source code:
1git clone git://sigrok.org/libsigrok - Since autoconf-archive packahe is too old, you’ll need to manually download ax_cxx_compile_stdcxx_11.m4, copy it in a directory (e.g. m4), before completing the build:
12345cd libsigrokmkdir m4cp <download_path>/ax_cxx_compile_stdcxx_11.m4 m4ACLOCAL_PATH=$(pwd)/m4 ./autogen.sh./configure
at this stage make sure the configure ends with C++ and Python bindings enabled
1234Enabled language bindings:- C++............................. yes- Python.......................... yes- Java............................ yes
Please note that I had some issues at first during make due to doxygen generating duplicate enums, but I was finally able to compile and install libsigrok:
12make -j8sudo make install - Now do the same with libsigrokdecode:
1234567cd..git clone git://sigrok.org/libsigrokdecodecd libsigrokdecode/./autogen.sh./configuremake -j8sudo make install - And pulseview:
123456cd ..git clone git://sigrok.org/pulseview.gitcd pulseviewcmake .make -j8sudo make install - You can now run pulseview, and for some reasons (installation prefix of libsogrok?) I also add to define LD_LIBRARY_PATH:
12export LD_LIBRARY_PATH=/usr/local/libpulseview
By default Pulseview will “connect” to a demo device emulating a logic analyzer. You can then click on Run and see a few signals as shown in the screenshot above. But obviously it’s more interesting to play with a real device like UT61E multimeter.
So you can go to the top menu to select File->Connect to Device to select your instrument. It seems I was out of luck again, as UNI-T drivers are not listed at all, despite being shown in the “About” section. I have not been able to investigate the reason, but if you have one of the device above it should work.
PulseView and Sigrok can also automatically decode signals like CAN, I2C, UART, USB, S/PDIF, and so on, which would be most interesting for logic analyzers.
So Pulseview and Sigrok look quite promising on paper, but the combination Ubuntu 14.04 + UNI-T UT61E multimeter + HL-340 USB to serial adapter made it quite challenging to setup, and mostly unusable after installation. I’ve also tried it in the development version of Ubuntu 15.04 with Linux 3.19, and both sigrok and pulseview install easily, but I would have to re-build ch341 driver again, which I’m too lazy to do for now. Maybe I’ll give it another try lateron.
Jean-Luc started CNX Software in 2010 as a part-time endeavor, before quitting his job as a software engineering manager, and starting to write daily news, and reviews full time later in 2011.
Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress
I bought the same multimeter, will try to make it work with sigrok. Do you have any idea why the Digital mode failed with sigrok?
That’s the output I get with logging enabled:
sigrok-cli –driver=uni-t-ut61e-ser:conn=/dev/ttyUSB0 –samples 2 -O csv -l 5
sr: libsigrok loglevel set to 5.
sr: Sanity-checking all drivers.
sr: Sanity-checking all input modules.
sr: Sanity-checking all output modules.
srd: libsigrokdecode loglevel set to 5.
sr: hwdriver: Initializing driver ‘uni-t-ut61e-ser’.
sr: serial-dmm: Selected ‘uni-t-ut61e-ser’ subdriver.
sr: serial: Opening serial port ‘/dev/ttyUSB0’ (flags 5).
sr: serial: Opened serial port ‘/dev/ttyUSB0’ (fd 11).
sr: serial: Parsing parameters from “19200/7o1/rts=0/dtr=1”.
sr: serial: Setting serial parameters on port /dev/ttyUSB0 (fd 11).
sr: serial: Configuring output baudrate to 19200 (14).
sr: serial: Configuring input baudrate to 19200 (14).
sr: serial: Configuring 7 data bits.
sr: serial: Configuring 1 stop bits.
sr: serial: Configuring no flow control.
sr: serial: Configuring odd parity.
sr: serial: Setting RTS low.
sr: serial: Setting DTR high.
sr: serial-dmm: Probing serial port /dev/ttyUSB0.
sr: serial: Flushing serial port /dev/ttyUSB0 (fd 11).
sr: serial: Detecting packets on FD 11 (timeout = 1000ms, baudrate = 19200).
sr: serial: Found valid 14-byte packet after 310ms.
sr: serial-dmm: Found device on port /dev/ttyUSB0.
sr: serial: Closing serial port /dev/ttyUSB0 (fd 11).
sr: hwdriver: Scan of ‘uni-t-ut61e-ser’ found 1 devices.
sr: serial: Opening serial port ‘/dev/ttyUSB0’ (flags 5).
sr: serial: Opened serial port ‘/dev/ttyUSB0’ (fd 11).
sr: serial: Parsing parameters from “19200/7o1/rts=0/dtr=1”.
sr: serial: Setting serial parameters on port /dev/ttyUSB0 (fd 11).
sr: serial: Configuring output baudrate to 19200 (14).
sr: serial: Configuring input baudrate to 19200 (14).
sr: serial: Configuring 7 data bits.
sr: serial: Configuring 1 stop bits.
sr: serial: Configuring no flow control.
sr: serial: Configuring odd parity.
sr: serial: Setting RTS low.
sr: serial: Setting DTR high.
sr: serial-dmm: Setting sample limit to 2.
sr: session: Starting.
sr: serial-dmm: Starting acquisition.
sr: serial-dmm: Sending SR_DF_HEADER packet.
sr: session: bus: Received SR_DF_HEADER packet.
cli: Received SR_DF_HEADER
sr: session: Running.
sr: es51922: Packet doesn’t end with \r\n.
sr: serial-dmm: DMM packet: 30 30 30 30 31 32 33 30 30 30 32 30 0d 0a
sr: es51922: The display value is 12.000000.
sr: es51922: Applying factor 0.010000, new value is 0.120000.
sr: session: bus: Received SR_DF_ANALOG packet (1 samples).
cli: received SR_DF_ANALOG, 1 samples
sr: serial-dmm: DMM packet: 30 30 30 30 31 32 33 30 30 30 32 30 0d 0a
sr: es51922: The display value is 12.000000.
sr: es51922: Applying factor 0.010000, new value is 0.120000.
sr: session: bus: Received SR_DF_ANALOG packet (1 samples).
cli: received SR_DF_ANALOG, 1 samples
sr: serial-dmm: Requested number of samples reached.
sr: serial-dmm: Stopping acquisition.
sr: serial: Closing serial port /dev/ttyUSB0 (fd 11).
sr: serial-dmm: Sending SR_DF_END packet.
sr: session: bus: Received SR_DF_END packet.
cli: Received SR_DF_END
sr: output/csv: event: SR_DF_END event
The version in Ubuntu 14.04 is not the latest one, so maybe it’s why it does not work.
@cnxsoft
Have you tried with more recent package version via the PPA? I will try to give it a shot, as i have pl2303 12v adaptors, and sabayon/gentoo with the latest (even head of the git) versions.
@zoobab
on my sabayon i have the following versions:
sigrok-cli 0.5.0
Using libsigrok 0.3.0 (lib version 2:0:0).
Using libsigrokdecode 0.3.0 (lib version 2:0:0).
@zoobab
in Ubuntu 15.04 I have the same version. I’d just need to spend some time to recompile ch341 driver.
I have not tried the PPA in Ubuntu 14.04 yet.
@cnxsoft
I’ve installed the PPA version in Ubuntu 14.04, after removing the old version:
sudo apt-add-repository ppa:jorik-kippendief/sigrok
sudo apt-get update
sudo apt-get install sigrok-cli
But it won’t even be able to scan the multimeter, as the connection times out:
sigrok-cli –driver=uni-t-ut61e-ser:conn=/dev/ttyUSB0 –scan -l 5
sr: libsigrok loglevel set to 5.
sr: backend: Sanity-checking all drivers.
sr: backend: Sanity-checking all input modules.
sr: backend: Sanity-checking all output modules.
sr: backend: Sanity-checking all transform modules.
srd: libsigrokdecode loglevel set to 5.
sr: hwdriver: Initializing driver ‘uni-t-ut61e-ser’.
sr: serial: Opening serial port ‘/dev/ttyUSB0’ (flags 1).
sr: serial: Parsing parameters from “19200/7o1/rts=0/dtr=1”.
sr: serial: Setting serial parameters on port /dev/ttyUSB0.
sr: serial-dmm: Probing serial port /dev/ttyUSB0.
sr: serial: Flushing serial port /dev/ttyUSB0.
sr: serial: Detecting packets on /dev/ttyUSB0 (timeout = 3000ms, baudrate = 19200).
sr: serial: Detection timed out after 3000ms.
sr: serial: Didn’t find a valid packet (read 0 bytes).
sr: serial: Closing serial port /dev/ttyUSB0.
sr: hwdriver: Scan of ‘uni-t-ut61e-ser’ found 0 devices.
Very nice
Any chance of reviewing some oscilloscopes ?
Could do with replacing my HP52504 with something a lot smaller and quieter.
@Al
Probably not in the short term. There should be some good reviews on http://www.eevblog.com/.
Pulseview is not supporting DMM yet so that’s why UNI-T UT61E was not listed:
The analog only support on sigrok-cli is normal too, as other methods have not been implemented yet for analog data:
There’s now a patch to save analog data to csv
http://sourceforge.net/p/sigrok/mailman/message/33593445/
Sigrok has launched a program “Works with Sigrok” @ https://www.sigrok.org/blog/new-logo-works-sigrok, where manufacturers can add the Sigrok logo on their device.
Sigrok doesn’t capture the usb signal (not the rs232 link) out-of-the box from a ut-61c with ubuntu 16.04 on a lenovo x220.
Eval this script after the plug in the usb-link allows sigrok to get data :
Mine was shipped with a normal serial cable so ttyS0 worked for me. Also add your user to the dialout group so that you can have access to the serial port