Logging data using Brymen BM867s with sigrok on Windows 10 (BU-86x USB cable) - Page 1
Forum section: electronics / testgear

author: D-Jan
author_rank: Contributor
timestamp: January 22, 2024, 05:15:19 pm
content: Hi all,I am trying to readout data from a Brymen BM867s DMM:I have installed sigrok-cli 0.8.0-git-9d9f7b8.Invoking sigrok-cli to list available driversbrymen-bm86xsounds sensible:"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" -LSupported hardware drivers:..brymen-bm86x Brymen BM86xso I tried"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" -d brymen-bm86x --samples 2sr: serial-hid: Failed to open HID device.No devices found.mmmh. My DMM comes with a USB cable. Searching along there is an option to specify a USB device:https://sigrok.org/wiki/Connection_parameters#USB_HID_connectionsMy device has USB VID 0820 / PID 0001."C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" -d brymen-bm86x:conn=0820.0001 --samples 2sr: serial-libsp: Error opening port (2): Das System kann die angegebene Datei nicht finden..No devices found.There is also a scan option for sigrok-cli:"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" --scansr: asix-omega-rtm-cli: Cannot execute RTM CLI process: Failed to execute helper program (Invalid argument)sr: serial-hid: Failed to open HID device.sr: serial-hid: Failed to open HID device.sr: serial-hid: Failed to open HID device.The following devices were found:demo - Demo device with 13 channels: D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3 A4Then I tried"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" --list-serialAvailable serial/HID/BT/BLE ports:COM3 USB-SERIAL CH340 (COM3)hid/bu86x/raw=\\?\hid#vid_0820&pid_0001#7&1f6ef3cb&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} HID Brymen Superior DMM [0820.0001]The first one is my JT-RD6006 Power Supply. The second is the Brymen DMM.Does anyone know, how to tell sigrok to use the latter device?I have already tried to replace the Windoze HID driver with Zadig. But doing so, the DMM disappears from the--list-serialoutput. Took me a while to get rid of the libusb /libusbK driversBasically I just want to sweep the voltage of my PSU with python and measure the output current of my circuit with the DMM. Because it is a Buck-converter I cannot use the current from the RD6006.Any help is highly appreciated.Best regardsJan

author: mwb1100
author_rank: Frequent Contributor
timestamp: January 22, 2024, 05:57:22 pm
content: I have a few suggestions, but keep in mind I haven't tried using sigrok with anything but logic analyzers (and even that was a while ago).1. the wiki page about using HID devices starts with:QuoteSo you might need to use some different syntax?2. Try running from a command window that has been elevated to administrator3. It wouldn't surprise me if sigrok on Windows lags behind sigrok on Linux. Give Linux a try - if you don't have such a machine available, VirtualBox is free and works quite well. Virtual Box's USB support was moved into the main VirtualBox build in v7.0 (so you won't need the weirdly licensed "extension pack"). Once you connect a USB device to the virtual machine, Windows' USB driver mess is out of the picture.You might find that you need to run the commands as root (using sudo) - if you find that's it works as root but not as a regular user we can talk about how to configure the USB device to allow a regular user to access it.

author: mwb1100
author_rank: Frequent Contributor
timestamp: January 22, 2024, 06:08:23 pm
content: One more suggestion that I forget: add the "--loglevel 5" option to the command line to get debugging output from sigrok.

author: D-Jan
author_rank: Contributor
timestamp: January 24, 2024, 09:38:25 am
content: Dear mwb1100,many thanks for your suggestions.Trying --loglevel 5 on the Windoze Machine did not provide much new evidence: I get a (flags 1) when trying to open the port. It is good that sigrok prints out the port name with the increased loglevel. But I have not suceeded in matching the port found by--scanto a port that suitable for the:conn="c:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" -d brymen-bm86x:conn=0820.0001 --samples 2 --loglevel 5sr: [00:00.000000] log: libsigrok loglevel set to 5.sr: [00:00.000000] backend: libsigrok 0.6.0-git-b503d24/4:0:0.sr: [00:00.002000] backend: Libs: glib 2.44.1 (rt: 2.44.1/4401:1), zlib 1.2.11, libzip 1.5.2, minilzo 2.10, libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1), libusb-1.0 1.0.23.11470 API 0x01000108, hidapi 0.8.0-rc1, libftdi 1.4.sr: [00:00.003000] backend: Host: x86_64-w64-mingw32.static.posix, little-endian...srd: libsigrokdecode loglevel set to 5.sr: [00:00.021000] hwdriver: sr_config_list(): key 2147418112 (NULL) sdi 0000000000000000 cg NULL -> [uint32 20000, 20001]sr: [00:00.021000] serial: Opening serial port '0820.0001' (flags 1).sr: [00:00.027000] serial-libsp: Error opening port (2): Das System kann die angegebene Datei nicht finden..sr: [00:00.027000] hwdriver: Scan found 0 devices (brymen-bm86x).No devices found."c:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" -d brymen-bm86x --samples 2 --loglevel 5sr: [00:00.000000] log: libsigrok loglevel set to 5.sr: [00:00.000000] backend: libsigrok 0.6.0-git-b503d24/4:0:0.sr: [00:00.000000] backend: Libs: glib 2.44.1 (rt: 2.44.1/4401:1), zlib 1.2.11, libzip 1.5.2, minilzo 2.10, libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1), libusb-1.0 1.0.23.11470 API 0x01000108, hidapi 0.8.0-rc1, libftdi 1.4.sr: [00:00.001000] backend: Host: x86_64-w64-mingw32.static.posix, little-endian....srd: libsigrokdecode loglevel set to 5.sr: [00:00.016000] serial: Opening serial port 'hid/bu86x' (flags 1).sr: [00:00.094000] serial-hid: Failed to open HID device.sr: [00:00.094000] hwdriver: Scan found 0 devices (brymen-bm86x).No devices found.Regarding your comment to try sigrok using Linux:On a Debian machine installing sigrok-cli with apt I getsigrok-cli 0.7.2Even if this version (using sigrok from the Debian distro) is behind the version tried on Windoze it runs out of the box:~$ sigrok-cli --list-serial..Available serial/HID/BT/BLE ports:hid/bu86x/raw=/dev/hidraw2 HID Brymen Superior DMM [0820.0001]~$ 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 P2~$ sigrok-cli -d brymen-bm86x --samples 2P1: 7.6 mV AC AUTOP2: 0 mHzP1: 7.6 mV AC AUTOP2: 0 mHzDo you have any experience how to submit a bug to the developers of sigrok?Best regardsJan

author: mwb1100
author_rank: Frequent Contributor
timestamp: January 25, 2024, 03:12:47 am
content: Quote from: D-Jan on January 24, 2024, 09:38:25 amSorry, no.First off - did you try running those commands on Windows in an elevated (admin) command window?Second:I took a look at the source code (from the git://sigrok.org/libsigrok repository) and the name for as USB HID device must be "hid" or start with "hid/". Here's a comment from the code that explains the name format in more detail:Code:/*** Parse conn= specs for serial over HID communication.** @param serial The serial port that is about to get opened.* @param spec The caller provided conn= specification.* @param chip_ref Pointer to a chip type (enum).* @param path_ref Pointer to a USB path (text string).* @param serno_ref Pointer to a serial number (text string).** @return 0 upon success, non-zero upon failure. Fills the *_ref output* values.** Summary of parsing rules as they are implemented:* - Insist on the "hid" prefix. Accept "hid" alone without any other* additional field.* - The first field that follows can be a chip spec, yet is optional.* - Any other field is assumed to be either a USB path or a serial* number. There is no point in specifying both of these, as either* of them uniquely identifies a device.** Supported formats resulting from these rules:* hid[/<chip>]* hid[/<chip>]/usb=<bus>.<dev>[.<if>]* hid[/<chip>]/raw=<path>(may contain slashes!)* hid[/<chip>]/sn=serno** This routine just parses the conn= spec, which either was provided by* a user, or may reflect (cite) an item of a previously gathered listing* (clipboard provided by CLI clients, or selected from a GUI form).* Another routine will fill in the blanks, and do the cable selection* when a filter was specified.** Users will want to use short forms when they need to come up with the* specs by themselves. The "verbose" or seemingly redundant forms (chip* _and_ path/serno spec) are useful when the cable uses non-standard or* not-yet-supported VID:PID items when automatic chip detection fails.*/Note that there's no mention of a "<vid>.<pid>" name format unless that's what the comment means by "<bus>.<dev>", but I don't think it does. "<bus>.<dev>" are almost certainly talking about the bus and device IDs that Linux assigns to USB devices, and those IDs have nothing to with the VID:PID as can be seen from this sample output from lsusb:Code:Bus 003 Device 006: ID 1366:0101 SEGGER J-Link PLUSThe debug log you posted shows that when you don't specify a device name, sigrok tries and fails to open 'hid/bu86x', which looks like the correct name from the "--list-serial" output.Maybe try specifying the device like so:Code:-d "brymen-bm86x:conn=hid/bu86x/raw=\\?\hid#vid_0820&pid_0001#7&1f6ef3cb&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}"I think you will need the quotes because of the backslashes in the string, but I'm not 100% sure.But it does seem that something is broken with sigrok opening a HID device on Windows - I think the failure when it tries to open 'hid/bu86x' points to a bug.

author: mwb1100
author_rank: Frequent Contributor
timestamp: January 26, 2024, 12:07:44 am
content: Good news:I tried one more thing. I have a BM525s with a BU-86X cable. sigrok doesn't support the BM525s, but I figured that since the cable is the same I could at least see what happens in the loglevel 5 output as far as opening the HID device. And the logging shows that the HID device is opened and written to successfully (even though no response is found - I assume because the BM525s protocol expects something different).I am running Win11 and the version of sigrok I have is the'release' version 0.7.2, which is older than the one you are using. I installed the nightly (which matches the version you're using) and then I see the same error opening the HID device that you are seeing.So I think the quick fix for you is to downgrade to the release version 0.7.2. If that works for you, it would be good if you can let the sigrok dev(s) know about the problem in 0.8.0, but I don't know what the process for sigrok bug reports (unfortunately sigrok doesn't use GitHub).

author: D-Jan
author_rank: Contributor
timestamp: January 26, 2024, 01:22:16 pm
content: Dear mwb1100,On my Windoze machine I am using sigrok-cli as a normal user. I am aware that with Linux systems you sometimes have no access to peripherals. Never met this issue with Windoze, though.My quick workaround was to user my private UNI-T UT61E withsigrok-cli -d uni-t-ut61e-ser:conn=COM14 --samples 2.This meter has a serial cable and by adding a FTDI USB to 4xRS232 to my computer it worked out of the box!Enumeration of serial ports on Win is strange, but that's an issue that can be tackled.I do not have the Brymen on hand today. I will try next week when I'm back in the lab.When using sigrok 0.7.2 did you open the connection with the full string that was displayed by the--list-serialcommand?Code:-d "brymen-bm86x:conn=hid/bu86x/raw=\\?\hid#vid_0820&pid_0001#7&1f6ef3cb&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}"Many thanks in advance for your support!Have a nice weekend!Jan

author: mwb1100
author_rank: Frequent Contributor
timestamp: January 26, 2024, 06:43:33 pm
content: Quote from: D-Jan on January 26, 2024, 01:22:16 pmWhen using the release sigrok-cli (v0.7.2), I can use any of the following device names to get the HID opened and the multimeter probed (as mentioned before, the HID is opened but the probe fails because I don't have a BM86x attached to the cable). Note that the raw HID device name is machine specific, so yours is different than the one I used. And the quotes are necessary for the raw name.Code:C:\sigrok\sigrok-cli>sigrok-cli.exe -d brymen-bm86x --samples 2sr: serial: Didn't find a valid packet (read 0 bytes).No devices found.C:\sigrok\sigrok-cli>sigrok-cli.exe -d brymen-bm86x:conn=hid/bu86x --samples 2sr: serial: Didn't find a valid packet (read 0 bytes).No devices found.C:\sigrok\sigrok-cli>sigrok-cli.exe -d "brymen-bm86x:conn=hid/bu86x/raw=\\?\hid#vid_0820&pid_0001#8&4cc1352&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}" --samples 2sr: serial: Didn't find a valid packet (read 0 bytes).No devices found.Here is the output from the simplest command with full logging enabled to show the HID is opened successfully. All three ways of specifying the device produce similar output.Code:C:\sigrok\sigrok-cli>sigrok-cli.exe -d brymen-bm86x --samples 2 --loglevel 5sr: [00:00.000000] log: libsigrok loglevel set to 5.sr: [00:00.000000] backend: libsigrok 0.5.2/5:1:1.sr: [00:00.000000] backend: Libs: glib 2.44.1 (rt: 2.44.1/4401:1), libzip 1.5.2, libserialport 0.1.1/1:0:1 (rt: 0.1.1/1:0:1), libusb-1.0 1.0.20.11003-rc3 API 0x01000104, hidapi 0.8.0-rc1, libftdi 1.4.sr: [00:00.002000] backend: Host: x86_64-w64-mingw32.static.posix, little-endian.sr: [00:00.002000] backend: SCPI backends: TCP, serial, USBTMC.sr: [00:00.003000] backend: Firmware search paths:sr: [00:00.047000] backend: - C:\Users\mburr\AppData\Local\sigrok-firmwaresr: [00:00.047000] backend: - C:\ProgramData\sigrok-firmwaresr: [00:00.047000] backend: - C:\Users\Public\Documents\sigrok-firmwaresr: [00:00.047000] backend: - C:\sigrok\sigrok-cli\share\sigrok-firmwaresr: [00:00.048000] backend: - C:\sigrok\sigrok-cli\share\sigrok-firmwaresr: [00:00.048000] backend: Sanity-checking all drivers.sr: [00:00.048000] backend: Sanity-checking all input modules.sr: [00:00.048000] backend: Sanity-checking all output modules.sr: [00:00.049000] backend: Sanity-checking all transform modules.srd: libsigrokdecode loglevel set to 5.sr: [00:00.054000] serial: Opening serial port 'hid/bu86x' (flags 1).sr: [00:00.099000] serial-dmm: Probing serial port hid/bu86x.sr: [00:00.100000] serial: Flushing serial port hid/bu86x.sr: [00:00.101000] serial: Wrote 4/4 bytes.sr: [00:00.102000] serial: Detecting packets on hid/bu86x (timeout = 3000ms).sr: [00:03.198000] serial: Detection timed out after 3096ms.sr: [00:03.199000] serial: Didn't find a valid packet (read 0 bytes).sr: [00:03.200000] serial: Closing serial port hid/bu86x.sr: [00:03.200000] hwdriver: Scan found 0 devices (brymen-bm86x).No devices found.

author: D-Jan
author_rank: Contributor
timestamp: January 29, 2024, 12:24:07 pm
content: Dear mwb1100,just checkedhttps://sigrok.org/download/binary/sigrok-cli/sigrok-cli-0.7.2-x86_64-installer.exe.with this version connection to my Brymen works great!Here is the output of the--list-serialcommand:Code:"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" --list-serialAvailable serial/HID/BT/BLE ports:COM3 USB-SERIAL CH340 (COM3)hid/bu86x/raw=\\?\hid#vid_0820&pid_0001#8&1f117607&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030} HID Brymen Superior DMM [0820.0001]This is the output of the--scancommand:Code:"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" --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 P2It even runs without stating the complete adress:Code:"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" -d brymen-bm86x --samples 2P1: 9.977 V DC AUTOP1: 9.977 V DC AUTOBigfor your support!Best regardsJan