Author Topic: Logging data using Brymen BM867s with sigrok on Windows 10 (BU-86x USB cable)  (Read 1161 times)

0 Members and 1 Guest are viewing this topic.

Offline D-JanTopic starter

  • Newbie
  • Posts: 6
  • Country: de
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

 

Offline mwb1100

  • Frequent Contributor
  • **
  • Posts: 529
  • Country: us
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.

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.
 

Offline mwb1100

  • Frequent Contributor
  • **
  • Posts: 529
  • Country: us
One more suggestion that I forget: add the "--loglevel 5" option to the command line to get debugging output from sigrok.
 

Offline D-JanTopic starter

  • Newbie
  • Posts: 6
  • Country: de
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
 

Offline mwb1100

  • Frequent Contributor
  • **
  • Posts: 529
  • Country: us
Do you have any experience how to submit a bug to the developers of sigrok?

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: [Select]
/**
 * 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.
 */

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: [Select]
Bus 003 Device 006: ID 1366:0101 SEGGER J-Link PLUS
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: [Select]
-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.

 

Offline mwb1100

  • Frequent Contributor
  • **
  • Posts: 529
  • Country: us
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).
 

Offline D-JanTopic starter

  • Newbie
  • Posts: 6
  • Country: de
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 with sigrok-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-serial command?

Code: [Select]
-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

 

Offline mwb1100

  • Frequent Contributor
  • **
  • Posts: 529
  • Country: us
When using sigrok 0.7.2 did you open the connection with the full string that was displayed by the --list-serial command?

When 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: [Select]
C:\sigrok\sigrok-cli>sigrok-cli.exe  -d brymen-bm86x --samples 2
sr: 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 2
sr: 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 2
sr: 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: [Select]
C:\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.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-firmware
sr: [00:00.047000] backend:  - C:\ProgramData\sigrok-firmware
sr: [00:00.047000] backend:  - C:\Users\Public\Documents\sigrok-firmware
sr: [00:00.047000] backend:  - C:\sigrok\sigrok-cli\share\sigrok-firmware
sr: [00:00.048000] backend:  - C:\sigrok\sigrok-cli\share\sigrok-firmware
sr: [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.
 

Offline D-JanTopic starter

  • Newbie
  • Posts: 6
  • Country: de
Dear mwb1100,

just checked https://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-serial command:
Code: [Select]
"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#8&1f117607&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}      HID Brymen Superior DMM [0820.0001]

This is the output of the --scan command:
Code: [Select]
"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" --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

It even runs without stating the complete adress:
Code: [Select]
"C:\Program Files\sigrok\sigrok-cli\sigrok-cli.exe" -d brymen-bm86x --samples 2
P1: 9.977 V DC AUTO
P1: 9.977 V DC AUTO

Big  :-+ :-+ :-+ for your support!

Best regards
Jan
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf