Hi,

On Sat, Mar 21, 2020 at 07:45:50PM +0100, David Sastre wrote:
> Hello,
> 
> I'm currently trying to add a new ID for the KORAD KA3005P V4.2 power
> supply.
> I have opened a BZ[1] to track this change, and submitted a pull request in
> GitHub[2].

This is merged now, thanks!


> sr: [00:00.067409] serial: Read 28/34 bytes.
> sr: [00:00.113299] serial: Read 2/6 bytes.
> sr: [00:04.562017] korad-kaxxxxp: Received: 'KORAD KA3005P V4.2 SN:53815993'.
> sr: [00:04.562125] korad-kaxxxxp: Received: 0, KORAD KA3005P V4.2 SN:53815993
> sr: [00:04.562160] korad-kaxxxxp: Found: Korad KA3005P (idx 5, ID 'KORAD 
> KA3005P V4.2').

That's 30 bytes being read, "KORAD KA3005P V4.2 SN:53815993" is exactly 30
bytes, i.e., there's no training 0x00 byte being sent by the firmware here (?)

 
> However, a second attempt to scan the same device fails with:
> 
> $ sigrok-cli --driver=korad-kaxxxxp:conn=/dev/ttyACM0 --scan --loglevel 5
> sr: [00:00.021541] serial: Wrote 5/5 bytes.
> sr: [00:00.066708] serial: Read 27/34 bytes.
> sr: [00:00.112019] serial: Read 2/7 bytes.

That's 29 bytes, which is the exact length of "ORAD KA3005P V4.2 SN:53815993".


> sr: [00:04.565224] korad-kaxxxxp: Received: 'ORAD KA3005P V4.2 SN:53815993'.
> sr: [00:04.565326] korad-kaxxxxp: Received: 0, ORAD KA3005P V4.2 SN:53815993
> sr: [00:04.565361] korad-kaxxxxp: Unknown model ID 'ORAD KA3005P V4.2' 
> detected, aborting.
> sr: [00:04.565391] hwdriver: Scan found 0 devices (korad-kaxxxxp).
> sr: [00:04.565448] hwdriver: Cleaning up all drivers.
> 
> because, apparently, the device is not sending the entire ID this time.

You can try to send "*IDN?" manually in a serial terminal (9600/8n1)
multiple times and check if you always get the same reply.

I've done this on my "KORADKA3005PV2.0" in a serial terminal, and I get
the same reply every time ("KORADKA3005PV2.0" followed by a 0x00 byte).

It also works reliably multiple times in a row with sigrok-cli:

sr: [00:00.027515] korad-kaxxxxp: Sending '*IDN?'.
sr: [00:00.027551] serial: Wrote 5/5 bytes.
sr: [00:00.075572] serial: Read 13/34 bytes.
sr: [00:00.122561] serial: Read 4/21 bytes.
sr: [00:04.730652] korad-kaxxxxp: Received: 'KORADKA3005PV2.0'.
sr: [00:04.730689] korad-kaxxxxp: Received: 0, KORADKA3005PV2.0
sr: [00:04.730711] korad-kaxxxxp: Found: Korad KA3005P (idx 2, ID 
'KORADKA3005PV2.0').

That's 17 bytes being read, 16 for "KORADKA3005PV2.0" and 1 for the 0x00.

 
> Turning the device off and on resets the serial communication and the scan
> succeeds again.

Please also try multiple times without on/off, but wait 30 seconds or so
between the attempts. Does that change anything?


> A second question: as you can see in the BZ, it has been suggested to use
> 5.1 amps as the value in the model definition.
> However, the datasheet and the manual, both say 5 amps.
> I'm keeping the suggestion, though, because I assume it comes from someone
> more knowledgeable than me, but I can't find a source to verify it.

I've changed all devices to 5.1A now, this seems to be a common property
of them all, see Bugzilla for details.


Cheers, Uwe.
-- 
http://hermann-uwe.de | http://randomprojects.org | http://sigrok.org


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

Reply via email to