Solved: Getting Brymen BM869s working with sigrok - Page 1
Forum section: electronics / testgear

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: August 12, 2017, 04:51:00 pm
content: I recently purchased a Brymen 869s multimeter. One of the factors I checked before purchase was that it is compatible with Sigrok and indeed it does appear on the compatibility list. I purchased the BU-86X USB adapter with it and it works fine under Windows using the software supplied.However, I am now trying to get it to work with Sigrok and am having problems with it. Firstly, although under Windows, when I run the driver install the software installs a Prolific PL-2303 USB-to-Serial driver, it doesn't get identified as such under Linux Mint. Lsusb does not detect it being plugged in at all:QuoteBy contrast my cheap generic Prolific PL2303 USB-to-Serial adapter is identified just fine:QuoteSigrok-cli somehow does detect the Brymen:QuoteHowever it does not then allow me to interact with the meter:QuoteWhat I am missing and why do I keep getting 'segmentation fault' when running the sigrok-cli script?

author: alm
author_rank: Super Contributor
timestamp: August 12, 2017, 04:56:41 pm
content: Does running sigrok-cli as root make any difference?

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: August 12, 2017, 05:02:15 pm
content: No, but the error message is a bit different:QuoteBTW, I have also added myself to the tty group but that makes no difference.

author: IanB
author_rank: Super Contributor
timestamp: August 12, 2017, 05:52:22 pm
content: One thing to note: the BM869s PC interface cable does not work through an emulated serial port. Device access is done directly through USB as an HID device. I haven't used sigrok, but if it is going to work it will need to be using an HID driver and not serial comms.

author: alm
author_rank: Super Contributor
timestamp: August 12, 2017, 06:13:18 pm
content: I do not see a problem with your lsusb output. It lists the correct vendor/product id. Just because lsusb does not recognize the ID does not mean the USB device was not recognized. If you are not convinced, try comparing the lsusb -v output with the output postedhere.Does it work if you try:Code:# sigrok-cli -d brymen-bm86x:conn=0820.0001 --scanThis might work because it apparently expects a conn parameter, and the vendor/product id is the only relevant parameter for a HID device. For an emulated RS-232 port it might be the tty device. See the sigrok-cli man page for some information about the conn= parameter.

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: August 12, 2017, 09:15:34 pm
content: alm, thanks for your comment.Quote from: alm on August 12, 2017, 06:13:18 pmI was a bit confused by this comment at first, but I think I understand what you mean. The device is being shown on the first line of the output, but because there was no description it was not obvious and I missed it.Quote from: alm on August 12, 2017, 06:13:18 pmOk, lsusb -v does indeed produce a device descriptor entry with the same ID - 0820:0001, but unlike the entry in the sigrok wiki, there is no iManufacturer and iProduct entry:Code:Bus 002 Device 019: ID 0820:0001Device Descriptor:bLength 18bDescriptorType 1bcdUSB 1.10bDeviceClass 0 (Defined at Interface level)bDeviceSubClass 0bDeviceProtocol 0bMaxPacketSize0 8idVendor 0x0820idProduct 0x0001bcdDevice 86.03iManufacturer 1iProduct 2iSerial 3bNumConfigurations 1Configuration Descriptor:bLength 9bDescriptorType 2wTotalLength 34bNumInterfaces 1bConfigurationValue 1iConfiguration 0bmAttributes 0xa0(Bus Powered)Remote WakeupMaxPower 100mAInterface Descriptor:bLength 9bDescriptorType 4bInterfaceNumber 0bAlternateSetting 0bNumEndpoints 1bInterfaceClass 3 Human Interface DevicebInterfaceSubClass 0 No SubclassbInterfaceProtocol 0 NoneiInterface 0HID Device Descriptor:bLength 9bDescriptorType 33bcdHID 1.10bCountryCode 0 Not supportedbNumDescriptors 1bDescriptorType 34 ReportwDescriptorLength 44Report Descriptors:** UNAVAILABLE **Endpoint Descriptor:bLength 7bDescriptorType 5bEndpointAddress 0x81 EP 1 INbmAttributes 3Transfer Type InterruptSynch Type NoneUsage Type DatawMaxPacketSize 0x0008 1x 8 bytesbInterval 10In all other respects the entry is similar.Quote from: alm on August 12, 2017, 06:13:18 pmWell the --scan command does seem to work:Code:$ sigrok-cli -d brymen-bm86x:conn=0820.0001 --scanThe following devices were found:brymen-bm86x - Brymen BM869 with 2 channels: P1 P2Segmentation faultNothing else does. For example (as root):Code:# sigrok-cli -d brymen-bm86x:conn=0820.0001 --showbrymen-bm86x - Brymen BM869 with 2 channels: P1 P2Supported driver options:connSupported configuration options:sr: brymen-bm86x: Failed to release interface 0: LIBUSB_ERROR_NOT_FOUND.Segmentation faultCode:# sigrok-cli -d brymen-bm86x:conn=0820.0001 --samples=10#

author: IanB
author_rank: Super Contributor
timestamp: August 12, 2017, 10:12:31 pm
content: Why does it keep saying "Segmentation fault"? Is there something wrong with how sigrok is installed?

author: alm
author_rank: Super Contributor
timestamp: August 12, 2017, 10:19:40 pm
content: That also looks weird to me. Could definitely be related to the problem, although running --show as root produces an error before it segfaults.What version of sigrok are you using (first couple of lines of sigrok-cli -V)?

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: August 12, 2017, 10:45:07 pm
content: It was installed from the MINT repository using:apt-get install sigrokapt-get install pulseviewVersion details as follows:$ sigrok-cli -V |moresigrok-cli 0.5.0Using libsigrok 0.3.0 (lib version 2:0:0).Using libsigrokdecode 0.3.0 (lib version 2:0:0).Code:Supported hardware drivers:agilent-dmm Agilent U12xx series DMMsappa-55ii APPA 55II...brymen-bm857 Brymen BM857brymen-bm86x Brymen BM86X...Just in case it has any bearing, here are my system details:Code:System: Host: agabus Kernel: 4.4.0-53-generic x86_64 (64 bit gcc: 5.4.0)Desktop: Cinnamon 3.2.6 (Gtk 3.18.9-1ubuntu3.1) dm: mdm Distro: Linux Mint 18.1 SerenaMachine: Mobo: ASUSTeK model: P8H61-M PRO v: Rev x.0xBios: American Megatrends v: 4802 date: 09/18/2013CPU: Quad core Intel Core i7-2600 (-HT-MCP-) cache: 8192 KBflags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) bmips: 27132clock speeds: min/max: 1600/3800 MHz 1: 1737 MHz 2: 1915 MHz 3: 1854 MHz 4: 1900 MHz5: 1728 MHz 6: 2436 MHz 7: 1897 MHz 8: 2202 MHzGraphics: Card: NVIDIA GT218 [GeForce 210] bus-ID: 01:00.0 chip-ID: 10de:0a65Display Server: X.Org 1.18.4 drivers: nouveau (unloaded: fbdev,vesa)Resolution: 1920x1080@60.00hz

author: alm
author_rank: Super Contributor
timestamp: August 12, 2017, 11:18:28 pm
content: Great, that ancient version that is in Debian (and all its derivatives like Ubuntu and Linux Mint). I am not saying this is the problem, but I would try a more recent version to determine if this bug got fixed sometime in the past three years (that is the age of the version you are using).Unfortunately I am not aware of an easy way to upgrade it. There are some instructions and reasons why it is not updated inthis recent topic. You could also try sending a PM to spikey1973 to ask if you can have their packages. I am not positive that your version of Mint is binary compatible with Ubuntu 17.04, but it is worth a try and would be less work than building them yourself.

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: August 13, 2017, 01:03:52 am
content: Yes that was the problem. Soon after I posted those version numbers I checked on the sigrok site and confirmed that these were out of date. The latest versions according to the sigrok website are:Code:libsigrok 0.5.0libsigrokdecode 0.5.0sigrok-cli 0.7.0pulseview 0.4.0So, I removed the old versions using apt-get remove and apt-get autoremove to remove unwanted dependencies, and set about compiling and installing the latest versions from source. It has taken me several hours to get through various issues including a problem with the gcc installation (needed to install gcc-multilib) and some missing libraries. I haven't got pulseview compiled yet, but I eventually got sigrok-cli and its supporting libraries (libsigrok, libsigrokdecode and libserialport) installed and compiled. I was able to use libusb from the repository.Having done that, I ran sigrok-cli again and it now seems to work OK:Code:$ sigrok-cli -d brymen-bm86x:conn=0820.0001 --scanThe following devices were found:brymen-bm86x - Brymen BM869 with 2 channels: P1 P2$ sudo sigrok-cli -d brymen-bm86x:conn=0820.0001 --show password for johnc:Driver functions:MultimeterContinuous samplingSample limitTime limitScan options:connbrymen-bm86x - Brymen BM869 with 2 channels: P1 P2Supported configuration options:(null):continuous: on, offlimit_samples: 0 (current)limit_time: 0 (current)$ sudo sigrok-cli -d brymen-bm86x:conn=0820.0001 --samples 10P1: 1.6 mV DC AUTOP1: 1.6 mV DC AUTOP1: -1.6 mV DC AUTOP1: -1.5 mV DC AUTOP1: 1.4 mV DC AUTOP1: 1.3 mV DC AUTOP1: -1.2 mV DC AUTOP1: -1.1 mV DC AUTOP1: -1.0 mV DC AUTOP1: 0.9 mV DC AUTOThat's much better!Everything seems to work and no segmentation errors.

author: WaveyDipole
author_rank: Frequent Contributor
timestamp: August 22, 2017, 10:24:33 am
content: Since I got sigrok-cli working I also moved on to compile PulseView and sigrok-meter. Along the way I received some help from the developpers in order to resolve dependencies and get a couple of omissions fixed. As I progressed the project I made some notes so that I could repeat the steps on another computer. I have decided to share them here in case they might help someone who is not very familiar with compiling sources or simply stuck at some point, in resolving their issue.

author: consumererik
author_rank: Newbie
timestamp: January 21, 2021, 07:41:19 pm
content: Thanks for the detailed build instructions, maybe I'll give it a try.Are you able to access the dmm programatically from the computer, or just via sigrok-meter GUI? Or maybe that is good enough anyway?

author: metaentity
author_rank: Newbie
timestamp: February 10, 2021, 03:05:23 pm
content: With this report I hope I will save some trouble to those who will try next, and reassure everybody that even on the latest firmware revision everything still works fine. Also I want to encourage more noobs like me to try sigrok, I think it's a great project.I have just tried installing sigrok-cli and making it work with my BM869s. My system is a Ubuntu 20.04.2 LTS (Focal Fossa) running Kernel 5.8.0-43-generic, and straight from Ubuntu repositories withCode:$ sudo apt install sigrok-cliI get this versionCode:$ sigrok-cli -Vsigrok-cli 0.7.1Libraries and features:- libsigrok 0.5.1/5:0:1 (rt: 0.5.2/5:1:1).- Libs:- glib 2.63.5 (rt: 2.64.6/6406:6)- libzip 1.5.1- libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1)- libusb-1.0 1.0.23.11397 API 0x01000107- hidapi 0.9.0- bluez 5.52- libftdi 1.4- Host: x86_64-pc-linux-gnu, little-endian.- SCPI backends: TCP, RPC, serial, USBTMC.- libsigrokdecode 0.5.2/6:0:2 (rt: 0.5.3/6:1:2).- Libs:- glib 2.63.3 (rt: 2.64.6/6406:6)- Python 3.8.1 / 0x30801f0 (API 1013, ABI 3)- Host: x86_64-pc-linux-gnu, little-endian.My DMM is a BM869s with firmware 869-PA (the one after P9, it's hex) and this is the output fromCode:lsusbCode:$ lsusb -vBus 001 Device 005: ID 0820:0001Device Descriptor:bLength 18bDescriptorType 1bcdUSB 2.00bDeviceClass 0bDeviceSubClass 0bDeviceProtocol 0bMaxPacketSize0 8idVendor 0x0820idProduct 0x0001bcdDevice 86.05iManufacturer 1 BrymeniProduct 2 Superior DMMiSerial 3 ĎᄂbNumConfigurations 1Configuration Descriptor:bLength 9bDescriptorType 2wTotalLength 0x0029bNumInterfaces 1bConfigurationValue 1iConfiguration 0bmAttributes 0xc0Self PoweredMaxPower 100mAInterface Descriptor:bLength 9bDescriptorType 4bInterfaceNumber 0bAlternateSetting 0bNumEndpoints 2bInterfaceClass 3 Human Interface DevicebInterfaceSubClass 0bInterfaceProtocol 0iInterface 0HID Device Descriptor:bLength 9bDescriptorType 33bcdHID 1.11bCountryCode 0 Not supportedbNumDescriptors 1bDescriptorType 34 ReportwDescriptorLength 30Report Descriptors:** UNAVAILABLE **Endpoint Descriptor:bLength 7bDescriptorType 5bEndpointAddress 0x81 EP 1 INbmAttributes 3Transfer Type InterruptSynch Type NoneUsage Type DatawMaxPacketSize 0x0040 1x 64 bytesbInterval 1Endpoint Descriptor:bLength 7bDescriptorType 5bEndpointAddress 0x01 EP 1 OUTbmAttributes 3Transfer Type InterruptSynch Type NoneUsage Type DatawMaxPacketSize 0x0040 1x 64 bytesbInterval 1can't get device qualifier: Resource temporarily unavailablecan't get debug descriptor: Resource temporarily unavailableDevice Status: 0x0001Self Poweredfinally, sigrok can find my DMMCode:$ sigrok-cli --scanThe following devices were found:demo - Demo device with 13 channels: D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3 A4brymen-bm86x - Brymen BM86x with 2 channels: P1 P2and upon closer inspection, everything looks fineCode:$ sigrok-cli --driver=brymen-bm86x --showDriver functions:MultimeterScan options:connserialcommbrymen-bm86x - Brymen BM86x with 2 channels: P1 P2Supported configuration options:continuous: on, offlimit_samples:limit_time:Beware, at first I thought the correct way to address my DMM wasCode:$ sigrok-cli --driver=brymen-bm86x:conn=0820.0001 --showwhich unfortunately results inCode:$ sigrok-cli --driver=brymen-bm86x:conn=0820.0001 --showDriver functions:MultimeterScan options:connserialcommsr: serial-libsp: Attempt to open serial port with invalid parameters.No devices found.and alsoCode:$ sigrok-cli --driver=brymen-bm86x:conn=0820.0001 --samples=10sr: serial-libsp: Attempt to open serial port with invalid parameters.No devices found.I suppose the reason is that it forces a wrong type of connection (serial). The man page states:Code:Drivers communicating with hardware via a serial port always need the port specified as the conn option. For example, to use the Openbench Logic Sniffer:$ sigrok-cli --driver=ols:conn=/dev/ttyACM0 [...]Some USB devices don't use a unique VendorID/ProductID combination, and thus need that specified as well. This also uses the conn option, using either VendorID.ProductID or bus.address:USB VendorID.ProductID example:$ sigrok-cli --driver=uni-t-ut61e:conn=1a86.e008 [...]USB bus.address example:$ sigrok-cli --driver=uni-t-ut61e:conn=4.6 [...]This works correctlyCode:$ sigrok-cli --driver=brymen-bm86x --samples=3P1: 0.1 mV DC AUTOP2: 172 mV ACP1: 0.1 mV DC AUTOP2: 172 mV ACP1: 0.1 mV DC AUTOP2: 172 mV ACCompiling from source (stable) gives a similar installation, while using the nightly image provides a more up-to-date version:Code:$ ~/Downloads/sigrok/source/sigrok-cli-NIGHTLY-x86_64.AppImage -Vsigrok-cli 0.8.0-git-a23df11Libraries and features:- libsigrok 0.6.0-git-1c5d590/4:0:0 (rt: 0.6.0-git-1c5d590/4:0:0).- Libs:- glib 2.48.2 (rt: 2.64.6/6406:6)- libzip 1.0.1- libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1)- libusb-1.0 1.0.23.11397 API 0x01000104- hidapi 0.8.0-rc1- bluez 5.37- libftdi 1.2- Host: x86_64-pc-linux-gnu, little-endian.- SCPI backends: TCP, RPC, serial, USBTMC.- libsigrokdecode 0.6.0-git-88b6260/4:0:0 (rt: 0.6.0-git-88b6260/4:0:0).- Libs:- glib 2.48.2 (rt: 2.64.6/6406:6)- Python 3.5.2 / 0x30502f0 (API 1013, ABI 3)- Host: x86_64-pc-linux-gnu, little-endian.Code:$ LD_LIBRARY_PATH=/opt/sigrok/lib /opt/sigrok/bin/sigrok-cli -Vsigrok-cli 0.7.1Libraries and features:- libsigrok 0.5.2/5:1:1 (rt: 0.5.2/5:1:1).- Libs:- glib 2.64.6 (rt: 2.64.6/6406:6)- libzip 1.5.1- libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1)- libusb-1.0 1.0.23.11397 API 0x01000107- hidapi 0.9.0- libftdi 1.4- librevisa 0.0.20130812- Host: x86_64-pc-linux-gnu, little-endian.- SCPI backends: TCP, RPC, serial, VISA, USBTMC.- libsigrokdecode 0.5.3/6:1:2 (rt: 0.5.3/6:1:2).- Libs:- glib 2.64.6 (rt: 2.64.6/6406:6)- Python 3.8.5 / 0x30805f0 (API 1013, ABI 3)- Host: x86_64-pc-linux-gnu, little-endian.On the other hand, the stable AppImage did not work for my DMM:Code:$ ~/Downloads/sigrok/source/sigrok-cli-0.7.1-x86_64.AppImage -Vsigrok-cli 0.7.1Libraries and features:- libsigrok 0.5.1/5:0:1 (rt: 0.5.1/5:0:1).- Libs:- glib 2.40.2 (rt: 2.64.6/6406:6)- libzip 0.10.1- libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1)- libusb-1.0 1.0.23.11397 API 0x01000102- libftdi 1.2- Host: x86_64-unknown-linux-gnu, little-endian.- SCPI backends: TCP, RPC, serial, USBTMC.- libsigrokdecode 0.5.2/6:0:2 (rt: 0.5.2/6:0:2).- Libs:- glib 2.40.2 (rt: 2.64.6/6406:6)- Python 3.4.3 / 0x30403f0 (API 1013, ABI 3)- Host: x86_64-unknown-linux-gnu, little-endian.Code:$ ~/Downloads/sigrok/source/sigrok-cli-0.7.1-x86_64.AppImage --driver=brymen-bm86x --showDriver functions:MultimeterScan options:connbrymen-bm86x - Brymen BM869 with 2 channels: P1 P2Supported configuration options:continuous: on, offlimit_samples: 0 (current)limit_time: 0 (current)sr: brymen-bm86x: Failed to release interface 0: LIBUSB_ERROR_NOT_FOUND.Segmentation fault (core dumped)Code:$ ~/Downloads/sigrok/source/sigrok-cli-0.7.1-x86_64.AppImage --driver=brymen-bm86x --samples=3sr: brymen-bm86x: HID feature report error: LIBUSB_ERROR_PIPE.Notes: it's important to set rules to access the hardware. Rules can be found herehttps://sigrok.org/gitweb/?p=libsigrok.git;a=tree;f=contriband can be loaded throughCode:udevadm control --reload-rules && udevadm triggerBuilding from source is well documented on the wiki, the only step I had trouble with is to make this little change before compilinghttps://sigrok.org/bugzilla/attachment.cgi?id=580this was a fixed bug which was still unfixed in the version I downloaded.