On 10/2/20 11:45 AM, Gerhard Sittig wrote:
> On Thu, 2020-10-01 at 21:57 +0200, Michael Ströder wrote:
>>
>> I'm trying to query data from a sound level meter PCE-322A on Linux
>> (openSUSE Tumbleweed).
>> [..]
>> $ sigrok-cli --driver=pce-322a:conn=/dev/ttyUSB0 -l 5 --show
>> [ ... ]
>> Failed to open device.
> 
> The pce-322a support was introduced in 2016. In 2017 a bug snuck
> into the driver source during maintenance and fixing of a serial
> layer API use issue.
> [..]
> Have massaged the code, but cannot test whether the fix is
> effective without access to the hardware. See the attachment.

Thanks for your quick fix!

I've applied your patch to a custom build of the libsigrok4 package [1].
At least I'm a step further:

$  sigrok-cli --driver=pce-322a:conn=/dev/ttyUSB0 --show
Driver functions:
    Sound level meter
Scan options:
    conn
pce-322a - PCE PCE-322A with 1 channel: SPL
Supported configuration options:
    continuous: on, off
    limit_samples: 0 (current)
    spl_weight_freq: A (current), C
    spl_weight_time: F (current), S
    spl_meas_range: 0-0, 0-0, 0-0, 0-0
    power_off: on, off (current)
    data_source: Live (current), Memory

I have some doubts though because the vendor sent me a (really horrible)
interface description which differs quite a lot from [2]. The manual
seems to mention different models all labeled PCE-322A which is pretty
confusing. :-/

Unfortunately I'm not a C programmer. So I can't directly contribute to
libsigrok. FWIW I'm currently experimenting a bit with Python and
pyserial module to at least read the sound level value and I was
successful. But up to now I was not successful sending commands to the
device. I will let you know if I have explored all this some more.

> Also please state if you want your name on the commit message as
> the user who helped improve the software by reporting the issue.

It's fine to add my name.

Thanks again for your efforts.

Ciao, Michael.

[1]
https://build.opensuse.org/package/show/home:stroeder:branches:electronics/libsigrok

[2] https://sigrok.org/wiki/PCE_PCE-322A


_______________________________________________
sigrok-devel mailing list
sigrok-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sigrok-devel

Reply via email to