Advices/infos about USB-connected
Yann Guidon / YGDES wrote 04/09/2017 at 01:42 • 0 pointsHello all,
I just received a couple of USB-capable devices (merci eBay !) and I'm trying to make them talk to my Linux-based computer.
Mastech MS8250D : a good-looking handheld multimeter (I needed to replace my 15yo Wavetek)
1254400.843474] usb 2-1.2: new full-speed USB device number 32 using ehci-pci
[1254400.923681] usb 2-1.2: New USB device found, idVendor=10c4, idProduct=ea60
[1254400.923687] usb 2-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[1254400.923690] usb 2-1.2: Product: CP2102 USB to UART Bridge Controller
[1254400.923694] usb 2-1.2: Manufacturer: Silicon Labs
[1254400.923696] usb 2-1.2: SerialNumber: 0001
[1254400.926106] cp210x 2-1.2:1.0: cp210x converter detected
[1254400.927227] usb 2-1.2: cp210x converter now attached to ttyUSB0
So it's apparently easy to connect, the interface chip is well known but the data format is weird. I setup the port with wild guesses:
stty 1200 cs8 raw -echo -echoe -echonl -echoprt -echoctl -echoke -parenb -F /dev/ttyUSB0
od -An -v -w1 -t x1 /dev/ttyUSB0 shows a constant stream of bytes that are cryptic but repetitive, and vary with the measured voltage. Maybe @Alain Mauer can help ?
At 1200baud, I detect a repetitive pattern of 9 bytes: here with no input in DC Volts
00 20 85 a1 24 01 00 00 00
from time to time I see transmission errors...
The pattern changes when I change the input voltage.
.
Axiomet AX6002P programmable lab PSU : A pretty nice cheap system, but a definite plus for my lab !
I only have "analog" PSUs and this one can set the voltage easily :-) It features a RS232+USB connector, and the documentation gives some hints about the parameters : 9600, 8N1
I found the manual of the following model (the more capable 6003P, that handles 3A instead of 2, and with LCD instead of LED display) and it mentions SCPI.
TTY=/dev/ttyACM3
stty 9600 cs8 raw -echo -echoe -echonl -echoprt -echoctl -echoke -parenb -F $TTY
the command echo -n "*IDN?" > $TTY returns the string "KORADKA6002PV2.0"
weird though : SCPI says that commands end with \n or \lf\n, but I only got the response with the "-n" option of echo, which doesn't send a newline char... And no other standard command seems to be recognised ? and the vendor string is unknown to Google...
.
Really I don't want to use Windows and install their crappy software because that would not let me use the tools as I intend - I don't need a fancy useless buggy interface when I already have the tools in hand, I want to script and use both the multimeter and PSU at the same time, not separately... What's the point otherwise ?
Help...
thanks ;-)
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.
echo -n "VSET1?" > $TTY
works !
Thank you @Andrew Bolin
Are you sure? yes | no
echo -n "VSET1:60" > $TTY
works too.
Are you sure? yes | no
other commands are listed at http://sigrok.org/wiki/Korad_KAxxxxP_series#Protocol
so this case seems to be solved :-D
Now, the multimeter is a different beast.
Are you sure? yes | no
If you can understand Python, this software might help with the power supply: https://github.com/starforgelabs/py-korad-serial
A comment within also references this page: www.eevblog.com/forum/testgear/korad-ka3005p-io-commands/
Are you sure? yes | no
Damned ! my google-fu is rusty !
Thanks so much !
Are you sure? yes | no
I searched for "KORADKA" but not "KORAD" or "KORAD KA"...
Are you sure? yes | no
Hey Yann.
Those speeds seem a bit slow for a device that age - 1200 is out of the ark and 9600 is only barely quick enough to keep up with a stream of data from a meter. I'd suggest trying 19200 and 115200.
Its possible the chip detects the speed for connection and ACKs with KORADetc using it, but does the main communication at whatever protocol it's been set at by its previous owner.
SYST:COM:SER:BAUD?
reports this, so the first thing I'd do is
SYST:COM:SER:PAR?
and the like as well to see if it will report any of the other settings. As you said, IEE488.2 is a right old mess. You've obviously been busy, all the references to Skippy that I can find are now cached in French ;-)
I do know that CP2x chipset supports independent async and detects speed. I have a bluetooth dongle that has one, and that always detects the terminal but I have to send it ancient ATH instructions to program the data rate and settings for actual use. Didnt think I'd ever see those again after broadband but never mind :-)
Are you sure? yes | no
The 9600 is right : it's in the doc and it's not a fast machine, the PSU updates the readings a few times per second.
I wish there was a manual with all the available SCPI commands, like with more established brands. I tried things "inspired" by these and no result. I'll try your commands... The PSU was sold as new so "no previous owner".
For the multimeter, there are about 5 readings per second so 5×10bits×9bytes=500bps, still less than 1200. Maths don't lie ;-)
At least I can use these tools in the normal way so I'm not impeded in my work but playing with the mA resolution of the current limit of the PSU would greatly help me characterize and bin the 3K relays of my ongoing computer project :-D
Are you sure? yes | no
I'd be inclined to boot up an unfussy VM, like XP or something that doesnt get in the way, and sniff the port while watching what the proprietary software does with it. It might clue you in to what those numbers mean. Odd that the sequence starts with a space char (20h) as you've written it.
Are you sure? yes | no
if only I could avoid a VM...
Are you sure? yes | no