pluto
Posts: 5
Joined: Mon May 27, 2013 4:35 pm

logging DDM data to RPi

Thu May 30, 2013 2:11 pm

Hi frens,

I am thinking if its possible to access the data/readings on my DDM via RPi. I have a APPA-109N Usb DDM.
I've been reading about Libusb but kinda confuse.

Any ideas/help is highly appreciated.

Thanks!!

danb35
Posts: 27
Joined: Thu Feb 07, 2013 6:00 pm

Re: logging DDM data to RPi

Fri May 31, 2013 4:55 pm

Without knowing more about this DMM, I'd first look into whether the QtDMM software is compatible--just do "sudo apt-get install qtdmm" at a command line to install it.

pluto
Posts: 5
Joined: Mon May 27, 2013 4:35 pm

Re: logging DDM data to RPi

Sun Jun 02, 2013 11:15 am

Actually, I am thinking to write some kinda device driver myself. you got some ideas, how to do? Thnx

danb35
Posts: 27
Joined: Thu Feb 07, 2013 6:00 pm

Re: logging DDM data to RPi

Sun Jun 02, 2013 11:40 am

None whatsoever, other than you'll first need to find some documentation on the data format or figure it out yourself. Does it present as a USB-serial device? If so, that'll likely make it easier to work with.

pluto
Posts: 5
Joined: Mon May 27, 2013 4:35 pm

Re: logging DDM data to RPi

Sun Jun 02, 2013 12:29 pm

danb35 wrote:None whatsoever, other than you'll first need to find some documentation on the data format or figure it out yourself. Does it present as a USB-serial device? If so, that'll likely make it easier to work with.
Not really. http://us.100y.com.tw/ChanPin.asp?MNo=56182

danb35
Posts: 27
Joined: Thu Feb 07, 2013 6:00 pm

Re: logging DDM data to RPi

Thu Jun 06, 2013 2:16 am

From the manufacturer's data sheet, linked from the page you gave: "All new APPA 100 series has RS-232 optical interface to connect to PC for data acquisition." RS-232 is a serial standard, so the USB interface is likely a USB-serial converter. Fire up a terminal program, connect it to whatever USB port gets created, and see what the meter sends over the wire as it's in use.

At this point, your problem really has nothing to do with the rPi. Your problem right now is figuring out how that DMM sends data. If there's a particular reason you need (or want) to use that meter, you're going to need to track down the data format it uses. Maybe the manufacturer's technical support can provide that information. Maybe there's a web forum that deals with that meter. Maybe there's a general electronics forum that could help. Maybe you can experiment with the meter directly. In any event, this part of your problem isn't an rPi problem. Now, if you don't need to use that particular meter, you can get one that's known to work with the Pi like the TekPower TP4000, which costs 90% less than this one.

Once you know the data format, if there's a particular reason that you need (or want) to write your own software to read it, that's something that seems much more relevant here.

pluto
Posts: 5
Joined: Mon May 27, 2013 4:35 pm

Re: logging DDM data to RPi

Wed Jun 12, 2013 9:27 am

thanks a lot, danb35. Actually, I've already got this dmm.
As you have said, I will try to find out the data format used by the DMm. Well, the reason for using my own application is that I want and need to learn how the code is written. I've read that some c-libraries ( libusb/pyusb) can give me access to the usb devices.

PiGraham
Posts: 3939
Joined: Fri Jun 07, 2013 12:37 pm
Location: Waterlooville

Re: logging DDM data to RPi

Wed Jun 12, 2013 10:19 am

As DanB35 points out, the datasheet mentions RS232, not USB. What connection do you have on the meter? If you have the two pin serial connection shown on the datasheet to a USB A plug it seems likely there is a USB serial adeaptor in the cable and communication is 232 serial. The OS will handle the USB stuff and you can open a serial device to get the data.

Try plugging the meter into your Pi and typing "lsusb". You may see reference to a USB serial device.
Try

Code: Select all

$ dmesg | grep tty
and look for something like:

Code: Select all

$> dmesg | grep
 'FTDI USB Serial Device converter now attached'
[36051.393350] usb 4-2: FTDI USB Serial Device converter now attached to ttyUSB1
[36061.823513] usb 4-1: FTDI USB Serial Device converter now attached to ttyUSB0
With any luck you may see measurement data as readable text.

That will tell you what serial devices you have available.

You could try minicom to connect to the tty device.
You may have to experiment with baud rate. Start at 9600.
If you have an oscilloscope and can connect to the Tx pin on the DMM you can measure the pulse width and calculate the baud rate. (See here)

pluto
Posts: 5
Joined: Mon May 27, 2013 4:35 pm

Re: logging DDM data to RPi

Thu Jun 13, 2013 8:41 am

hi PiGraham,
after dmesg, i got
[ 148.256594] usb 1-1.2: new full-speed USB device number 4 using dwc_otg
[ 148.359136] usb 1-1.2: New USB device found, idVendor=10c4, idProduct=ea60
[ 148.359166] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 148.359183] usb 1-1.2: Product: CP2102 USB to UART Bridge Controller
[ 148.359198] usb 1-1.2: Manufacturer: Silicon Labs
[ 148.359211] usb 1-1.2: SerialNumber: 0001
[ 148.411623] usbcore: registered new interface driver usbserial
[ 148.413327] usbcore: registered new interface driver usbserial_generic
[ 148.415141] USB Serial support registered for generic
[ 148.415183] usbserial: USB Serial Driver core
[ 148.422917] usbcore: registered new interface driver cp210x
[ 148.425050] USB Serial support registered for cp210x
[ 148.425208] cp210x 1-1.2:1.0: cp210x converter detected
[ 148.506523] usb 1-1.2: reset full-speed USB device number 4 using dwc_otg
[ 148.608670] usb 1-1.2: cp210x converter now attached to ttyUSB0

Return to “Other projects”