Products > Test Equipment

Logging data using Brymen BM867s with sigrok on Windows 10 (BU-86x USB cable)

(1/2) > >>

D-Jan:
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 drivers brymen-bm86x sounds sensible:

"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe"  -L
Supported hardware drivers:
  ..
  brymen-bm86x         Brymen BM86x


so I tried


"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe"  -d brymen-bm86x --samples 2
sr: 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_connections
My device has USB VID 0820 / PID 0001.

"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe"  -d brymen-bm86x:conn=0820.0001 --samples 2
sr: 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"  --scan
sr: 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 A4


 :-\

Then I tried

"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe"  --list-serial
Available 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-serial output. Took me a while to get rid of the libusb /libusbK drivers  :-X

Basically 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 regards
Jan

mwb1100:
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:


--- Quote ---TODO This chapter needs an update. It has not yet caught up with the recent HIDAPI library approach, and conn=hid/ syntax. When in doubt, check the README.devices file -- it's probably more up to date than this wiki page.
--- End quote ---

So you might need to  use some different syntax?

2. Try running from a command window that has been elevated to administrator

3. 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.

mwb1100:
One more suggestion that I forget: add the "--loglevel 5" option to the command line to get debugging output from sigrok.

D-Jan:
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 --scan to 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 5
sr: [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 5
sr: [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 get sigrok-cli 0.7.2
Even 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 --scan
The following devices were found:
demo - Demo device with 13 channels: D0 D1 D2 D3 D4 D5 D6 D7 A0 A1 A2 A3 A4
brymen-bm86x - Brymen BM86x with 2 channels: P1 P2
~$ sigrok-cli -d brymen-bm86x --samples 2
P1: 7.6 mV AC AUTO
P2: 0 mHz
P1: 7.6 mV AC AUTO
P2: 0 mHz


Do you have any experience how to submit a bug to the developers of sigrok?

Best regards
Jan

mwb1100:

--- Quote from: D-Jan on January 24, 2024, 09:38:25 am ---Do you have any experience how to submit a bug to the developers of sigrok?

--- End quote ---

Sorry, 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[in] serial The serial port that is about to get opened.
 * @param[in] spec The caller provided conn= specification.
 * @param[out] chip_ref Pointer to a chip type (enum).
 * @param[out] path_ref Pointer to a USB path (text string).
 * @param[out] 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.
 */

--- End code ---

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 PLUS
--- End code ---

The 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}"

--- End code ---

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.

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod